Skip to content

Commit a44a8b6

Browse files
authored
Merge pull request #2415 from oasisprotocol/kaja/footer-socials
Update footer and Socials section
2 parents 152565c + ffcd90a commit a44a8b6

21 files changed

Lines changed: 191 additions & 158 deletions

File tree

.changelog/2415.trivial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update footer and Socials section
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Loading
File renamed without changes.
Lines changed: 5 additions & 0 deletions
Loading

src/app/components/Social/images/twitter.svg renamed to src/app/components/DiscoverMore/images/twitter_black.svg

Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { FC } from 'react'
2+
import { useTranslation } from 'react-i18next'
3+
import { Link } from '@oasisprotocol/ui-library/src/components/link'
4+
import { roflApp, roseApp } from '../../utils/externalLinks'
5+
import { Button } from '@oasisprotocol/ui-library/src/components/button'
6+
import { ArrowUpRight } from 'lucide-react'
7+
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
8+
9+
export const DiscoverMore: FC = () => {
10+
const { t } = useTranslation()
11+
12+
return (
13+
<div className="w-full relative rounded-md flex flex-col lg:flex-row gap-4 md:gap-6 justify-between items-center">
14+
<div className="w-full flex flex-row self-stretch p-8 border bg-card rounded-md">
15+
<div className="flex flex-col items-start gap-2 lg:max-w-[480px]">
16+
<Typography className="font-semibold">{t('social.roflApp')}</Typography>
17+
<div className="text-foreground text-xl md:text-2xl font-medium leading-6 md:leading-8">
18+
{t('social.offchainPerformanceonchainTrust')}
19+
</div>
20+
<div className="justify-start text-muted-foreground text-sm font-normal leading-5 mb-3">
21+
{t('social.description')}
22+
</div>
23+
<Button color="secondary" variant="outline" asChild>
24+
<Link textColor="primary" href={roflApp.homepage} target="_blank" rel="noopener noreferrer">
25+
{t('social.discoverRoflApp')}
26+
<ArrowUpRight />
27+
</Link>
28+
</Button>
29+
</div>
30+
</div>
31+
<div className="w-full flex flex-row self-stretch p-8 border bg-card rounded-md">
32+
<div className="flex flex-col items-start gap-2 lg:max-w-[480px]">
33+
<Typography className="font-semibold">{t('social.roseApp')}</Typography>
34+
<div className="text-foreground text-xl md:text-2xl font-medium leading-6 md:leading-8">
35+
{t('social.roseAppTitle')}
36+
</div>
37+
<div className="justify-start text-muted-foreground text-sm font-normal leading-5 mb-3">
38+
{t('social.roseAppDescription')}
39+
</div>
40+
<Button color="secondary" variant="outline" asChild>
41+
<Link textColor="primary" href={roseApp.homepage} target="_blank" rel="noopener noreferrer">
42+
{t('social.visitRoseApp')}
43+
<ArrowUpRight />
44+
</Link>
45+
</Button>
46+
</div>
47+
</div>
48+
</div>
49+
)
50+
}

src/app/components/PageLayout/Footer.tsx

Lines changed: 87 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,45 @@ import { ReopenAnalyticsConsentButton } from 'app/components/AnalyticsConsent'
99
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
1010
import { Link } from '@oasisprotocol/ui-library/src/components/link'
1111
import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
12+
import { socialMedia } from '../../utils/externalLinks'
13+
import telegram from '../DiscoverMore/images/telegram_black.svg'
14+
import twitter from '../DiscoverMore/images/twitter_black.svg'
15+
import discord from '../DiscoverMore/images/discord_black.svg'
16+
import youtube from '../DiscoverMore/images/youtube_black.svg'
17+
import reddit from '../DiscoverMore/images/reddit_black.svg'
18+
import linkedin from '../DiscoverMore/images/linkedin_black.svg'
19+
import { NotebookText, Home } from 'lucide-react'
1220

1321
interface FooterProps {
1422
scope?: SearchScope
1523
mobileSearchAction?: ReactNode
1624
enableMobileSearch?: boolean
1725
}
1826

27+
type SocialLinkProps = {
28+
label: string
29+
href: string
30+
imgSrc?: string
31+
img?: ReactNode
32+
}
33+
34+
const SocialLinkFooter: FC<SocialLinkProps> = ({ label, href, imgSrc }) => {
35+
return (
36+
<Link href={href} rel="noopener noreferrer" target="_blank">
37+
{imgSrc && <img src={imgSrc} alt={label} className="h-5 inline-block" />}
38+
</Link>
39+
)
40+
}
41+
1942
export const Footer: FC<FooterProps> = ({ scope, mobileSearchAction, enableMobileSearch = true }) => {
2043
const { t } = useTranslation()
2144
const { isMobile, isTablet } = useScreenSize()
2245
const currentYear = useConstant(() => new Date().getFullYear())
2346
const hasMobileAction = isMobile && mobileSearchAction
2447

2548
return (
26-
<footer>
27-
<div
28-
className={cn('flex justify-between items-center py-6 sm:px-6', enableMobileSearch ? 'px-2' : 'px-4')}
29-
>
49+
<footer className="flex flex-col py-4 md:pb-4 md:pt-6">
50+
<div className={cn('flex justify-between items-center sm:px-0', enableMobileSearch ? 'px-2' : 'px-4')}>
3051
{isTablet ? (
3152
<AppendMobileSearch
3253
scope={scope}
@@ -44,7 +65,7 @@ export const Footer: FC<FooterProps> = ({ scope, mobileSearchAction, enableMobil
4465
</AppendMobileSearch>
4566
) : (
4667
<>
47-
<div className="flex items-center">
68+
<div className="flex flex-1 flex-wrap items-center">
4869
{import.meta.env.REACT_APP_BUILD_SHA && (
4970
<Typography variant="xsmall" textColor="muted">
5071
<Trans
@@ -107,9 +128,67 @@ export const Footer: FC<FooterProps> = ({ scope, mobileSearchAction, enableMobil
107128
</Typography>
108129
</div>
109130
</div>
110-
<Typography variant="xsmall" textColor="muted">
111-
{t('footer.title')} | <ReopenAnalyticsConsentButton /> | {currentYear}
112-
</Typography>
131+
<div className="flex items-center gap-6 ">
132+
<Typography variant="xsmall" textColor="muted">
133+
{t('footer.title')} | <ReopenAnalyticsConsentButton /> | {currentYear}
134+
</Typography>
135+
<div>
136+
<div className="h-5 flex items-center gap-4 justify-between">
137+
{socialMedia.telegram && (
138+
<SocialLinkFooter
139+
label={t('social.telegram')}
140+
href={socialMedia.telegram}
141+
imgSrc={telegram}
142+
/>
143+
)}
144+
{socialMedia.twitter && (
145+
<SocialLinkFooter
146+
label={t('social.twitter')}
147+
href={socialMedia.twitter}
148+
imgSrc={twitter}
149+
/>
150+
)}
151+
{socialMedia.discord && (
152+
<SocialLinkFooter
153+
label={t('social.discord')}
154+
href={socialMedia.discord}
155+
imgSrc={discord}
156+
/>
157+
)}
158+
{socialMedia.youtube && (
159+
<SocialLinkFooter
160+
label={t('social.youtube')}
161+
href={socialMedia.youtube}
162+
imgSrc={youtube}
163+
/>
164+
)}
165+
{socialMedia.reddit && (
166+
<SocialLinkFooter label={t('social.reddit')} href={socialMedia.reddit} imgSrc={reddit} />
167+
)}
168+
{socialMedia.linkedin && (
169+
<SocialLinkFooter
170+
label={t('social.linkedin')}
171+
href={socialMedia.linkedin}
172+
imgSrc={linkedin}
173+
/>
174+
)}
175+
{socialMedia.docs && (
176+
<SocialLinkFooter
177+
label={t('social.docs')}
178+
href={socialMedia.docs}
179+
img={<NotebookText className="size-5 text-foreground" />}
180+
/>
181+
)}
182+
{socialMedia.home && (
183+
<SocialLinkFooter
184+
label={t('social.home')}
185+
href={socialMedia.home}
186+
img={<Home className="size-5 text-foreground" />}
187+
/>
188+
)}
189+
</div>
190+
</div>
191+
</div>
113192
</>
114193
)}
115194
</div>

0 commit comments

Comments
 (0)