-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds community section to tangle-website (#1102)
Co-authored-by: Dustin Brickwood <[email protected]>
- Loading branch information
1 parent
f9617e3
commit 597feb8
Showing
10 changed files
with
213 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
apps/tangle-website/src/components/sections/CommunitySection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import { | ||
Common2Icon, | ||
DiscordFill, | ||
DocumentationIcon, | ||
GithubFill, | ||
TelegramFill, | ||
TwitterFill, | ||
} from '@webb-tools/icons'; | ||
import { IconBase } from '@webb-tools/icons/types'; | ||
import { | ||
Button, | ||
Typography, | ||
WebsiteCommunity, | ||
} from '@webb-tools/webb-ui-components'; | ||
import { NextSeo } from 'next-seo'; | ||
import { SectionDescription } from '../SectionDescription'; | ||
|
||
type LinksType = { | ||
Icon: (props: IconBase) => JSX.Element; | ||
name: string; | ||
href: string; | ||
description: string; | ||
}; | ||
|
||
const links: Array<LinksType> = [ | ||
{ | ||
name: 'Github', | ||
Icon: GithubFill, | ||
href: 'https://github.com/webb-tools', | ||
description: 'Explore the source code and get involved', | ||
}, | ||
{ | ||
name: 'Documentation', | ||
Icon: DocumentationIcon, | ||
href: 'https://docs.webb.tools/docs', | ||
description: 'Learn how it works under the hood', | ||
}, | ||
{ | ||
name: 'Discord', | ||
Icon: DiscordFill, | ||
href: 'https://discord.com/invite/cv8EfJu3Tn', | ||
description: 'Come chat about all things Webb', | ||
}, | ||
{ | ||
name: 'Telegram', | ||
Icon: TelegramFill, | ||
href: 'https://t.me/webbprotocol', | ||
description: 'Have question, join us on Telegram', | ||
}, | ||
{ | ||
Icon: Common2Icon, | ||
name: 'Commonwealth', | ||
href: 'https://commonwealth.im/webb', | ||
description: 'Join the conversation on Commonwealth', | ||
}, | ||
{ | ||
name: 'Twitter', | ||
Icon: TwitterFill, | ||
href: 'https://twitter.com/webbprotocol', | ||
description: 'Say hi on the Webb Twitter', | ||
}, | ||
]; | ||
|
||
export const CommunitySection = () => { | ||
return ( | ||
<> | ||
<NextSeo title="Community" /> | ||
|
||
<section | ||
className="py-[60px] w-full flex items-center justify-center" | ||
id="community" | ||
> | ||
<div className="max-w-[900px]"> | ||
<Typography | ||
variant="label" | ||
className="text-center text-purple-70 uppercase block" | ||
> | ||
Get involved | ||
</Typography> | ||
|
||
<Typography variant="mkt-h2" className="text-center mt-1"> | ||
Tangle Community | ||
</Typography> | ||
|
||
<SectionDescription className="text-center mt-[16px] px-3 lg:px-0"> | ||
The Tangle network doubles as hub for routing cross chain messages | ||
and for anchoring itself as a bridge endpoint for cross chain | ||
zero-knowledge applications. | ||
</SectionDescription> | ||
|
||
<WebsiteCommunity links={links} /> | ||
</div> | ||
</section> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
libs/webb-ui-components/src/components/WebsiteCommunity/WebsiteCommunity.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { Typography } from '../../typography'; | ||
import { useMemo } from 'react'; | ||
import { twMerge } from 'tailwind-merge'; | ||
import { Button } from '../Button'; | ||
import { WebsiteCommunityProps } from './types'; | ||
|
||
/** | ||
* The `WebsiteCommunity` component | ||
* Sets up styles, and spacing vertically between `block` components | ||
* @example | ||
* ```jsx | ||
* <WebsiteCommunity | ||
* links={[ | ||
* { | ||
name: 'Github', | ||
Icon: GithubFill, | ||
href: 'https://github.com/webb-tools', | ||
description: 'Explore the source code and get involved', | ||
}, | ||
{ | ||
name: 'Documentation', | ||
Icon: DocumentationIcon, | ||
href: 'https://docs.webb.tools/docs', | ||
description: 'Learn how it works under the hood', | ||
}, | ||
{ | ||
name: 'Telegram', | ||
Icon: TelegramFill, | ||
href: 'https://t.me/webbprotocol', | ||
description: 'Have question, join us on Telegram', | ||
}, | ||
* ]} | ||
* /> | ||
* ``` | ||
* @param links - array of links of type `LinksType` | ||
* @param cardContainerClassName - className for the container of the cards | ||
* @param cardClassName - className for the card | ||
*/ | ||
export const WebsiteCommunity = ({ | ||
links, | ||
cardContainerClassName, | ||
cardClassName, | ||
}: WebsiteCommunityProps) => { | ||
const cardContainerClsx = useMemo( | ||
() => | ||
twMerge( | ||
'mt-[24px] grid gap-4 justify-center md:grid-cols-2 px-4', | ||
cardContainerClassName | ||
), | ||
[cardContainerClassName] | ||
); | ||
|
||
const cardClsx = useMemo( | ||
() => | ||
twMerge( | ||
'flex flex-col p-4 min-w-[358px] bg-mono-0 rounded-lg space-y-2 shadow-[0_4px_4px_0_rgba(0,0,0,0.25)]', | ||
cardClassName | ||
), | ||
[cardClassName] | ||
); | ||
|
||
return ( | ||
<div className={cardContainerClsx}> | ||
{links.map(({ Icon, name, href, description }) => ( | ||
<div className={cardClsx} key={href}> | ||
<span className="flex items-center space-x-2.5"> | ||
<Icon className="w-8 h-8 !fill-current" /> | ||
<Typography variant="h5" className="text-mono-200" fw="bold"> | ||
{name} | ||
</Typography> | ||
</span> | ||
|
||
<Typography variant="body1" className="text-mono-140"> | ||
{description} | ||
</Typography> | ||
|
||
<Button variant="link" href={href} target="_blank"> | ||
{name} | ||
</Button> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
libs/webb-ui-components/src/components/WebsiteCommunity/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './WebsiteCommunity'; |
14 changes: 14 additions & 0 deletions
14
libs/webb-ui-components/src/components/WebsiteCommunity/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { IconBase } from '@webb-tools/icons/types'; | ||
|
||
type LinksType = { | ||
Icon: (props: IconBase) => JSX.Element; | ||
name: string; | ||
href: string; | ||
description: string; | ||
}; | ||
|
||
export type WebsiteCommunityProps = { | ||
links: LinksType[]; | ||
cardContainerClassName?: string; | ||
cardClassName?: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters