From 649d22ba37310748831e1a0a8c9a67c8b7319fa9 Mon Sep 17 00:00:00 2001 From: Corwin Smith Date: Mon, 10 Oct 2022 06:56:44 -0600 Subject: [PATCH] change requests --- src/components/UI/downloads/DownloadsHero.tsx | 146 +++++----------- .../UI/downloads/DownloadsSection.tsx | 2 +- .../UI/downloads/DownloadsTable.tsx | 160 ++++-------------- src/constants.ts | 56 +++++- src/pages/downloads.tsx | 26 +-- src/theme/components/Link.ts | 16 -- 6 files changed, 148 insertions(+), 258 deletions(-) diff --git a/src/components/UI/downloads/DownloadsHero.tsx b/src/components/UI/downloads/DownloadsHero.tsx index 94dc1200f7..86c7d605e1 100644 --- a/src/components/UI/downloads/DownloadsHero.tsx +++ b/src/components/UI/downloads/DownloadsHero.tsx @@ -2,6 +2,8 @@ import { Box, Button, Image, Link, Stack, HStack, Text } from '@chakra-ui/react' import { FC } from 'react'; import NextLink from 'next/link'; +import { DOWNLOAD_HEADER_BUTTONS } from '../../../constants' + interface DownloadsHero { currentBuildName: string currentBuildVersion: string @@ -21,11 +23,16 @@ export const DownloadsHero: FC = ({ sourceCodeURL, windowsBuildURL }) => { + DOWNLOAD_HEADER_BUTTONS.linuxBuild.buildURL = linuxBuildURL + DOWNLOAD_HEADER_BUTTONS.macOSBuild.buildURL = macOSBuildURL + DOWNLOAD_HEADER_BUTTONS.windowsBuild.buildURL = windowsBuildURL + DOWNLOAD_HEADER_BUTTONS.sourceCode.buildURL = sourceCodeURL + return ( - - Gopher greeting - + + Gopher plugged in + = ({ You can download the latest 64-bit stable release of Geth for our primary platforms below. Packages for all supported platforms, as well as develop builds, can be found further down the page. If you're looking to install Geth and/or associated tools via your favorite package manager, please check our installation guide. - - - - - - - - - - - - - - - + { + Object.keys(DOWNLOAD_HEADER_BUTTONS).map((key: string, idx) => { + return ( + + + + ) + }) + } Release notes for {currentBuildName} {currentBuildVersion} diff --git a/src/components/UI/downloads/DownloadsSection.tsx b/src/components/UI/downloads/DownloadsSection.tsx index b3b647597d..5e0fdf26a2 100644 --- a/src/components/UI/downloads/DownloadsSection.tsx +++ b/src/components/UI/downloads/DownloadsSection.tsx @@ -2,7 +2,7 @@ import { Box, Image, Stack } from '@chakra-ui/react'; import { FC } from 'react'; interface Props { - children?: React.ReactNode; + children: React.ReactNode; id: string; imgSrc?: string; imgAltText?: string; diff --git a/src/components/UI/downloads/DownloadsTable.tsx b/src/components/UI/downloads/DownloadsTable.tsx index 0c317e4bce..3de100ff3b 100644 --- a/src/components/UI/downloads/DownloadsTable.tsx +++ b/src/components/UI/downloads/DownloadsTable.tsx @@ -9,6 +9,11 @@ import { } from '@chakra-ui/react'; import { FC } from 'react'; +import { + DOWNLOAD_TABS, + DOWNLOAD_TAB_COLUMN_HEADERS +} from '../../../constants' + import { DataTable } from '../DataTable' interface Props { @@ -29,154 +34,61 @@ export const DownloadsTable: FC = ({ color='brand.light.primary' bg='green.50' > - - - LINUX - - - - - MACOS - - - - - WINDOWS - - - - - IOS - - - - - ANDROID - - + { + DOWNLOAD_TABS.map((tab, idx) => { + return ( + + + {tab} + + + ) + }) + } diff --git a/src/constants.ts b/src/constants.ts index 936cb15936..59222639cb 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -13,4 +13,58 @@ export const GO_URL = 'https://go.dev/'; // Downloads export const DEFAULT_BUILD_AMOUNT_TO_SHOW = 10; - +export const DOWNLOAD_HEADER_BUTTONS: {[index: string]: {name: string; image: string; imageAlt: string; buildURL: string;}} = { + linuxBuild: { + name: 'Linux', + image: '/images/pages/linux-penguin.svg', + imageAlt: 'Linux logo', + buildURL: '' + }, + macOSBuild: { + name: 'macOS', + image: '/images/pages/macos-logo.svg', + imageAlt: 'macOS logo', + buildURL: '' + }, + windowsBuild: { + name: 'Windows', + image: '/images/pages/windows-logo.svg', + imageAlt: 'Windows logo', + buildURL: '' + }, + sourceCode: { + name: 'Sources', + image: '/images/pages/source-branch.svg', + imageAlt: 'Source branch logo', + buildURL: '' + } +} +export const DOWNLOAD_TABS = [ + 'Linux', + 'macOS', + 'Windows', + 'iOS', + 'Android' +] +export const DOWNLOAD_TAB_COLUMN_HEADERS = [ + 'Release', + 'Commit', + 'Kind', + 'Arch', + 'Size', + 'Published', + 'Signature', + 'Checksum (MD5)' +] +export const DOWNLOAD_OPENPGP_BUILD_HEADERS = [ + 'Build Server', + 'Unique ID', + 'OpenPGP Key', + 'Fingerprint' +] +export const DOWNLOAD_OPENPGP_DEVELOPER_HEADERS = [ + 'Developer', + 'Unique ID', + 'OpenPGP Key', + 'Fingerprint' +] \ No newline at end of file diff --git a/src/pages/downloads.tsx b/src/pages/downloads.tsx index ca4f53b9de..e073e4d220 100644 --- a/src/pages/downloads.tsx +++ b/src/pages/downloads.tsx @@ -18,6 +18,8 @@ import { DataTable } from '../components/UI/DataTable'; import { DEFAULT_BUILD_AMOUNT_TO_SHOW, + DOWNLOAD_OPENPGP_BUILD_HEADERS, + DOWNLOAD_OPENPGP_DEVELOPER_HEADERS, GETH_REPO_URL } from '../constants' @@ -79,7 +81,7 @@ const DownloadsPage: NextPage = ({}) => { Please select your desired platform from the lists below and download your bundle of choice. Please be aware that the MD5 checksums are provided by our binary hosting platform (Azure Blobstore) to help check for download errors. For security guarantees please verify any downloads via the attached PGP signature files (see{' '} OpenPGP {' '} @@ -95,7 +97,7 @@ const DownloadsPage: NextPage = ({}) => { GitHub repository. @@ -116,7 +118,7 @@ const DownloadsPage: NextPage = ({}) => { textAlign='center' p={4} > - SHOW OLDER RELEASES + Show older releases @@ -129,7 +131,7 @@ const DownloadsPage: NextPage = ({}) => { GitHub repository. @@ -150,7 +152,7 @@ const DownloadsPage: NextPage = ({}) => { textAlign='center' p={4} > - SHOW OLDER RELEASES + Show older releases @@ -166,12 +168,7 @@ const DownloadsPage: NextPage = ({}) => { {/* TODO: swap for real data */} @@ -179,12 +176,7 @@ const DownloadsPage: NextPage = ({}) => { {/* TODO: swap for real data */} diff --git a/src/theme/components/Link.ts b/src/theme/components/Link.ts index d03e7ceb7d..19f891399e 100644 --- a/src/theme/components/Link.ts +++ b/src/theme/components/Link.ts @@ -12,22 +12,6 @@ export const Link = { }, _active: { textDecoration: 'none', bg: 'brand.light.secondary', color: 'yellow.50' } }, - href: { - color: 'brand.light.primary', - _hover: { - color: 'brand.light.body', - textDecorationColor: 'brand.light.body' - }, - _focus: { - color: 'brand.light.primary', - boxShadow: 'linkBoxShadow', - textDecoration: 'none' - }, - _pressed: { - color: 'brand.light.secondary', - textDecorationColor: 'brand.light.secondary' - } - }, light: { textDecoration: 'underline', color: 'brand.light.primary',