Skip to content

Commit a2c254a

Browse files
Init project with basic styling
0 parents  commit a2c254a

22 files changed

+3832
-0
lines changed

.eslintrc.json

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"env": {
3+
"es6": true,
4+
"browser": true,
5+
"node": true,
6+
"jest": true
7+
},
8+
"parser": "@babel/eslint-parser",
9+
"parserOptions": {
10+
"ecmaVersion": 6,
11+
"sourceType": "module",
12+
"ecmaFeatures": {
13+
"jsx": true
14+
}
15+
},
16+
"ignorePatterns": "[`/*.*`]",
17+
"settings": {
18+
"react": {
19+
"version": "detect"
20+
}
21+
},
22+
"plugins": [
23+
"react"
24+
],
25+
"extends": [
26+
"wesbos/typescript"
27+
],
28+
"rules": {
29+
"indent": [
30+
"error",
31+
2,
32+
{
33+
"SwitchCase": 1
34+
}
35+
],
36+
"linebreak-style": [
37+
"off"
38+
],
39+
"quotes": [
40+
"error",
41+
"backtick",
42+
{
43+
"allowTemplateLiterals": true
44+
}
45+
],
46+
"semi": [
47+
"error",
48+
"always"
49+
],
50+
"comma-dangle": [
51+
"error",
52+
"always-multiline"
53+
],
54+
"no-console": "off",
55+
"css-modules/no-unused-class": [
56+
2,
57+
{
58+
"camelCase": true
59+
}
60+
],
61+
"css-modules/no-undef-class": [
62+
2,
63+
{
64+
"camelCase": true
65+
}
66+
],
67+
"import/no-extraneous-dependencies": [
68+
"error",
69+
{
70+
"devDependencies": true
71+
}
72+
],
73+
"react/no-unstable-nested-components": [
74+
"off",
75+
{
76+
"allowAsProps": true
77+
}
78+
]
79+
}
80+
}

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# local env files
29+
.env*.local
30+
.env
31+
32+
# vercel
33+
.vercel
34+
35+
# typescript
36+
*.tsbuildinfo
37+
next-env.d.ts

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
```
12+
13+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
14+
15+
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
16+
17+
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
18+
19+
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
20+
21+
## Learn More
22+
23+
To learn more about Next.js, take a look at the following resources:
24+
25+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
26+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
27+
28+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
29+
30+
## Deploy on Vercel
31+
32+
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.
33+
34+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

components/common/Loading.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import Main from "../layout/Main";
2+
3+
export default function Loading() {
4+
return (
5+
<Main>
6+
<div className="flex items-center justify-center">
7+
<div
8+
className="inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]"
9+
role="status"
10+
>
11+
<span className="!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]">
12+
Loading...
13+
</span>
14+
</div>
15+
</div>
16+
</Main>
17+
);
18+
}

components/layout/Footer.tsx

Lines changed: 322 additions & 0 deletions
Large diffs are not rendered by default.

components/layout/Header.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Navigation from "./Navigation";
2+
import Link from "next/link";
3+
import { useRouter } from "next/router";
4+
export default function Header() {
5+
return (
6+
<header className="flex flex-col mx-auto w-full ">
7+
<Navigation />
8+
</header>
9+
);
10+
}

components/layout/Layout.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { ReactNode } from "react";
2+
import Footer from "./Footer";
3+
import Header from "./Header";
4+
5+
type LayoutProps = {
6+
children: ReactNode;
7+
};
8+
9+
export default function Layout({ children }: LayoutProps) {
10+
return (
11+
<div className="flex flex-col min-h-screen">
12+
<Header />
13+
<main className="flex-grow w-full mx-auto">{children}</main>
14+
<Footer />
15+
</div>
16+
);
17+
}

components/layout/Main.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { ReactNode } from "react";
2+
3+
type MainProps = {
4+
children: ReactNode;
5+
};
6+
7+
export default function Main({ children }: MainProps) {
8+
return (
9+
<div className="flex flex-col max-w-7xl mx-auto px-4 py-6">{children}</div>
10+
);
11+
}

components/layout/Navigation.tsx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import Link from "next/link";
2+
import { ReactNode } from "react";
3+
import Footer from "./Footer";
4+
export default function Navigation() {
5+
return (
6+
<div className="px-4 sm:px-6 lg:px-8">
7+
<div className="flex h-16 items-center justify-between">
8+
<div className="flex-1 md:flex md:items-center md:gap-12">
9+
<Link className="block text-teal-600" href="/">
10+
<span className="sr-only">Home</span>
11+
<svg
12+
className="h-8"
13+
viewBox="0 0 28 24"
14+
fill="none"
15+
xmlns="http://www.w3.org/2000/svg"
16+
>
17+
<path
18+
d="M0.41 10.3847C1.14777 7.4194 2.85643 4.7861 5.2639 2.90424C7.6714 1.02234 10.6393 0 13.695 0C16.7507 0 19.7186 1.02234 22.1261 2.90424C24.5336 4.7861 26.2422 7.4194 26.98 10.3847H25.78C23.7557 10.3549 21.7729 10.9599 20.11 12.1147C20.014 12.1842 19.9138 12.2477 19.81 12.3047H19.67C19.5662 12.2477 19.466 12.1842 19.37 12.1147C17.6924 10.9866 15.7166 10.3841 13.695 10.3841C11.6734 10.3841 9.6976 10.9866 8.02 12.1147C7.924 12.1842 7.8238 12.2477 7.72 12.3047H7.58C7.4762 12.2477 7.376 12.1842 7.28 12.1147C5.6171 10.9599 3.6343 10.3549 1.61 10.3847H0.41ZM23.62 16.6547C24.236 16.175 24.9995 15.924 25.78 15.9447H27.39V12.7347H25.78C24.4052 12.7181 23.0619 13.146 21.95 13.9547C21.3243 14.416 20.5674 14.6649 19.79 14.6649C19.0126 14.6649 18.2557 14.416 17.63 13.9547C16.4899 13.1611 15.1341 12.7356 13.745 12.7356C12.3559 12.7356 11.0001 13.1611 9.86 13.9547C9.2343 14.416 8.4774 14.6649 7.7 14.6649C6.9226 14.6649 6.1657 14.416 5.54 13.9547C4.4144 13.1356 3.0518 12.7072 1.66 12.7347H0V15.9447H1.61C2.39051 15.924 3.154 16.175 3.77 16.6547C4.908 17.4489 6.2623 17.8747 7.65 17.8747C9.0377 17.8747 10.392 17.4489 11.53 16.6547C12.1468 16.1765 12.9097 15.9257 13.69 15.9447C14.4708 15.9223 15.2348 16.1735 15.85 16.6547C16.9901 17.4484 18.3459 17.8738 19.735 17.8738C21.1241 17.8738 22.4799 17.4484 23.62 16.6547ZM23.62 22.3947C24.236 21.915 24.9995 21.664 25.78 21.6847H27.39V18.4747H25.78C24.4052 18.4581 23.0619 18.886 21.95 19.6947C21.3243 20.156 20.5674 20.4049 19.79 20.4049C19.0126 20.4049 18.2557 20.156 17.63 19.6947C16.4899 18.9011 15.1341 18.4757 13.745 18.4757C12.3559 18.4757 11.0001 18.9011 9.86 19.6947C9.2343 20.156 8.4774 20.4049 7.7 20.4049C6.9226 20.4049 6.1657 20.156 5.54 19.6947C4.4144 18.8757 3.0518 18.4472 1.66 18.4747H0V21.6847H1.61C2.39051 21.664 3.154 21.915 3.77 22.3947C4.908 23.1889 6.2623 23.6147 7.65 23.6147C9.0377 23.6147 10.392 23.1889 11.53 22.3947C12.1468 21.9165 12.9097 21.6657 13.69 21.6847C14.4708 21.6623 15.2348 21.9135 15.85 22.3947C16.9901 23.1884 18.3459 23.6138 19.735 23.6138C21.1241 23.6138 22.4799 23.1884 23.62 22.3947Z"
19+
fill="currentColor"
20+
/>
21+
</svg>
22+
</Link>
23+
</div>
24+
25+
<div className="md:flex md:items-center md:gap-12">
26+
<nav aria-label="Global" className="hidden md:block">
27+
<ul className="flex items-center gap-6 text-sm">
28+
<li>
29+
<Link
30+
className="text-gray-500 transition hover:text-gray-500/75 dark:text-white hover:text-gray-400"
31+
href="/omnie"
32+
>
33+
O mnie
34+
</Link>
35+
</li>
36+
37+
<li>
38+
<Link
39+
className="text-gray-500 transition hover:text-gray-500/75 dark:text-white hover:text-gray-400"
40+
href="/blog"
41+
>
42+
Blog
43+
</Link>
44+
</li>
45+
46+
<li>
47+
<Link
48+
className="text-gray-500 transition hover:text-gray-500/75 dark:text-white hover:text-gray-400"
49+
href="/kontakt"
50+
>
51+
Kontakt
52+
</Link>
53+
</li>
54+
</ul>
55+
</nav>
56+
</div>
57+
</div>
58+
</div>
59+
);
60+
}

next.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
reactStrictMode: true,
4+
trailingSlash: true,
5+
compress: true,
6+
optimizeFonts: true,
7+
images: {
8+
domains: [`dynamic-media-cdn.tripadvisor.com`, `media.graphassets.com`],
9+
formats: ["image/avif", "image/webp"],
10+
},
11+
}
12+
13+
module.exports = nextConfig

package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "trener-personalny",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint"
10+
},
11+
"dependencies": {
12+
"eslint-config-wesbos": "^3.2.3",
13+
"next": "13.4.5",
14+
"react": "18.2.0",
15+
"react-dom": "18.2.0",
16+
"typescript-eslint": "^0.0.1-alpha.0"
17+
},
18+
"devDependencies": {
19+
"@types/node": "^20.3.1",
20+
"@types/react": "^18.2.12",
21+
"@types/react-dom": "^18.2.5",
22+
"autoprefixer": "^10.4.14",
23+
"eslint": "8.42.0",
24+
"eslint-config-next": "13.4.5",
25+
"postcss": "^8.4.24",
26+
"tailwindcss": "^3.3.2",
27+
"typescript": "^5.1.3"
28+
}
29+
}

pages/_app.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import "../styles/globals.css";
2+
import type { AppProps } from "next/app";
3+
import { Suspense } from "react";
4+
import Layout from "../components/layout/Layout";
5+
import Loading from "../components/common/Loading";
6+
7+
function MyApp({ Component, pageProps }: AppProps) {
8+
return (
9+
<Layout>
10+
<Suspense fallback={<Loading />}>
11+
<Component {...pageProps} />
12+
</Suspense>
13+
</Layout>
14+
);
15+
}
16+
17+
export default MyApp;

pages/_document.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Html, Head, Main, NextScript } from "next/document";
2+
3+
export default function Document() {
4+
return (
5+
<Html lang="pl">
6+
<Head />
7+
<body className="bg-gray-100 dark:bg-slate-800 flex flex-col min-h-screen dark:text-white antialiased">
8+
<Main />
9+
<NextScript />
10+
</body>
11+
</Html>
12+
);
13+
}

pages/api/hello.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2+
import type { NextApiRequest, NextApiResponse } from 'next'
3+
4+
type Data = {
5+
name: string
6+
}
7+
8+
export default function handler(
9+
req: NextApiRequest,
10+
res: NextApiResponse<Data>
11+
) {
12+
res.status(200).json({ name: 'John Doe' })
13+
}

pages/index.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { NextPage } from "next";
2+
3+
import Head from "next/head";
4+
import Image from "next/image";
5+
import Main from "../components/layout/Main";
6+
7+
const Home: NextPage = () => {
8+
return (
9+
<>
10+
<Main>Strona Główna</Main>
11+
</>
12+
);
13+
};
14+
15+
export default Home;

postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

public/favicon.ico

25.3 KB
Binary file not shown.

public/vercel.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)