diff --git a/public/images/pages/gopher-downloads-front-light.svg b/public/images/pages/gopher-downloads-front-light.svg new file mode 100644 index 0000000000..41c2984306 --- /dev/null +++ b/public/images/pages/gopher-downloads-front-light.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/images/pages/linux-penguin.svg b/public/images/pages/linux-penguin.svg new file mode 100644 index 0000000000..f66b859b43 --- /dev/null +++ b/public/images/pages/linux-penguin.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/images/pages/macos-logo.svg b/public/images/pages/macos-logo.svg new file mode 100644 index 0000000000..6c6180ff5e --- /dev/null +++ b/public/images/pages/macos-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/images/pages/source-branch.svg b/public/images/pages/source-branch.svg new file mode 100644 index 0000000000..0ae94f6e20 --- /dev/null +++ b/public/images/pages/source-branch.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/images/pages/windows-logo.svg b/public/images/pages/windows-logo.svg new file mode 100644 index 0000000000..13729fe7ff --- /dev/null +++ b/public/images/pages/windows-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/UI/DataTable.tsx b/src/components/UI/DataTable.tsx new file mode 100644 index 0000000000..c1a260293b --- /dev/null +++ b/src/components/UI/DataTable.tsx @@ -0,0 +1,95 @@ +import { + Table, + Thead, + Tr, + Th, + TableContainer, + Text, + Tbody, + Td, +} from '@chakra-ui/react'; +import { FC } from 'react'; + +interface Props { + columnHeaders: string[] + data: any +} + +export const DataTable: FC = ({ + columnHeaders, + data, +}) => { + return ( + + + + + { + columnHeaders.map((columnHeader, idx) => { + return ( + + ) + }) + } + + + + { + data.map((item: any, idx: number) => { + return ( + + { + columnHeaders.map((columnHeader, idx) => { + // TODO: Make the font size smaller (refer to design system) + return ( + + ) + }) + } + + ) + }) + } + +
+ + {columnHeader} + +
+ {item[columnHeader.toLowerCase()]} +
+
+ ) +} \ No newline at end of file diff --git a/src/components/UI/downloads/DownloadsHero.tsx b/src/components/UI/downloads/DownloadsHero.tsx new file mode 100644 index 0000000000..67b30355be --- /dev/null +++ b/src/components/UI/downloads/DownloadsHero.tsx @@ -0,0 +1,107 @@ +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 + linuxBuildURL: string + macOSBuildURL: string + releaseNotesURL: string + sourceCodeURL: string + windowsBuildURL: string +} + +export const DownloadsHero: FC = ({ + currentBuildName, + currentBuildVersion, + linuxBuildURL, + macOSBuildURL, + releaseNotesURL, + 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 plugged in + + + + + Download go-ethereum + + + + {currentBuildName} ({currentBuildVersion}) + + + + 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) => { + return ( + + + + ) + }) + } + + + + Release notes for {currentBuildName} {currentBuildVersion} + + + + + ); +}; diff --git a/src/components/UI/downloads/DownloadsSection.tsx b/src/components/UI/downloads/DownloadsSection.tsx new file mode 100644 index 0000000000..5e0fdf26a2 --- /dev/null +++ b/src/components/UI/downloads/DownloadsSection.tsx @@ -0,0 +1,44 @@ +import { Box, Image, Stack } from '@chakra-ui/react'; +import { FC } from 'react'; + +interface Props { + children: React.ReactNode; + id: string; + imgSrc?: string; + imgAltText?: string; + sectionTitle: string +} + +export const DownloadsSection: FC = ({ + children, + imgSrc, + imgAltText, + sectionTitle, + id +}) => { + return ( + + {!!imgSrc && ( + + {/* TODO: use NextImage */} + {imgAltText} + + )} + + + + {sectionTitle} + + + + + {children} + + + ) +} \ No newline at end of file diff --git a/src/components/UI/downloads/DownloadsTable.tsx b/src/components/UI/downloads/DownloadsTable.tsx new file mode 100644 index 0000000000..6fc7288b35 --- /dev/null +++ b/src/components/UI/downloads/DownloadsTable.tsx @@ -0,0 +1,99 @@ +import { + Stack, + Tabs, + TabList, + Tab, + Text, + TabPanel, + TabPanels, +} from '@chakra-ui/react'; +import { FC } from 'react'; + +import { + DOWNLOAD_TABS, + DOWNLOAD_TAB_COLUMN_HEADERS +} from '../../../constants' + +import { DataTable } from '../DataTable' + +interface Props { + data: any +} + +export const DownloadsTable: FC = ({ + data +}) => { + return ( + + + + { + DOWNLOAD_TABS.map((tab, idx) => { + return ( + + + {tab} + + + ) + }) + } + + + + + + + + + + + + + + + + + + + + + ) +} \ No newline at end of file diff --git a/src/components/UI/downloads/index.ts b/src/components/UI/downloads/index.ts new file mode 100644 index 0000000000..597af494c8 --- /dev/null +++ b/src/components/UI/downloads/index.ts @@ -0,0 +1,3 @@ +export * from './DownloadsHero'; +export * from './DownloadsSection' +export * from './DownloadsTable' \ No newline at end of file diff --git a/src/constants.ts b/src/constants.ts index 1f481b1b0d..59222639cb 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -10,3 +10,61 @@ 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 GETH_REPO_URL = 'https://github.com/ethereum/go-ethereum'; 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/data/test/download-testdata.ts b/src/data/test/download-testdata.ts new file mode 100644 index 0000000000..910e7c1936 --- /dev/null +++ b/src/data/test/download-testdata.ts @@ -0,0 +1,122 @@ +export const testDownloadData = [ + { + release: 'Geth 1.10.23', + commit: 'd901d853…', + kind: 'archive', + arch: '64-bit', + size: '11.71 MB', + published: 'Last Wednesday at 11:11 AM', + signature: 'Signature', + "checksum (md5)": 'c93b0339413a8f2b95aa4b23b32d64af' + }, + { + release: 'Geth 1.10.23', + commit: 'd901d853…', + kind: 'archive', + arch: '64-bit', + size: '11.71 MB', + published: 'Last Wednesday at 11:11 AM', + signature: 'Signature', + "checksum (md5)": 'c93b0339413a8f2b95aa4b23b32d64af' + }, + { + release: 'Geth 1.10.23', + commit: 'd901d853…', + kind: 'archive', + arch: '64-bit', + size: '11.71 MB', + published: 'Last Wednesday at 11:11 AM', + signature: 'Signature', + "checksum (md5)": 'c93b0339413a8f2b95aa4b23b32d64af' + }, + { + release: 'Geth 1.10.23', + commit: 'd901d853…', + kind: 'archive', + arch: '64-bit', + size: '11.71 MB', + published: 'Last Wednesday at 11:11 AM', + signature: 'Signature', + "checksum (md5)": 'c93b0339413a8f2b95aa4b23b32d64af' + }, + { + release: 'Geth 1.10.23', + commit: 'd901d853…', + kind: 'archive', + arch: '64-bit', + size: '11.71 MB', + published: 'Last Wednesday at 11:11 AM', + signature: 'Signature', + "checksum (md5)": 'c93b0339413a8f2b95aa4b23b32d64af' + }, + { + release: 'Geth 1.10.23', + commit: 'd901d853…', + kind: 'archive', + arch: '64-bit', + size: '11.71 MB', + published: 'Last Wednesday at 11:11 AM', + signature: 'Signature', + "checksum (md5)": 'c93b0339413a8f2b95aa4b23b32d64af' + }, + { + release: 'Geth 1.10.23', + commit: 'd901d853…', + kind: 'archive', + arch: '64-bit', + size: '11.71 MB', + published: 'Last Wednesday at 11:11 AM', + signature: 'Signature', + "checksum (md5)": 'c93b0339413a8f2b95aa4b23b32d64af' + }, + { + release: 'Geth 1.10.23', + commit: 'd901d853…', + kind: 'archive', + arch: '64-bit', + size: '11.71 MB', + published: 'Last Wednesday at 11:11 AM', + signature: 'Signature', + "checksum (md5)": 'c93b0339413a8f2b95aa4b23b32d64af' + }, + { + release: 'Geth 1.10.23', + commit: 'd901d853…', + kind: 'archive', + arch: '64-bit', + size: '11.71 MB', + published: 'Last Wednesday at 11:11 AM', + signature: 'Signature', + "checksum (md5)": 'c93b0339413a8f2b95aa4b23b32d64af' + }, + { + release: 'Geth 1.10.23', + commit: 'd901d853…', + kind: 'archive', + arch: '64-bit', + size: '11.71 MB', + published: 'Last Wednesday at 11:11 AM', + signature: 'Signature', + "checksum (md5)": 'c93b0339413a8f2b95aa4b23b32d64af' + }, + { + release: 'Geth 1.10.23', + commit: 'd901d853…', + kind: 'archive', + arch: '64-bit', + size: '11.71 MB', + published: 'Last Wednesday at 11:11 AM', + signature: 'Signature', + "checksum (md5)": 'c93b0339413a8f2b95aa4b23b32d64af' + }, + { + release: 'Geth 1.10.23', + commit: 'd901d853…', + kind: 'archive', + arch: '64-bit', + size: '11.71 MB', + published: 'Last Wednesday at 11:11 AM', + signature: 'Signature', + "checksum (md5)": 'c93b0339413a8f2b95aa4b23b32d64af' + }, +] \ No newline at end of file diff --git a/src/data/test/pgpbuild-testdata.ts b/src/data/test/pgpbuild-testdata.ts new file mode 100644 index 0000000000..a016016edf --- /dev/null +++ b/src/data/test/pgpbuild-testdata.ts @@ -0,0 +1,32 @@ +export const pgpBuildTestData = [ + { + "build server": "Android Builder", + "unique id": "Go Ethereum Android Builder ", + "openpgp key": "F9585DE6", + "fingerprint": "8272 1824 F4D7 46E0 B5A7 AB95 70AD 154B F958 5DE6" + }, + { + "build server": "iOS Builder", + "unique id": "Go Ethereum iOS Builder ", + "openpgp key": "F9585DE6", + "fingerprint": "8272 1824 F4D7 46E0 B5A7 AB95 70AD 154B F958 5DE6" + }, + { + "build server": "Linux Builder", + "unique id": "Go Ethereum Linux Builder ", + "openpgp key": "F9585DE6", + "fingerprint": "8272 1824 F4D7 46E0 B5A7 AB95 70AD 154B F958 5DE6" + }, + { + "build server": "macOS Builder", + "unique id": "Go Ethereum macOS Builder ", + "openpgp key": "F9585DE6", + "fingerprint": "8272 1824 F4D7 46E0 B5A7 AB95 70AD 154B F958 5DE6" + }, + { + "build server": "Windows Builder", + "unique id": "Go Ethereum Windows Builder ", + "openpgp key": "F9585DE6", + "fingerprint": "8272 1824 F4D7 46E0 B5A7 AB95 70AD 154B F958 5DE6" + }, +] \ No newline at end of file diff --git a/src/data/test/pgpdeveloper-testdata.ts b/src/data/test/pgpdeveloper-testdata.ts new file mode 100644 index 0000000000..85d16adfd6 --- /dev/null +++ b/src/data/test/pgpdeveloper-testdata.ts @@ -0,0 +1,20 @@ +export const pgpDeveloperTestData = [ + { + "developer": "Felix Lange", + "unique id": "Felix Lange ", + "openpgp key": "F9585DE6", + "fingerprint": "8272 1824 F4D7 46E0 B5A7 AB95 70AD 154B F958 5DE6" + }, + { + "developer": "Martin Holst Swende", + "unique id": "Martin Holst Swende ", + "openpgp key": "F9585DE6", + "fingerprint": "8272 1824 F4D7 46E0 B5A7 AB95 70AD 154B F958 5DE6" + }, + { + "developer": "Péter Szilágyi", + "unique id": "Péter Szilágyi ", + "openpgp key": "F9585DE6", + "fingerprint": "8272 1824 F4D7 46E0 B5A7 AB95 70AD 154B F958 5DE6" + }, +] \ No newline at end of file diff --git a/src/pages/downloads.md b/src/pages/downloads.md deleted file mode 100644 index 0f700ee2a1..0000000000 --- a/src/pages/downloads.md +++ /dev/null @@ -1 +0,0 @@ -beep diff --git a/src/pages/downloads.tsx b/src/pages/downloads.tsx new file mode 100644 index 0000000000..72c098f71b --- /dev/null +++ b/src/pages/downloads.tsx @@ -0,0 +1,229 @@ +import { + Code, + Link, + ListItem, + Stack, + Text, + UnorderedList, +} from '@chakra-ui/react'; +import type { NextPage } from 'next'; +import { useState } from 'react' + +import { + DownloadsHero, + DownloadsSection, + DownloadsTable, +} from '../components/UI/downloads'; +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' + +import { testDownloadData } from '../data/test/download-testdata' +import { pgpBuildTestData } from '../data/test/pgpbuild-testdata'; +import { pgpDeveloperTestData } from '../data/test/pgpdeveloper-testdata'; + +const DownloadsPage: NextPage = () => { + const [amountStableReleases, updateAmountStables] = useState(DEFAULT_BUILD_AMOUNT_TO_SHOW) + const [amountDevelopBuilds, updateAmountDevelopBuilds] = useState(DEFAULT_BUILD_AMOUNT_TO_SHOW) + + const showMoreStableReleases = () => { + updateAmountStables(amountStableReleases+10) + } + + const showMoreDevelopBuilds = () => { + updateAmountDevelopBuilds(amountDevelopBuilds+10) + } + + return ( + <> + {/* TODO: add PageMetadata */} + +
+ + {/* TODO: replace hardcoded strings with build information */} + + + + + + If you're looking for a specific release, operating system or architecture, below you will find: + + + + + + All stable and develop builds of Geth and tools + + + + + Archives for non-primary processor architectures + + + + + Android library archives and iOS XCode frameworks + + + + + + 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 + {' '} + Signatures for details). + + + + + + + + These are the current and previous stable releases of go-ethereum, updated automatically when a new version is tagged in our{' '} + + GitHub repository. + + + + + {/* TODO: swap test data for real data */} + + + + + + Show older releases + + + + + + + + + These are the develop snapshots of go-ethereum, updated automatically when a new commit is pushed into our{' '} + + GitHub repository. + + + + + {/* TODO: swap for real data */} + + + + + + Show older releases + + + + + + + + + All the binaries available from this page are signed via our build server PGP keys: + + + + {/* TODO: swap for real data */} + + + + + {/* TODO: swap for real data */} + + + + + + + + + You can import the build server public keys by grabbing the individual keys directly from the keyserver network: + + + {/* TODO: These keys depends on the binary */} + + gpg --recv-keys F9585DE6 C2FF8BBF 9BA28146 7B9E2481 D2A67EAC + + + + + + Similarly you can import all the developer public keys by grabbing them directly from the keyserver network: + + + {/* TODO: These are developer keys, do we need to change? */} + + gpg --recv-keys E058A81C 05A5DDF0 1CCB7DD2 + + + + + + From the download listings above you should see a link both to the downloadable archives as well as detached signature files. To verify the authenticity of any downloaded data, grab both files and then run: + + + {/* TODO: These keys depends on the binary */} + + gpg --verify geth-linux-amd64-1.5.0-d0c820ac.tar.gz.asc + + + + +
+ + ) +} + +export default DownloadsPage \ No newline at end of file diff --git a/src/theme/foundations/index.ts b/src/theme/foundations/index.ts index 3e6332ffc5..b18404055e 100644 --- a/src/theme/foundations/index.ts +++ b/src/theme/foundations/index.ts @@ -1,3 +1,4 @@ export * from './colors'; +export * from './shadows'; export * from './sizes'; export * from './textStyles'; diff --git a/src/theme/foundations/shadows.ts b/src/theme/foundations/shadows.ts new file mode 100644 index 0000000000..d870a80e6b --- /dev/null +++ b/src/theme/foundations/shadows.ts @@ -0,0 +1,3 @@ +export const shadows = { + linkBoxShadow: '0 0 0 1px #11866f !important' +} \ No newline at end of file diff --git a/src/theme/foundations/textStyles.ts b/src/theme/foundations/textStyles.ts index fa4bd9b9ae..0443497cee 100644 --- a/src/theme/foundations/textStyles.ts +++ b/src/theme/foundations/textStyles.ts @@ -53,6 +53,19 @@ export const textStyles = { fontSize: '13px', fontFamily: '"Inter", sans-serif' }, + 'downloads-button-label': { + fontFamily:'"JetBrains Mono", monospace', + color:'yellow.50', + fontSize:'xs', + textTransform:'uppercase', + }, + 'download-tab-label': { + fontFamily: '"JetBrains Mono", monospace', + fontWeight: 700, + textTransform: 'uppercase', + textAlign: 'center', + fontSize: 'sm', + }, // TODO: refactor w/ semantic tokens for light/dark mode 'link-light': {}, // TODO: refactor w/ semantic tokens for light/dark mode diff --git a/src/theme/index.ts b/src/theme/index.ts index cccdd60e09..746344cbd2 100644 --- a/src/theme/index.ts +++ b/src/theme/index.ts @@ -1,6 +1,6 @@ import { extendTheme } from '@chakra-ui/react'; -import { colors, sizes, textStyles } from './foundations'; +import { colors, shadows, sizes, textStyles } from './foundations'; import { Button, Link } from './components'; const overrides = { @@ -9,6 +9,7 @@ const overrides = { Button, Link }, + shadows, sizes, styles: { global: () => ({