Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App meta tags #657

Merged
merged 10 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"react-device-detect": "^1.13.1",
"react-dom": "^18.3.1",
"react-feather": "^2.0.9",
"react-helmet-async": "^1.0.7",
"react-helmet-async": "^2.0.5",
"react-i18next": "^11.7.2",
"react-loading-skeleton": "^3.4.0",
"react-number-format": "^5.2.2",
Expand Down
1 change: 1 addition & 0 deletions src/GlobalStyle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const GlobalStyle = createGlobalStyle`

body {
background-image: url('/squares1x.webp'), url('/wavy-blue.webp');
background-color: #E2F1FF;
background-size: contain, 100%;
background-position: bottom left, top right;
background-repeat: no-repeat;
Expand Down
19 changes: 19 additions & 0 deletions src/components/MetaTags.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Helmet } from 'react-helmet-async'
import { MetaInfo } from '~/utils/metaInfo'

interface MetaTagsProps {
page: MetaInfo
}

const MetaTags: React.FC<MetaTagsProps> = ({ page }) => {
const { title, description, keywords } = page
return (
<Helmet>
<title>{title}</title>
<meta name="description" content={description} />
<meta name="keywords" content={keywords} />
</Helmet>
)
}

export default MetaTags
167 changes: 88 additions & 79 deletions src/containers/Analytics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import useGeb from '~/hooks/useGeb'
import { BigNumber, ethers } from 'ethers'
import useAnalyticsData from '~/hooks/useAnalyticsData'
import usePoolData from '~/hooks/usePoolData'
import MetaTags from '~/components/MetaTags'
import metaInfo from '~/utils/metaInfo'

interface AnalyticsStateProps {
erc20Supply: string
Expand Down Expand Up @@ -348,94 +350,101 @@ const Analytics = () => {
}, [geb, chainId, analyticsData, poolData])

return (
<Container>
<Section>
<Title>Stats</Title>
<AnaliticsTop>
{analiticsData &&
analiticsData?.map((val, index) => (
<>
<MetaTags page={metaInfo.stats} />
<Container>
<Section>
<Title>Stats</Title>
<AnaliticsTop>
{analiticsData &&
analiticsData?.map((val, index) => (
<DataCard
key={val.title + index}
image={val.image}
title={val.title}
value={val.value}
description={val.description}
/>
))}
</AnaliticsTop>
<AnaliticsMiddle>
{systemInfoData && (
<RightColumn>
<SubTitle>System Info</SubTitle>
<FlexMultipleRow>
{systemInfoData.slice(0, 2).map((val, index) => {
return (
<DataCard
key={val.title + index}
title={val.title}
value={val.value}
description={val.description}
/>
)
})}
</FlexMultipleRow>
<FlexMultipleRow>
{systemInfoData.slice(2).map((val, index) => {
return (
<DataCard
key={val.title + index}
title={val.title}
value={val.value}
description={val.description}
/>
)
})}
</FlexMultipleRow>
</RightColumn>
)}
</AnaliticsMiddle>
<SubTitle>Prices</SubTitle>
<AnaliticsBottom>
{pricesData.map((val, index) => (
<DataCard
key={val.title + index}
image={val.image}
title={val.title}
value={val.value}
description={val.description}
bg={'light'}
/>
))}
</AnaliticsTop>
<AnaliticsMiddle>
{systemInfoData && (
<RightColumn>
<SubTitle>System Info</SubTitle>
<FlexMultipleRow>
{systemInfoData.slice(0, 2).map((val, index) => {
return (
<DataCard
key={val.title + index}
title={val.title}
value={val.value}
description={val.description}
/>
)
})}
</FlexMultipleRow>
<FlexMultipleRow>
{systemInfoData.slice(2).map((val, index) => {
return (
<DataCard
key={val.title + index}
title={val.title}
value={val.value}
description={val.description}
/>
)
})}
</FlexMultipleRow>
</RightColumn>
)}
</AnaliticsMiddle>
<SubTitle>Prices</SubTitle>
<AnaliticsBottom>
{pricesData.map((val, index) => (
<DataCard
key={val.title + index}
title={val.title}
value={val.value}
description={val.description}
bg={'light'}
</AnaliticsBottom>
<TooltipWrapper>
<ReactTooltip
variant="light"
data-effect="solid"
id="analitics"
style={{ maxWidth: '300px' }}
classNameArrow="tooltip-arrow"
/>
))}
</AnaliticsBottom>
<TooltipWrapper>
<ReactTooltip
variant="light"
data-effect="solid"
id="analitics"
style={{ maxWidth: '300px' }}
classNameArrow="tooltip-arrow"
/>
</TooltipWrapper>
</Section>
<Section>
<Title>Collaterals</Title>
<DataTable title={colData.title} colums={colData.colums} rows={colData.rows} />
<TooltipWrapper>
<ReactTooltip
variant="light"
data-effect="solid"
id="collaterals-table"
style={{ maxWidth: '300px' }}
classNameArrow="tooltip-arrow"
</TooltipWrapper>
</Section>
<Section>
<Title>Collaterals</Title>
<DataTable title={colData.title} colums={colData.colums} rows={colData.rows} />
<TooltipWrapper>
<ReactTooltip
variant="light"
data-effect="solid"
id="collaterals-table"
style={{ maxWidth: '300px' }}
classNameArrow="tooltip-arrow"
/>
</TooltipWrapper>
</Section>

<Section>
<Title>Contracts</Title>
{/* Contracts Table */}
<ContractsTable
title={contractsData.title}
colums={contractsData.colums}
rows={contractsData.rows}
/>
</TooltipWrapper>
</Section>

<Section>
<Title>Contracts</Title>
{/* Contracts Table */}
<ContractsTable title={contractsData.title} colums={contractsData.colums} rows={contractsData.rows} />
</Section>
</Container>
</Section>
</Container>
</>
)
}

Expand Down
Loading
Loading