Skip to content

Commit

Permalink
Update currency units to use SDA instead of ETH
Browse files Browse the repository at this point in the history
  • Loading branch information
noumanmhd committed Aug 25, 2024
1 parent af7613c commit 33831d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 83 deletions.
2 changes: 1 addition & 1 deletion lib/units.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ const weiName = config.chain.currency.weiName || 'wei';
export const currencyUnits: Record<Unit, string> = {
wei: weiName,
gwei: `G${ weiName }`,
ether: config.chain.currency.symbol || 'ETH',
ether: config.chain.currency.symbol || 'SDA',
};
6 changes: 3 additions & 3 deletions stubs/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ export const STATS_CHARTS_SECTION: stats.LineChartSection = {
{
id: 'chart_0',
title: 'Average transaction fee',
description: 'The average amount in ETH spent per transaction',
units: 'ETH',
description: 'The average amount in SDA spent per transaction',
units: 'SDA',
},
{
id: 'chart_1',
title: 'Transactions fees',
description: 'Amount of tokens paid as fees',
units: 'ETH',
units: 'SDA',
},
{
id: 'chart_2',
Expand Down
81 changes: 2 additions & 79 deletions ui/snippets/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,90 +7,28 @@ import type { CustomLinksGroup } from 'types/footerLinks';

import config from 'configs/app';
import type { ResourceError } from 'lib/api/resources';
import useApiQuery from 'lib/api/useApiQuery';
import useFetch from 'lib/hooks/useFetch';
import useIssueUrl from 'lib/hooks/useIssueUrl';
import { copy } from 'lib/html-entities';
import IconSvg from 'ui/shared/IconSvg';
import NetworkAddToWallet from 'ui/shared/NetworkAddToWallet';

import FooterLinkItem from './FooterLinkItem';
import IntTxsIndexingStatus from './IntTxsIndexingStatus';
import getApiVersionUrl from './utils/getApiVersionUrl';

const MAX_LINKS_COLUMNS = 4;

const FRONT_VERSION_URL = `https://github.com/blockscout/frontend/tree/${ config.UI.footer.frontendVersion }`;
const FRONT_COMMIT_URL = `https://github.com/blockscout/frontend/commit/${ config.UI.footer.frontendCommit }`;

const Footer = () => {

const { data: backendVersionData } = useApiQuery('config_backend_version', {
queryOptions: {
staleTime: Infinity,
},
});
const apiVersionUrl = getApiVersionUrl(backendVersionData?.backend_version);
const issueUrl = useIssueUrl(backendVersionData?.backend_version);
const logoColor = useColorModeValue('blue.600', 'white');

const BLOCKSCOUT_LINKS = [
{
icon: 'edit' as const,
iconSize: '16px',
text: 'Submit an issue',
url: issueUrl,
},
{
icon: 'social/canny' as const,
iconSize: '20px',
text: 'Feature request',
url: 'https://blockscout.canny.io/feature-requests',
},
{
icon: 'social/git' as const,
iconSize: '18px',
text: 'Contribute',
url: 'https://github.com/blockscout/blockscout',
},
{
icon: 'social/twitter' as const,
iconSize: '18px',
text: 'X (ex-Twitter)',
url: 'https://www.twitter.com/blockscoutcom',
},
{
icon: 'social/discord' as const,
iconSize: '24px',
text: 'Discord',
url: 'https://discord.gg/blockscout',
},
{
icon: 'brands/blockscout' as const,
iconSize: '18px',
text: 'All chains',
url: 'https://www.blockscout.com/chains-and-projects',
},
{
icon: 'donate' as const,
iconSize: '20px',
text: 'Donate',
url: 'https://github.com/sponsors/blockscout',
url: 'https://github.com/SidraChain/blockscout-frontend',
},
];

const frontendLink = (() => {
if (config.UI.footer.frontendVersion) {
return <Link href={ FRONT_VERSION_URL } target="_blank">{ config.UI.footer.frontendVersion }</Link>;
}

if (config.UI.footer.frontendCommit) {
return <Link href={ FRONT_COMMIT_URL } target="_blank">{ config.UI.footer.frontendCommit }</Link>;
}

return null;
})();

const fetch = useFetch();

const { isPlaceholderData, data: linksData } = useQuery<unknown, ResourceError<unknown>, Array<CustomLinksGroup>>({
Expand Down Expand Up @@ -135,24 +73,9 @@ const Footer = () => {
<Text mt={ 3 } fontSize="xs">
Blockscout is a tool for inspecting and analyzing EVM based blockchains. Blockchain explorer for Ethereum Networks.
</Text>
<Box mt={ 6 } alignItems="start" fontSize="xs" lineHeight={ 5 }>
{ apiVersionUrl && (
<Text>
Backend: <Link href={ apiVersionUrl } target="_blank">{ backendVersionData?.backend_version }</Link>
</Text>
) }
{ frontendLink && (
<Text>
Frontend: { frontendLink }
</Text>
) }
<Text>
Copyright { copy } Blockscout Limited 2023-{ (new Date()).getFullYear() }
</Text>
</Box>
</Box>
);
}, [ apiVersionUrl, backendVersionData?.backend_version, frontendLink, logoColor ]);
}, [ logoColor ]);

const containerProps: GridProps = {
as: 'footer',
Expand Down

3 comments on commit 33831d1

@doelqodir
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mohon pencerahannya tentang harga SDA segera tuanku

@Ahmadfabien
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1ETH=1SDA Icha'Allah

@yangjinneng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是1EHT=1SDA呢?

Please sign in to comment.