fix theme issue, and move default amount of builds to show to a constant

This commit is contained in:
Corwin Smith 2022-10-09 09:07:01 -06:00
parent b6fc69ab5c
commit 524d187a40
2 changed files with 8 additions and 4 deletions

View file

@ -9,3 +9,6 @@ export const ETHEREUM_ORG_URL = 'https://ethereum.org';
export const ETHEREUM_ORG_RUN_A_NODE_URL = 'https://ethereum.org/en/run-a-node/'; export const ETHEREUM_ORG_RUN_A_NODE_URL = 'https://ethereum.org/en/run-a-node/';
export const ETHEREUM_FOUNDATION_URL = 'https://ethereum.foundation'; export const ETHEREUM_FOUNDATION_URL = 'https://ethereum.foundation';
export const GETH_REPO_URL = 'https://github.com/ethereum/go-ethereum'; export const GETH_REPO_URL = 'https://github.com/ethereum/go-ethereum';
// Downloads
export const DEFAULT_BUILD_AMOUNT_TO_SHOW = 10;

View file

@ -17,6 +17,7 @@ import {
import { DataTable } from '../components/UI/DataTable'; import { DataTable } from '../components/UI/DataTable';
import { import {
DEFAULT_BUILD_AMOUNT_TO_SHOW,
GETH_REPO_URL GETH_REPO_URL
} from '../constants' } from '../constants'
@ -25,8 +26,8 @@ import { pgpBuildTestData } from '../data/test/pgpbuild-testdata';
import { pgpDeveloperTestData } from '../data/test/pgpdeveloper-testdata'; import { pgpDeveloperTestData } from '../data/test/pgpdeveloper-testdata';
const DownloadsPage: NextPage = ({}) => { const DownloadsPage: NextPage = ({}) => {
const [amountStableReleases, updateAmountStables] = useState(10) const [amountStableReleases, updateAmountStables] = useState(DEFAULT_BUILD_AMOUNT_TO_SHOW)
const [amountDevelopBuilds, updateAmountDevelopBuilds] = useState(10) const [amountDevelopBuilds, updateAmountDevelopBuilds] = useState(DEFAULT_BUILD_AMOUNT_TO_SHOW)
return ( return (
<> <>
@ -105,7 +106,7 @@ const DownloadsPage: NextPage = ({}) => {
<DownloadsTable data={testDownloadData.slice(0, amountStableReleases)}/> <DownloadsTable data={testDownloadData.slice(0, amountStableReleases)}/>
<Stack sx={{ mt: '0 !important' }}> <Stack sx={{ mt: '0 !important' }}>
<Link as='button' variant='secondary' onClick={() => { <Link as='button' variant='button-link-secondary' onClick={() => {
updateAmountStables(amountStableReleases+10) updateAmountStables(amountStableReleases+10)
}}> }}>
<Text <Text
@ -140,7 +141,7 @@ const DownloadsPage: NextPage = ({}) => {
<DownloadsTable data={testDownloadData.slice(0, amountDevelopBuilds)} /> <DownloadsTable data={testDownloadData.slice(0, amountDevelopBuilds)} />
<Stack sx={{ mt: '0 !important' }}> <Stack sx={{ mt: '0 !important' }}>
<Link as='button' variant='secondary' onClick={() => { <Link as='button' variant='button-link-secondary' onClick={() => {
updateAmountDevelopBuilds(amountDevelopBuilds+10) updateAmountDevelopBuilds(amountDevelopBuilds+10)
}}> }}>
<Text <Text