Skip to content

Commit e004c3e

Browse files
authored
Merge pull request #2313 from oasisprotocol/mz/social
Align Social component with new designs
2 parents 483c691 + a9f361e commit e004c3e

File tree

7 files changed

+52
-27
lines changed

7 files changed

+52
-27
lines changed

.changelog/2313.trivial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Align Social component with new designs
-13.5 KB
Binary file not shown.
8.22 KB
Loading

src/app/components/Social/index.tsx

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ import { FC, ReactNode } from 'react'
22
import { useTranslation } from 'react-i18next'
33
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
44
import { Link } from '@oasisprotocol/ui-library/src/components/link'
5-
import backgroundSocial from './images/background-social.png'
65
import telegram from './images/telegram.svg'
76
import twitter from './images/twitter.svg'
87
import discord from './images/discord.svg'
98
import youtube from './images/youtube.svg'
109
import reddit from './images/reddit.svg'
1110
import linkedin from './images/linkedin.svg'
1211
import { NotebookText, Home } from 'lucide-react'
13-
import { socialMedia } from '../../utils/externalLinks'
12+
import { roflApp, socialMedia } from '../../utils/externalLinks'
13+
import { Button } from '@oasisprotocol/ui-library/src/components/ui/button'
14+
import RoflAppsImg from './images/rofl-apps.webp'
1415

1516
type SocialLinkProps = {
1617
label: string
@@ -21,19 +22,14 @@ type SocialLinkProps = {
2122

2223
const SocialLink: FC<SocialLinkProps> = ({ label, href, imgSrc, img }) => {
2324
return (
24-
<Link
25-
href={href}
26-
className="flex flex-col items-center text-white mx-4 mt-4 sm:mx-0 sm:mt-0"
27-
rel="noopener noreferrer"
28-
target="_blank"
29-
>
25+
<Link href={href} className="flex flex-col gap-2 items-center" rel="noopener noreferrer" target="_blank">
3026
<div className="flex justify-center mb-2">
3127
<>
32-
{imgSrc && <img src={imgSrc} alt={label} className="h-10 w-auto inline-block" />}
33-
{img && <span className="[&_svg]:h-10 [&_svg]:w-10 inline-block">{img}</span>}
28+
{imgSrc && <img src={imgSrc} alt={label} className="h-9 inline-block" />}
29+
{img && <span className="[&_svg]:h-9 [&_svg]:w-9 inline-block">{img}</span>}
3430
</>
3531
</div>
36-
<Typography className="mb-1 text-white">{label}</Typography>
32+
<Typography className="mb-1 text-white font-semibold">{label}</Typography>
3733
</Link>
3834
)
3935
}
@@ -42,20 +38,34 @@ export const Social: FC = () => {
4238
const { t } = useTranslation()
4339

4440
return (
45-
<div
46-
className="grid grid-cols-12 bg-cover rounded-md border pt-8 px-8 border-white bg-primary lg:px-16 pb-4 lg:pb-8"
47-
style={{
48-
backgroundImage: `url(${backgroundSocial})`,
49-
}}
50-
>
51-
<div className="col-span-12 mb-4 lg:col-span-4 lg:mb-0">
52-
<Typography variant="large" className="mb-1 text-white">
53-
{t('social.header')}
54-
</Typography>
55-
<Typography className="text-white w-full md:w-64">{t('social.description')}</Typography>
41+
<div className="w-full p-8 relative bg-primary rounded-md flex flex-col lg:flex-row gap-4 md:gap-8 justify-between items-center">
42+
<div className="flex flex-row self-stretch">
43+
<div className="flex flex-col items-start gap-2 lg:max-w-[340px]">
44+
<div className="text-primary-foreground text-xl md:text-2xl font-bold leading-6 md:leading-8">
45+
{t('social.offchainPerformance')} <br />
46+
{t('social.onchainTrust')}
47+
</div>
48+
<div className="justify-start text-primary-foreground text-sm font-normal leading-5 mb-2">
49+
{t('social.description')}
50+
</div>
51+
<Button color="secondary" variant="outline" asChild>
52+
<Link textColor="inherit" href={roflApp.homepage} target="_blank" rel="noopener noreferrer">
53+
{t('social.getStarted')}
54+
</Link>
55+
</Button>
56+
</div>
57+
<img alt={t('rofl.listTitle')} className="hidden xl:block -mt-8 max-h-[196px]" src={RoflAppsImg} />
5658
</div>
57-
<div className="col-span-12 lg:col-span-8">
58-
<div className="flex flex-wrap items-center w-full h-full justify-center sm:gap-4 md:justify-between">
59+
<div className="flex flex-col self-stretch gap-8 lg:min-w-[500px]">
60+
<div>
61+
<Typography className="text-white text-xl md:text-2xl font-bold leading-6 md:leading-8">
62+
{t('social.header')}
63+
</Typography>
64+
<Typography className="text-white leading-5" variant="small">
65+
{t('social.community')}
66+
</Typography>
67+
</div>
68+
<div className="flex flex-wrap items-center gap-1 sm:gap-4 justify-evenly lg:justify-around">
5969
{socialMedia.telegram && (
6070
<SocialLink label={t('social.telegram')} href={socialMedia.telegram} imgSrc={telegram} />
6171
)}
@@ -78,14 +88,14 @@ export const Social: FC = () => {
7888
<SocialLink
7989
label={t('social.docs')}
8090
href={socialMedia.docs}
81-
img={<NotebookText className="size-12 text-white" />}
91+
img={<NotebookText className="size-9 text-white" />}
8292
/>
8393
)}
8494
{socialMedia.home && (
8595
<SocialLink
8696
label={t('social.home')}
8797
href={socialMedia.home}
88-
img={<Home className="size-12 text-white" />}
98+
img={<Home className="size-9 text-white" />}
8999
/>
90100
)}
91101
</div>

src/app/utils/externalLinks.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,7 @@ export const ipfs = {
8989
export const wallet = {
9090
homepage: 'https://wallet.oasis.io/',
9191
}
92+
93+
export const roflApp = {
94+
homepage: 'https://rofl.app/',
95+
}

src/locales/en/translation.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,11 @@
375375
"last": "Last"
376376
},
377377
"social": {
378-
"description": "Be part of the community and stay in the loop on everything Oasis",
378+
"offchainPerformance": "Offchain Performance.",
379+
"onchainTrust": "Onchain Trust.",
380+
"getStarted": "Get started with ROFL",
381+
"description": "Build trustless apps with ROFL. Start quickly with templates. Manage everything from one interface.",
382+
"community": "Be part of the community and stay in the loop on everything Oasis",
379383
"discord": "Discord",
380384
"header": "Join us",
381385
"reddit": "Reddit",

src/types/images.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ declare module '*.svg' {
1010
export default url
1111
}
1212

13+
declare module '*.webp' {
14+
/** Image URL */
15+
const url: string
16+
export default url
17+
}
18+
1319
declare module 'bundle-text:*.svg' {
1420
/** Image content */
1521
const content: string

0 commit comments

Comments
 (0)