Skip to content

Commit

Permalink
Merge branch 'fredriksvantes-patch-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
fredriksvantes committed Jan 16, 2025
2 parents f3c2498 + 1808be2 commit af43b28
Show file tree
Hide file tree
Showing 13 changed files with 436 additions and 12 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": [
"next/core-web-vitals",
"prettier"
],
"rules": {
"react/no-unescaped-entities": "off",
"@next/next/no-img-element": "off"
}
}
105 changes: 105 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Dependencies
/node_modules
/.pnp
.pnp.js

# Testing
/coverage

# Next.js
/.next/
/out/
.swc/

# Production
/build
/dist

# Misc
.DS_Store
*.pem
.env.local
.env.development.local
.env.test.local
.env.production.local

# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Local env files
.env*.local

# Vercel
.vercel

# TypeScript
*.tsbuildinfo
next-env.d.ts

# IDE
.idea/
.vscode/
*.sublime-project
*.sublime-workspace
*.code-workspace

# Logs
logs
*.log

# Cache
.cache/
.npm/

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.pnp.*

# macOS
.DS_Store
.AppleDouble
.LSOverride
Icon
._*
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Windows
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
*.stackdump
[Dd]esktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msix
*.msm
*.msp
*.lnk

# Linux
*~
.fuse_hidden*
.directory
.Trash-*
.nfs*
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Ethereum Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 6 additions & 2 deletions src/components/UI/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Container, Flex } from '@chakra-ui/react';
import { Box, Container, Flex, HStack } from '@chakra-ui/react';
import { FC } from 'react';
import { useRouter } from 'next/router';
import Image from 'next/image';
Expand All @@ -7,6 +7,7 @@ import EFlogo from '../../../public/images/ef-logo.svg';

import { HOME_URL } from '../../constants';
import { Nav } from '../Nav';
import { ThemeToggle } from './ThemeToggle';

export const Header: FC = () => {
const router = useRouter();
Expand All @@ -19,7 +20,10 @@ export const Header: FC = () => {
<Image src={EFlogo} alt='Ethereum Foundation logo' height={55} width={161} priority />
</Box>

<Nav />
<HStack spacing={4}>
<Nav />
<ThemeToggle />
</HStack>
</Flex>
</Container>
</header>
Expand Down
17 changes: 17 additions & 0 deletions src/components/UI/ThemeToggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { IconButton, useColorMode } from '@chakra-ui/react';
import { MoonIcon, SunIcon } from '@chakra-ui/icons';

export const ThemeToggle = () => {
const { colorMode, toggleColorMode } = useColorMode();

return (
<IconButton
aria-label={`Switch to ${colorMode === 'light' ? 'dark' : 'light'} mode`}
icon={colorMode === 'light' ? <MoonIcon /> : <SunIcon />}
onClick={toggleColorMode}
variant="ghost"
color="current"
_hover={{ bg: colorMode === 'light' ? 'gray.100' : 'whiteAlpha.200' }}
/>
);
};
1 change: 1 addition & 0 deletions src/components/UI/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from './Footer';
export * from './Header';
export * from './InternalPost';
export * from './PageMetadata';
export * from './ThemeToggle';
6 changes: 4 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ export const BLOG_URL = '/blog';
export const TEAM_URL = '/team';
export const EVENTS_URL = '/events';
export const COMPETITIONS_URL = '/competitions';
export const RESPONSIBILITIES_URL = '/responsibilities';

// nav
export const NAV_LINKS = [
{ href: HOME_URL, text: 'home' },
{ href: BLOG_URL, text: 'blog' },
{ href: TEAM_URL, text: 'team' },
{ href: EVENTS_URL, text: 'events' },
{ href: COMPETITIONS_URL, text: 'competitions' }
// { href: EVENTS_URL, text: 'events' },
{ href: COMPETITIONS_URL, text: 'competitions' },
{ href: RESPONSIBILITIES_URL, text: 'responsibilities' }
];

// metadata
Expand Down
3 changes: 2 additions & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChakraProvider } from '@chakra-ui/react';
import { ChakraProvider, ColorModeScript } from '@chakra-ui/react';
import type { AppProps } from 'next/app';
import Head from 'next/head';

Expand Down Expand Up @@ -26,6 +26,7 @@ function MyApp({ Component, pageProps }: AppProps) {
</Head>

<ChakraProvider theme={theme}>
<ColorModeScript initialColorMode={theme.config.initialColorMode} />
<Layout>
<Component {...pageProps} />
</Layout>
Expand Down
39 changes: 37 additions & 2 deletions src/pages/blog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,45 @@ interface Props {
// add here the list of external blog posts, with title, date and link
const externalLinks = [
{
title: 'Writing Robust C - Best Practices for Finding and Preventing Vulnerabilities',
title: 'ETH Rangers Program',
date: '2024-12-02',
link: 'https://blog.ethereum.org/2024/12/02/ethrangers-public-goods'
},
{
title: 'Ethereum Protocol Attackathon Announcement',
date: '2024-11-25',
link: 'https://blog.ethereum.org/2024/11/25/ethereum-protocol-attackathon'
},
{
title: 'Secured #6 - Writing Robust C - Best Practices for Finding and Preventing Vulnerabilities',
date: '2023-11-02',
link: 'https://blog.ethereum.org/2023/11/02/writing-robust-c'
}
},
{
title: 'Secured #5 - Public Vulnerability Disclosures',
date: '2023-05-03',
link: 'https://blog.ethereum.org/2023/05/03/secured-5-disclosures-update'
},
{
title: 'Secured #4 - Bug Bounty Rewards to $250,000',
date: '2022-05-16',
link: 'https://blog.ethereum.org/2022/05/16/secured-no-4'
},
{
title: 'Secured #3 - Security Teams',
date: '2022-04-22',
link: 'https://blog.ethereum.org/2022/04/14/secured-no-3'
},
{
title: 'Secured #2 - Public Vulnerability Disclosures',
date: '2022-03-09',
link: 'https://blog.ethereum.org/2022/03/09/secured-no-2'
},
{
title: 'Secured #1 - BLS is Everywhere',
date: '2021-09-09',
link: 'https://blog.ethereum.org/2021/09/09/secured-no-1'
},
];

const Blog: NextPage<Props> = ({ posts }) => {
Expand Down
Loading

0 comments on commit af43b28

Please sign in to comment.