Skip to content

Commit

Permalink
4.x update (#28)
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Petrunic <marin.petrunic@gmail.com>
  • Loading branch information
mpetrunic authored Jun 28, 2023
1 parent 3291bad commit dbe3bca
Show file tree
Hide file tree
Showing 23 changed files with 151 additions and 419 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ This project is built on create-react-app so to run the development version:
- install dependencies with `yarn`
- run `yarn run start` and the website should open in your default browser

For any questions, reach out on [Discord](http://discord.gg/n2U6x9c)
For any questions, reach out on [Discord](https://discord.gg/yhHVtK5Wqt)
7 changes: 4 additions & 3 deletions src/Components/Modules/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react"
import { createStyles, ITheme, makeStyles } from "@chainsafe/common-theme"
import { Grid, Typography } from "@chainsafe/common-components"
import {Trans} from "@lingui/macro";
import { blogUrl, discordUrl, docsUrl } from "../../urls";

const useStyles = makeStyles(({ palette, constants, breakpoints }: ITheme) => {
return createStyles({
Expand Down Expand Up @@ -100,7 +101,7 @@ const Footer: React.FC = () => {
</Grid>
<Grid item className={classes.item}>
<a
href="https://web3js.readthedocs.io/en/latest/"
href={docsUrl}
rel="noopener noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -129,7 +130,7 @@ const Footer: React.FC = () => {
</Grid>
<Grid item className={classes.item}>
<a
href="http://discord.gg/n2U6x9c"
href={discordUrl}
rel="noopener noreferrer"
target="_blank"
>
Expand All @@ -140,7 +141,7 @@ const Footer: React.FC = () => {
</Grid>
<Grid item className={classes.item}>
<a
href="https://blog.chainsafe.io/tagged/ethereum"
href={blogUrl}
target="_blank"
rel="noopener noreferrer"
>
Expand Down
66 changes: 0 additions & 66 deletions src/Components/Modules/InternalNav.tsx

This file was deleted.

19 changes: 8 additions & 11 deletions src/Components/Modules/MobileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import { motion } from 'framer-motion';
import { MobileMenuItem } from './MobileMenuItem';
import { createStyles, ITheme, makeStyles } from '@chainsafe/common-theme';
import { discordUrl, docsUrl } from '../../urls';

const variants = {
open: {
Expand All @@ -19,28 +20,24 @@ export interface NavLink {
}

const navlinks: NavLink[] = [

{
id: 1,
name: '1.x Docs',
linkUrl: 'https://web3js.readthedocs.io/en/v1.7.5/',
},
{
id: 1,
name: '4.x Docs',
linkUrl: 'https://docs.web3js.org/',
name: 'Docs',
linkUrl: docsUrl,
},
{
id: 3,
id: 2,
name: 'Join Discord',
linkUrl: 'http://discord.gg/n2U6x9c',
linkUrl: discordUrl,
},
{
id: 4,
id: 3,
name: 'Blog',
linkUrl: 'https://medium.com/chainsafe-systems',
},
{
id: 5,
id: 4,
name: 'GitHub',
linkUrl: 'https://github.com/chainsafe/web3.js',
},
Expand Down
13 changes: 7 additions & 6 deletions src/Components/Modules/MobileNav2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "./styles.css";
import {
createStyles, ITheme, makeStyles
} from "@chainsafe/common-theme";
import { discordUrl, docsUrl } from "../../urls";

const sidebar = {
open: (height = 1000) => ({
Expand Down Expand Up @@ -73,22 +74,22 @@ const navlinks: NavLink[] = [
{
id: 1,
name: "Docs",
linkUrl: "https://web3js.readthedocs.io/en/v1.5.2/"
linkUrl: docsUrl
},
{
id: 3,
id: 2,
name: "Join Discord",
linkUrl: "http://discord.gg/n2U6x9c"
linkUrl: discordUrl
},
{
id: 4,
id: 3,
name: "Blog",
linkUrl: "https://medium.com/chainsafe-systems"
},
{
id: 5,
id: 4,
name: "GitHub",
linkUrl: "https://github.com/chainsafe/web3.js"
linkUrl: "https://github.com/web3/web3.js"
},
]

Expand Down
9 changes: 5 additions & 4 deletions src/Components/Modules/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Grid, Link, Typography, useScrollToTop } from "@chainsafe/common-compon
import { Trans } from "@lingui/macro"
import { MobileNav } from "./MobileNav";
import web3js from "../../assets/images/web3js.png"
import { discordUrl, docsUrl } from "../../urls";

const useStyles = makeStyles(({ breakpoints, palette, zIndex, constants }: ITheme) => {
return createStyles({
Expand Down Expand Up @@ -119,17 +120,17 @@ const NavBar: React.FC = () => {
<a
target="_blank"
rel="noopener noreferrer"
href="https://web3js.readthedocs.io/en/v1.7.5/"
href={docsUrl}
className={classes.navlink}
>
<Trans>1.x Docs</Trans>
<Trans>Docs</Trans>
</a>
</Typography>
<Typography variant="h5">
<a
target="_blank"
rel="noopener noreferrer"
href="http://discord.gg/n2U6x9c"
href={discordUrl}
className={classes.navlink}
>
<Trans>Community</Trans>
Expand All @@ -149,7 +150,7 @@ const NavBar: React.FC = () => {
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/chainsafe/web3.js"
href="https://github.com/web3/web3.js"
className={classes.navlink}
>
<Trans>GitHub</Trans>
Expand Down
34 changes: 17 additions & 17 deletions src/Components/Subpages/CodeBlocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const useStyles = makeStyles(({ constants, palette, breakpoints }: ITheme) => {
desc: {
fontSize: '22px',
lineHeight: '28px',
maxWidth: '85%',
minHeight: '4rem',
color: palette.additional['gray'][7],
},
demosWrapper: {
Expand Down Expand Up @@ -65,61 +65,61 @@ const CodeBlocks: React.FC = () => {
<div className={classes.container}>
<div className={classes.demosWrapper}>
<div className={classes.demo}>
<CopyBlock
text={sample['interact']}
language='javascript'
theme={monokaiSublime}
wrapLines={true}
customStyle={codeCSS}
/>
<h1 className={classes.header}>Interact with smart contracts.</h1>
<p className={classes.desc}>
Examine recent transfer events by querying or subscribing to their
events.
</p>
</div>
<div className={classes.demo}>
<CopyBlock
text={sample['listen']}
text={sample['interact']}
language='javascript'
theme={monokaiSublime}
wrapLines={true}
customStyle={codeCSS}
/>
</div>
<div className={classes.demo}>
<h1 className={classes.header}>Listen for on-chain events.</h1>
<p className={classes.desc}>
Subscribe to changes on smart contracts and more.
</p>
</div>
<div className={classes.demo}>
<CopyBlock
text={sample['fetch']}
text={sample['listen']}
language='javascript'
theme={monokaiSublime}
wrapLines={true}
customStyle={codeCSS}
/>
</div>
<div className={classes.demo}>
<h1 className={classes.header}>Fetch data from the blockchain.</h1>
<p className={classes.desc}>
Get an Ethereum account balance with a simple query to a node
provider via JSON-RPC.
</p>
</div>
<div className={classes.demo}>
<CopyBlock
text={sample['simplify']}
text={sample['fetch']}
language='javascript'
theme={monokaiSublime}
wrapLines={true}
customStyle={codeCSS}
/>
</div>
<div className={classes.demo}>
<h1 className={classes.header}>
Simplify your code with built-in utilities.
</h1>
<p className={classes.desc}>
Calculate the sha3 hash of your input data, convert your Ether
values in wei, and more.
</p>
<CopyBlock
text={sample['simplify']}
language='javascript'
theme={monokaiSublime}
wrapLines={true}
customStyle={codeCSS}
/>
</div>
</div>
</div>
Expand Down
82 changes: 0 additions & 82 deletions src/Components/Subpages/CodeBlocks/CodeBlocks.tsx

This file was deleted.

Loading

0 comments on commit dbe3bca

Please sign in to comment.