Added a bunch of types

This commit is contained in:
Fred Carlsen
2018-12-12 13:08:52 +01:00
parent 5df160ffb9
commit 088ca6ce7c
5 changed files with 21 additions and 3 deletions

View File

@@ -33,6 +33,7 @@
"@0x/utils": "^2.0.6",
"@0x/web3-wrapper": "^3.1.6",
"@types/react-lazyload": "^2.3.1",
"@types/react-loadable": "^5.4.2",
"@types/react-syntax-highlighter": "^0.0.8",
"@types/styled-components": "^4.1.1",
"accounting": "^0.4.1",

View File

@@ -11,6 +11,7 @@ interface ButtonInterface {
children?: Node | string;
isTransparent?: boolean;
isNoBorder?: boolean;
isCentered?: boolean;
isNoPadding?: boolean;
isWithArrow?: boolean;
isAccentColor?: boolean;

View File

@@ -27,6 +27,12 @@ interface NavItem {
url?: string;
id?: string;
text?: string;
dropdownWidth?: number;
dropdownComponent?: React.ReactNode;
}
interface DropdownWrapInterface {
width?: number;
}
const mobileProductLinks = [
@@ -240,7 +246,7 @@ const LinkWrap = styled.div`
}
`;
const DropdownWrap = styled.div`
const DropdownWrap = styled.div<DropdownWrapInterface>`
width: ${props => props.width || 280}px;
padding: 15px 0;
border: 1px solid transparent;

View File

@@ -33,6 +33,7 @@ interface WrapProps extends PaddingInterface {
interface ColumnProps {
colWidth?: '1/4' | '1/3' | '1/2' | '2/3';
isNoPadding?: boolean;
isNoMargin?: boolean;
isPadLarge?: boolean;
isFlexGrow?: boolean;
isMobileCentered?: boolean;
@@ -44,6 +45,10 @@ interface GetColWidthArgs {
columns: number;
}
export interface WrapStickyInterface {
offsetTop?: string;
}
const _getColumnWidth = (args: GetColWidthArgs): string => {
const { span = 1, columns } = args;
const percentWidth = (span / columns) * 100;
@@ -126,7 +131,7 @@ export const WrapCentered = styled(WrapBase)`
text-align: center;
`;
export const WrapSticky = styled.div`
export const WrapSticky = styled.div<WrapStickyInterface>`
position: sticky;
top: ${props => props.offsetTop || '60px'};
`;

View File

@@ -7,6 +7,11 @@ import {Heading, Paragraph} from 'ts/@next/components/text';
interface ProjectLogo {
name: string;
imageUrl?: string;
persistOnMobile?: boolean;
}
interface StyledProjectInterface {
isOnMobile?: boolean;
}
const projects: ProjectLogo[] = [
@@ -74,7 +79,7 @@ export const SectionLandingClients = () => (
</Section>
);
const StyledProject = styled.div`
const StyledProject = styled.div<StyledProjectInterface>`
flex-shrink: 0;
img {