Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to Next 13, rework play page (#35)
* Update to Next.js 13 - Update all dependencies to latest version. * Update images to use new Image component * Refactor to Next.js 13 app directory * Add react-query * Move API logic to src * Add VSCode workspace settings * Update play page - Hero to guess is the one with the highest net worth. - Show 10 heroes from the match instead of every hero. * Update CI workflow - Add exitOnceUploaded for Chromatic. - Add e2e build script for Cypress' build parsing: cypress-io/github-action#272 * Add basic 404 page * Clean up Match component - Remove console.log. - Remove unnecessary div. - Add no-console ESLint rule. * Add unit test for Loading - Remove unused utils file.
- Loading branch information
Showing
100 changed files
with
6,880 additions
and
4,475 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"typescript.enablePromptUseWorkspaceTsdk": true, | ||
"typescript.tsdk": "node_modules\\typescript\\lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import Component from './page'; | ||
|
||
export default { | ||
component: Component, | ||
parameters: { | ||
layout: 'fullscreen', | ||
}, | ||
title: 'Pages/Index', | ||
} as ComponentMeta<typeof Component>; | ||
|
||
const Template: ComponentStory<typeof Component> = (args) => ( | ||
<Component {...args} /> | ||
); | ||
|
||
export const Index = Template.bind({}); |
12 changes: 1 addition & 11 deletions
12
src/components/pages/About/About.stories.tsx → app/about/About.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const Head = () => ( | ||
<> | ||
<title>About - Guess the Hero</title> | ||
<meta | ||
content="Read more information about the website, how it works and how you can contribute." | ||
name="description" | ||
/> | ||
</> | ||
); | ||
|
||
export default Head; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use client'; | ||
|
||
interface Props { | ||
error: Error; | ||
reset: VoidFunction; | ||
} | ||
|
||
const ErrorPage: React.FC<Props> = ({ error, reset }) => ( | ||
<div className="container"> | ||
<h1>Error</h1> | ||
<p>{error.message}</p> | ||
<button className="btn" onClick={reset}> | ||
Try again | ||
</button> | ||
</div> | ||
); | ||
|
||
export default ErrorPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const Head = () => ( | ||
<> | ||
<title>A Dota 2 quiz - Guess the Hero</title> | ||
<meta | ||
content="A Dota 2 quiz game. Guess the hero from items bought in a match. See the purchased items of a hero and other optional stats and use them to try to guess the hero." | ||
name="description" | ||
/> | ||
</> | ||
); | ||
|
||
export default Head; |
4 changes: 2 additions & 2 deletions
4
src/components/pages/Heroes/Heroes.spec.tsx → app/heroes/Heroes.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 1 addition & 11 deletions
12
...omponents/pages/Heroes/Heroes.stories.tsx → app/heroes/Heroes.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const Head = () => ( | ||
<> | ||
<title>Dota 2 heroes - Guess the Hero</title> | ||
<meta content="See all of Dota 2's heroes." name="description" /> | ||
</> | ||
); | ||
|
||
export default Head; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
12 changes: 1 addition & 11 deletions
12
src/components/pages/Items/Items.stories.tsx → app/items/Items.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const Head = () => ( | ||
<> | ||
<title>Dota 2 items - Guess the Hero</title> | ||
<meta | ||
content="Get to know all the items Dota 2 has to offer and learn all about them. Check their abilities, costs, lore and even more." | ||
name="description" | ||
/> | ||
</> | ||
); | ||
|
||
export default Head; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use client'; | ||
|
||
import { QueryClientProvider } from '@tanstack/react-query'; | ||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; | ||
import { FC, ReactNode } from 'react'; | ||
import Footer from 'src/components/atoms/Footer'; | ||
import Header from 'src/components/atoms/Header'; | ||
import queryClient from 'src/data/query-client'; | ||
import 'styles/globals.scss'; | ||
|
||
const RootLayout: FC<{ children: ReactNode }> = ({ children }) => ( | ||
<html lang="en"> | ||
<head> | ||
<meta charSet="utf-8" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
<link rel="shortcut icon" href="/favicon.png" /> | ||
</head> | ||
<body> | ||
<QueryClientProvider client={queryClient}> | ||
<Header /> | ||
<main>{children}</main> | ||
<Footer /> | ||
<div className="absolute" id="modal" /> | ||
<ReactQueryDevtools /> | ||
</QueryClientProvider> | ||
</body> | ||
</html> | ||
); | ||
|
||
export default RootLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Loading from 'src/components/molecules/Loading'; | ||
|
||
export default Loading; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Link from 'next/link'; | ||
|
||
const NotFound: React.FC = () => ( | ||
<div className="container"> | ||
<h1>Not found</h1> | ||
<Link href="/">To home page</Link> | ||
</div> | ||
); | ||
|
||
export default NotFound; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
import clsx from 'clsx'; | ||
import Link from 'next/link'; | ||
import { FC } from 'react'; | ||
import Button from 'src/components/atoms/Button'; | ||
import Card from 'src/components/atoms/Card'; | ||
import styles from './Home.module.scss'; | ||
import styles from './styles.module.scss'; | ||
|
||
const Home: FC = () => ( | ||
const Index: FC = () => ( | ||
<div className={clsx('container', styles.container)}> | ||
<h1>Test your Dota 2 knowledge</h1> | ||
<Card> | ||
<p>How well can you guess a hero from seeing their purchased items?</p> | ||
<Link href="/game" passHref={true}> | ||
<Button>Play now</Button> | ||
<Link className="btn" href="/play"> | ||
Play now | ||
</Link> | ||
</Card> | ||
</div> | ||
); | ||
|
||
export default Home; | ||
export default Index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const Head = () => ( | ||
<> | ||
<title>Dota 2 - Guess the Hero</title> | ||
<meta | ||
content="Play a quiz game of Dota 2. Guess the hero from a random match only by seeing their inventory." | ||
name="description" | ||
/> | ||
</> | ||
); | ||
|
||
export default Head; |
Oops, something went wrong.
c352849
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
guess-the-hero – ./
guess-the-hero-git-master-dricholm.vercel.app
guess-the-hero.vercel.app
guess-the-hero-dricholm.vercel.app
www.guessthehero.com
guessthehero.com