Skip to content

Commit 48346a2

Browse files
committed
Style search container
1 parent ceadfe1 commit 48346a2

File tree

5 files changed

+37
-9
lines changed

5 files changed

+37
-9
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { FC } from 'react'
2+
import { Search } from '../../components/Search'
3+
import { useTranslation } from 'react-i18next'
4+
import { useSearchQueryNetworkParam } from '../../hooks/useSearchQueryNetworkParam'
5+
import { useIsApiReachable } from '../../components/OfflineBanner/hook'
6+
7+
import SearchBg from './images/search-bg.png'
8+
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
9+
10+
export const HomeSearch: FC = () => {
11+
const { t } = useTranslation()
12+
const { network } = useSearchQueryNetworkParam()
13+
const isApiReachable = useIsApiReachable(network).reachable
14+
15+
return (
16+
<div
17+
id="search"
18+
style={{ backgroundImage: `url(${SearchBg})` }}
19+
className="py-12 px-8 md:p-24 bg-[#DFDEF5] bg-cover bg-center bg-no-repeat rounded-md"
20+
>
21+
<Typography
22+
variant="h2"
23+
className="text-center justify-start text-foreground text-2xl md:text-3xl font-semibold leading-8 mb-4 md:mb-8"
24+
>
25+
{t('home.search')}
26+
</Typography>
27+
28+
<Search disabled={!isApiReachable} />
29+
</div>
30+
)
31+
}

src/app/pages/HomePage/RoflAppsCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const RoflAppsCard: FC = () => {
77
const { t } = useTranslation()
88

99
return (
10-
<Card variant="layout">
10+
<Card variant="layout" className="md:mb-0">
1111
<CardHeader>
1212
<CardTitle>{t('rofl.listTitle')}</CardTitle>
1313
</CardHeader>
139 KB
Loading

src/app/pages/HomePage/index.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
import { FC } from 'react'
2-
import { Search } from '../../components/Search'
32
import { Footer } from '../../components/PageLayout/Footer'
4-
import { useTranslation } from 'react-i18next'
53
import { BuildBanner } from '../../components/BuildBanner'
64
import { useSearchQueryNetworkParam } from '../../hooks/useSearchQueryNetworkParam'
75
import { NetworkOfflineBanner } from '../../components/OfflineBanner'
8-
import { useIsApiReachable } from '../../components/OfflineBanner/hook'
96
import { RoflAppsCard } from './RoflAppsCard'
107
import { FooterBanner } from './FooterBanner'
8+
import { HomeSearch } from './HomeSearch'
119

1210
export const HomePage: FC = () => {
13-
const { t } = useTranslation()
1411
const { network } = useSearchQueryNetworkParam()
15-
const isApiReachable = useIsApiReachable(network).reachable
1612

1713
return (
1814
<>
1915
<BuildBanner />
2016
<NetworkOfflineBanner wantedNetwork={network} />
21-
<div className="px-6">
22-
<Search disabled={!isApiReachable} />
17+
<div className="flex flex-col px-6 gap-6">
18+
<HomeSearch />
2319
<RoflAppsCard />
2420
<FooterBanner />
2521
</div>

src/locales/en/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,8 @@
675675
"onchainTrust": "Onchain Trust.",
676676
"getStarted": "Get started with ROFL",
677677
"description": "Build trustless apps with ROFL. Start quickly with templates. Manage everything from one interface."
678-
}
678+
},
679+
"search": "Search across all our networks"
679680
},
680681
"paratimes": {
681682
"activeNodes": "{{nodes}} active",

0 commit comments

Comments
 (0)