-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ETH - SEO Tweaks for Gas Tracker Page
- Loading branch information
Showing
10 changed files
with
107 additions
and
4 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { | ||
Box, | ||
Heading, | ||
Accordion, | ||
} from '@chakra-ui/react'; | ||
import React from 'react'; | ||
|
||
import config from 'configs/app'; | ||
import { currencyUnits } from 'lib/units'; | ||
|
||
import GasTrackerFaqItem from './GasTrackerFaqItem'; | ||
|
||
const FAQ_ITEMS = [ | ||
{ | ||
question: 'What does gas refer to on the blockchain?', | ||
answer: 'Gas is the amount of native tokens required to perform a transaction on the blockchain.', | ||
}, | ||
{ | ||
question: `How can I check ${ config.chain.name } gas fees?`, | ||
// eslint-disable-next-line max-len | ||
answer: `You can easily check live ${ config.chain.name } gas fees on Blockscout by visiting our gas tracker. It displays current gas fees in ${ currencyUnits.gwei } for all ${ config.chain.name } transactions.`, | ||
}, | ||
{ | ||
question: `What is the average gas fee for ${ config.chain.name } transactions?`, | ||
// eslint-disable-next-line max-len | ||
answer: `The average gas fee for ${ config.chain.name } transactions depends on network congestion and transaction complexity. Blockscout provides real-time gas fee estimations to help users make informed decisions.`, | ||
}, | ||
{ | ||
question: 'How does Blockscout calculate gas fees?', | ||
answer: 'Blockscout calculates gas fees based on the average price of gas fees spent for the last 200 blocks.', | ||
}, | ||
]; | ||
|
||
const GasTrackerFaq = () => { | ||
return ( | ||
<Box mt={ 12 }> | ||
<Heading as="h2" mb={ 4 } fontSize="2xl" fontWeight="medium">FAQ</Heading> | ||
<Accordion> | ||
{ FAQ_ITEMS.map((item, index) => ( | ||
<GasTrackerFaqItem key={ index } question={ item.question } answer={ item.answer }/> | ||
)) } | ||
</Accordion> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default GasTrackerFaq; |
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,39 @@ | ||
import { | ||
AccordionItem, | ||
AccordionButton, | ||
AccordionPanel, | ||
AccordionIcon, | ||
Text, | ||
chakra, | ||
useColorModeValue, | ||
} from '@chakra-ui/react'; | ||
|
||
interface Props { | ||
question: string; | ||
answer: string; | ||
} | ||
|
||
const GasTrackerFaqItem = ({ question, answer }: Props) => { | ||
const hoverColor = useColorModeValue('blackAlpha.50', 'whiteAlpha.50'); | ||
const borderColor = useColorModeValue('blackAlpha.100', 'whiteAlpha.200'); | ||
return ( | ||
<AccordionItem as="section" _first={{ borderTopWidth: 0 }} _last={{ borderBottomWidth: 0 }} borderColor={ borderColor }> | ||
{ ({ isExpanded }) => ( | ||
<> | ||
<AccordionButton | ||
_hover={{ bgColor: hoverColor }} | ||
px={ 0 } | ||
> | ||
<chakra.h3 flex="1" textAlign="left" fontSize="lg" fontWeight={ 500 }>{ question }</chakra.h3> | ||
<AccordionIcon transform={ isExpanded ? 'rotate(0deg)' : 'rotate(-90deg)' } color="gray.500"/> | ||
</AccordionButton> | ||
<AccordionPanel pb={ 4 } px={ 0 }> | ||
<Text color="text_secondary">{ answer }</Text> | ||
</AccordionPanel> | ||
</> | ||
) } | ||
</AccordionItem> | ||
); | ||
}; | ||
|
||
export default GasTrackerFaqItem; |
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
Binary file modified
BIN
+22.8 KB
(130%)
...creenshots__/GasTracker.pw.tsx_dark-color-mode_base-view-dark-mode-mobile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+24 KB
(130%)
...ages/__screenshots__/GasTracker.pw.tsx_default_base-view-dark-mode-mobile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+42.2 KB
(140%)
ui/pages/__screenshots__/GasTracker.pw.tsx_mobile_base-view-dark-mode-mobile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.