Consolidated community links
This commit is contained in:
committed by
fabioberger
parent
78a60a9973
commit
81b9ab2b6e
@@ -15,6 +15,20 @@ export interface ICommunityLinkProps {
|
|||||||
url: string;
|
url: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ICommunityLinksProps {
|
||||||
|
links: ICommunityLinkProps[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export const CommunityLinks: React.FC<ICommunityLinksProps> = ({ links }) => {
|
||||||
|
return (
|
||||||
|
<CommunityLinksWrapper>
|
||||||
|
{links.map((link, index) => (
|
||||||
|
<CommunityLink key={`communityLink-${index}`} {...link} />
|
||||||
|
))}
|
||||||
|
</CommunityLinksWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const CommunityLink: React.FC<ICommunityLinkProps> = props => (
|
export const CommunityLink: React.FC<ICommunityLinkProps> = props => (
|
||||||
<CommunityLinkWrapper to={props.url} shouldOpenInNewTab={true}>
|
<CommunityLinkWrapper to={props.url} shouldOpenInNewTab={true}>
|
||||||
<CommunityIcon color={colors.brandLight} name={props.icon} margin={[0, 0, 24, 0]} />
|
<CommunityIcon color={colors.brandLight} name={props.icon} margin={[0, 0, 24, 0]} />
|
||||||
@@ -27,6 +41,17 @@ export const CommunityLink: React.FC<ICommunityLinkProps> = props => (
|
|||||||
</CommunityLinkWrapper>
|
</CommunityLinkWrapper>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const CommunityLinksWrapper = styled.div`
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
grid-column-gap: 30px;
|
||||||
|
grid-row-gap: 30px;
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
const CommunityLinkWrapper = styled(Link)`
|
const CommunityLinkWrapper = styled(Link)`
|
||||||
background-color: ${colors.backgroundLight};
|
background-color: ${colors.backgroundLight};
|
||||||
border: 1px solid #dbdfdd;
|
border: 1px solid #dbdfdd;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import { CommunityLink, ICommunityLinkProps } from 'ts/components/docs/community_link';
|
import { CommunityLinks, ICommunityLinkProps } from 'ts/components/docs/community_links';
|
||||||
import { GetStartedLink, IGetStartedLinkProps } from 'ts/components/docs/get_started_link';
|
import { GetStartedLink, IGetStartedLinkProps } from 'ts/components/docs/get_started_link';
|
||||||
import { IShortcutLinkProps, ShortcutLink } from 'ts/components/docs/shortcut_link';
|
import { IShortcutLinkProps, ShortcutLink } from 'ts/components/docs/shortcut_link';
|
||||||
import { IStepLinkProps, StepLinks } from 'ts/components/docs/step_links';
|
import { IStepLinkProps, StepLinks } from 'ts/components/docs/step_links';
|
||||||
@@ -37,11 +37,7 @@ export const DocsHome: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</GetStartedWrapper>
|
</GetStartedWrapper>
|
||||||
<Separator margin={SEPARATOR_MARGIN} />
|
<Separator margin={SEPARATOR_MARGIN} />
|
||||||
<CommunityWrapper>
|
<CommunityLinks links={communityLinks} />
|
||||||
{communityShortcuts.map((shortcut, index) => (
|
|
||||||
<CommunityLink key={`communityLink-${index}`} {...shortcut} />
|
|
||||||
))}
|
|
||||||
</CommunityWrapper>
|
|
||||||
</DocsPageLayout>
|
</DocsPageLayout>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -68,17 +64,6 @@ const GetStartedWrapper = styled.div`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const CommunityWrapper = styled.div`
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
grid-column-gap: 30px;
|
|
||||||
grid-row-gap: 30px;
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const shortcuts: IShortcutLinkProps[] = [
|
const shortcuts: IShortcutLinkProps[] = [
|
||||||
{
|
{
|
||||||
heading: 'Core Concepts',
|
heading: 'Core Concepts',
|
||||||
@@ -148,7 +133,7 @@ const getStartedLinks: IGetStartedLinkProps[] = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const communityShortcuts: ICommunityLinkProps[] = [
|
const communityLinks: ICommunityLinkProps[] = [
|
||||||
{
|
{
|
||||||
heading: 'Discord',
|
heading: 'Discord',
|
||||||
description: 'Chat with the 0x community',
|
description: 'Chat with the 0x community',
|
||||||
|
|||||||
Reference in New Issue
Block a user