Skip to content

Commit 3f646e1

Browse files
committed
refactor: clean code
with improve readme
1 parent 6b2af21 commit 3f646e1

File tree

10 files changed

+89
-92
lines changed

10 files changed

+89
-92
lines changed

README.md

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,10 @@
1-
# PossibleGames Website
2-
3-
4-
# Commit Norms
5-
6-
| Commit Type | Description |
7-
|:------------|:--------------------------------------------------------------------------------------------------------------------------|
8-
| build | Changes that affect the build system or external dependencies (npm, make, etc.) |
9-
| ci | Changes related to integration files and scripts or configuration (Travis, Ansible, BrowserStack, etc.) |
10-
| feat | Addition of a new feature |
11-
| fix | Bug fix |
12-
| perf | Performance improvements |
13-
| refactor | Modification that neither adds a new feature nor improves performance |
14-
| style | Change that does not affect functionality or semantics (indentation, formatting, adding space, renaming a variable, etc.) |
15-
| docs | Writing or updating documentation |
16-
| test | Addition or modification of tests |
17-
18-
19-
# License
20-
21-
This project is licensed under the MIT License - see the [LICENSE](https://github.com/PossibleGames/PossibleGames.github.io/blob/main/LICENSE.md) file for details.
22-
23-
24-
25-
26-
27-
28-
29-
30-
31-
32-
33-
1+
[![CI_Build](https://github.com/bobis33/Portfolio/actions/workflows/build.yml/badge.svg)](https://github.com/bobis33/Portfolio/actions/workflows/build.yml)
2+
[![CI_Deploy](https://github.com/bobis33/Portfolio/actions/workflows/deploy.yml/badge.svg)](https://github.com/bobis33/Portfolio/actions/workflows/deploy.yml)
3+
![GitHub repo size](https://img.shields.io/github/repo-size/PossibleGames/PossibleGames.github.io)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/PossibleGames/PossibleGames.github.io/blob/main/LICENSE)
345

6+
# PossibleGames Website
357

36-
# NEXT DEFAULT README
378

389
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
3910

@@ -53,11 +24,10 @@ bun dev
5324

5425
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
5526

56-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
57-
5827
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
5928

60-
## Learn More
29+
30+
## Learn More (Next.js)
6131

6232
To learn more about Next.js, take a look at the following resources:
6333

@@ -66,8 +36,22 @@ To learn more about Next.js, take a look at the following resources:
6636

6737
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
6838

69-
## Deploy on Vercel
7039

71-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
40+
# Commit Norms
41+
42+
| Commit Type | Description |
43+
|:------------|:--------------------------------------------------------------------------------------------------------------------------|
44+
| build | Changes that affect the build system or external dependencies (npm, make, etc.) |
45+
| ci | Changes related to integration files and scripts or configuration (Travis, Ansible, BrowserStack, etc.) |
46+
| feat | Addition of a new feature |
47+
| fix | Bug fix |
48+
| perf | Performance improvements |
49+
| refactor | Modification that neither adds a new feature nor improves performance |
50+
| style | Change that does not affect functionality or semantics (indentation, formatting, adding space, renaming a variable, etc.) |
51+
| docs | Writing or updating documentation |
52+
| test | Addition or modification of tests |
53+
54+
55+
# License
7256

73-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
57+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/PossibleGames/PossibleGames.github.io/blob/main/LICENSE.md) file for details.

app/about/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22

3-
export default function About() {
3+
export default function Page() {
44
return (
55
<>
66
<p> about </p>

app/components/footer.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/components/header.tsx

Lines changed: 0 additions & 31 deletions
This file was deleted.

app/contact/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22

3-
export default function Contact() {
3+
export default function Page() {
44
return (
55
<>
66
<p> contact </p>

app/documentation/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22

3-
export default function Documentation() {
3+
export default function Page() {
44
return (
55
<>
66
<p> documentation </p>

app/global-error.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use client' // Error boundaries must be Client Components
2+
3+
import { useEffect } from 'react'
4+
5+
export default function GlobalError({
6+
error,
7+
reset,
8+
}: {
9+
error: Error & { digest?: string }
10+
reset: () => void
11+
}) {
12+
useEffect(() => {
13+
console.error(error)
14+
}, [error])
15+
return (
16+
<html>
17+
<body>
18+
<h2>Something went wrong!</h2>
19+
<button onClick={() => reset()}>Try again</button>
20+
</body>
21+
</html>
22+
)
23+
}

app/layout.tsx

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,49 @@ import React from 'react'
33
import { GeistSans } from 'geist/font/sans'
44
import { GeistMono } from 'geist/font/mono'
55

6-
import Header from './components/header'
7-
import Footer from './components/footer'
86
import './styles/globals.scss'
97

108
export const metadata: Metadata = {
119
title: 'PossibleGames - SCRIMP',
1210
description: 'Official Website of PossibleGames organization',
1311
}
1412

13+
function Header() {
14+
const navLinks = [
15+
{ href: 'about', label: 'About' },
16+
{ href: 'contact', label: 'Contact' },
17+
{ href: 'documentation', label: 'Documentation' },
18+
]
19+
20+
return (
21+
<header className="flex flex-row justify-between items-center p-4">
22+
<div className="text-xl font-bold">
23+
<a href="/">PossibleGames</a>
24+
</div>
25+
26+
<nav>
27+
<ul className="flex space-x-6">
28+
{navLinks.map((link) => (
29+
<li key={link.href}>
30+
<a href={link.href} className="hover:underline">
31+
{link.label}
32+
</a>
33+
</li>
34+
))}
35+
</ul>
36+
</nav>
37+
</header>
38+
)
39+
}
40+
41+
function Footer() {
42+
return (
43+
<footer className="flex flex-row justify-center p-4">
44+
<p className="text-xs font-bold">&copy; 2021 PossibleGames</p>
45+
</footer>
46+
)
47+
}
48+
1549
export default function rootLayout({
1650
children,
1751
}: Readonly<{

app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react'
22

3-
export default function Index() {
3+
export default function Page() {
44
return (
55
<>
6-
<p> / </p>
6+
<p> home </p>
77
</>
88
)
99
}

app/styles/globals.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
html, body {
1818
height: 100%;
19-
margin: 0;
2019
}
2120

2221
body {
@@ -25,10 +24,7 @@ body {
2524
font-family: Arial, Helvetica, sans-serif;
2625
display: flex;
2726
flex-direction: column;
28-
min-height: 100vh;}
29-
30-
footer {
31-
margin-top: auto;
27+
min-height: 100vh;
3228
}
3329

3430
@layer utilities {

0 commit comments

Comments
 (0)