Skip to content

Commit

Permalink
update logo, refactor paths for games
Browse files Browse the repository at this point in the history
  • Loading branch information
ayan4m1 committed Feb 7, 2024
1 parent 504e436 commit 29bfdfe
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { Container, Navbar, Nav, NavDropdown, Button } from 'react-bootstrap';

import { useThemeContext } from 'hooks/useThemeContext';

import icon from '../images/gatsby-icon.png';

export default function Header() {
const { darkMode, toggleDarkMode } = useThemeContext();
const data = useStaticQuery(graphql`
Expand All @@ -40,7 +42,13 @@ export default function Header() {
return (
<Navbar variant="dark" bg="primary" expand="lg">
<Container>
<Navbar.Brand className="pt-2 pb-2">
<Navbar.Brand className="py-2 d-flex align-items-center">
<img
src={icon}
alt="Sloth Face"
style={{ height: 32 }}
className="me-2"
/>
<Link to="/" className="text-light">
{data.site.siteMetadata.title}
</Link>
Expand Down Expand Up @@ -79,13 +87,13 @@ export default function Header() {
</Fragment>
}
>
<Nav.Link as={Link} to="/sudoku" className="text-dark">
<Nav.Link as={Link} to="/games/sudoku" className="text-dark">
<FontAwesomeIcon icon={faTable} /> Sudoku
</Nav.Link>
<Nav.Link as={Link} to="/mahjong" className="text-dark">
<Nav.Link as={Link} to="/games/mahjong" className="text-dark">
<FontAwesomeIcon icon={faRectangleList} /> Mahjong
</Nav.Link>
<Nav.Link as={Link} to="/coloree" className="text-dark">
<Nav.Link as={Link} to="/games/coloree" className="text-dark">
<FontAwesomeIcon icon={faPaintBrush} /> Coloree
</Nav.Link>
</NavDropdown>
Expand Down
Binary file modified src/images/gatsby-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const readFile = (file) =>
new Promise((resolve, reject) => {
const reader = new FileReader();

reader.addEventListener('load', ({ target: { result } }) =>
resolve(result)
);
reader.addEventListener('error', () => reject('Failed to parse file'));
reader.readAsText(file);
});

0 comments on commit 29bfdfe

Please sign in to comment.