Skip to content

Commit 90c273b

Browse files
committed
feat: add page layout
1 parent a9077a9 commit 90c273b

14 files changed

+99
-103
lines changed

next-sitemap.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { siteUrl } from '@/config/site';
2+
13
/**
24
* @type {import('next-sitemap').IConfig}
35
* @see https://github.com/iamvishnusankar/next-sitemap#readme
46
*/
57
module.exports = {
6-
siteUrl: 'https://offerexchange.net',
8+
siteUrl,
79
generateRobotsTxt: true,
810
robotsTxtOptions: {
911
policies: [{ userAgent: '*', allow: '/' }],

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"prepare": "husky install"
2121
},
2222
"dependencies": {
23+
"body-scroll-lock": "4.0.0-beta.0",
2324
"clsx": "1.1.1",
2425
"next": "12.1.6",
2526
"react": "18.1.0",
@@ -35,9 +36,9 @@
3536
"@tailwindcss/forms": "0.5.2",
3637
"@testing-library/jest-dom": "5.16.4",
3738
"@testing-library/react": "13.3.0",
39+
"@types/body-scroll-lock": "^3.1.0",
3840
"@types/jest": "28.1.1",
3941
"@types/react": "18.0.12",
40-
"@types/tailwindcss": "3.0.10",
4142
"@typescript-eslint/eslint-plugin": "5.27.1",
4243
"@typescript-eslint/parser": "5.27.1",
4344
"autoprefixer": "10.4.7",
@@ -52,6 +53,8 @@
5253
"lint-staged": "13.0.1",
5354
"next-sitemap": "3.0.5",
5455
"postcss": "8.4.14",
56+
"postcss-100vh-fix": "^1.0.2",
57+
"postcss-flexbugs-fixes": "^5.0.2",
5558
"prettier": "2.6.2",
5659
"prettier-plugin-tailwindcss": "0.1.11",
5760
"standard-version": "9.5.0",

pnpm-lock.yaml

+33-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

postcss.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ module.exports = {
22
plugins: {
33
tailwindcss: {},
44
autoprefixer: {},
5+
'postcss-flexbugs-fixes': {},
6+
'postcss-100vh-fix': {},
57
},
68
};

public/images/new-tab.png

-565 Bytes
Binary file not shown.

public/svg/Vercel.svg

-1
This file was deleted.

public/svg/logo.svg

+4
Loading

src/components/layout/Layout.tsx

-6
This file was deleted.

src/components/layout/Page.tsx

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as React from 'react';
2+
3+
interface PageProps {
4+
children: React.ReactNode;
5+
}
6+
7+
export default function Page({ children }: PageProps) {
8+
return (
9+
<>
10+
<div className='h-auto lg:h-screen flex flex-row'>
11+
{/* No fallback UI so need to be careful not to suspend directly inside. */}
12+
<React.Suspense fallback={null}>
13+
<div className='flex flex-1 w-full h-full self-stretch'>
14+
<main className='flex grow self-stretch mt-16 sm:mt-10 flex-col justify-around'>
15+
{children}
16+
</main>
17+
</div>
18+
</React.Suspense>
19+
</div>
20+
</>
21+
);
22+
}

src/pages/404.tsx

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
11
import * as React from 'react';
22
import { RiAlarmWarningFill } from 'react-icons/ri';
33

4-
import Layout from '@/components/layout/Layout';
4+
import Page from '@/components/layout/Page';
55
import ArrowLink from '@/components/links/ArrowLink';
66
import Seo from '@/components/Seo';
77

88
export default function NotFoundPage() {
99
return (
10-
<Layout>
10+
<Page>
1111
<Seo templateTitle='Not Found' />
1212

1313
<main>
1414
<section className='bg-white'>
15-
<div className='layout flex min-h-screen flex-col items-center justify-center text-center text-black'>
15+
<div className='layout flex self-stretch flex-col items-center justify-center text-center text-black'>
1616
<RiAlarmWarningFill
1717
size={60}
1818
className='drop-shadow-glow animate-flicker text-red-500'
1919
/>
20-
<h1 className='mt-8 text-4xl md:text-6xl'>Page Not Found</h1>
21-
<ArrowLink className='mt-4 md:text-lg' href='/'>
22-
Back to Home
20+
<h1 className='mt-8 text-4xl md:text-6xl md:leading-tight'>
21+
Ups! Wygląda na to,
22+
<br />
23+
że ta strona nie istnieje
24+
</h1>
25+
<ArrowLink className='mt-6 md:text-lg' href='/'>
26+
Wróć na stronę główną
2327
</ArrowLink>
2428
</div>
2529
</section>
2630
</main>
27-
</Layout>
31+
</Page>
2832
);
2933
}

src/pages/components.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import clsx from 'clsx';
22
import * as React from 'react';
33

44
import Button from '@/components/buttons/Button';
5-
import Layout from '@/components/layout/Layout';
5+
import Page from '@/components/layout/Page';
66
import ArrowLink from '@/components/links/ArrowLink';
77
import ButtonLink from '@/components/links/ButtonLink';
88
import PrimaryLink from '@/components/links/PrimaryLink';
@@ -24,7 +24,7 @@ export default function ComponentsPage() {
2424
const textColor = mode === 'dark' ? 'text-gray-300' : 'text-gray-600';
2525

2626
return (
27-
<Layout>
27+
<Page>
2828
<Seo
2929
templateTitle='Components'
3030
description='Pre-built components with awesome default'
@@ -307,7 +307,7 @@ export default function ComponentsPage() {
307307
</div>
308308
</section>
309309
</main>
310-
</Layout>
310+
</Page>
311311
);
312312
}
313313

src/pages/index.tsx

+6-46
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,16 @@
11
import * as React from 'react';
22

3-
import Layout from '@/components/layout/Layout';
4-
import ArrowLink from '@/components/links/ArrowLink';
5-
import ButtonLink from '@/components/links/ButtonLink';
6-
import UnderlineLink from '@/components/links/UnderlineLink';
3+
import Page from '@/components/layout/Page';
74
import Seo from '@/components/Seo';
85

9-
/**
10-
* SVGR Support
11-
* Caveat: No React Props Type.
12-
*
13-
* You can override the next-env if the type is important to you
14-
* @see https://stackoverflow.com/questions/68103844/how-to-override-next-js-svg-module-declaration
15-
*/
16-
import Vercel from '~/svg/Vercel.svg';
17-
186
export default function HomePage() {
197
return (
20-
<Layout>
21-
{/* <Seo templateTitle='Home' /> */}
8+
<Page>
229
<Seo />
2310

24-
<main>
25-
<section className='bg-white'>
26-
<div className='layout flex min-h-screen flex-col items-center justify-center text-center'>
27-
<Vercel className='text-5xl' />
28-
<h1 className='mt-4'>
29-
Next.js + Tailwind CSS + TypeScript Starter
30-
</h1>
31-
<p className='mt-2 text-sm text-gray-800'>
32-
A starter for Next.js, Tailwind CSS, and TypeScript with Absolute
33-
Import, Seo, Link component, pre-configured with Husky{' '}
34-
</p>
35-
<p className='mt-2 text-sm text-gray-700'>
36-
<ArrowLink href='https://github.com/theodorusclarence/ts-nextjs-tailwind-starter'>
37-
See the repository
38-
</ArrowLink>
39-
</p>
40-
41-
<ButtonLink className='mt-6' href='/components' variant='light'>
42-
See all components
43-
</ButtonLink>
44-
45-
<footer className='absolute bottom-2 text-gray-700'>
46-
© {new Date().getFullYear()} By{' '}
47-
<UnderlineLink href='https://conetso.com'>
48-
CONETSO Sp. z o. o.
49-
</UnderlineLink>
50-
</footer>
51-
</div>
52-
</section>
53-
</main>
54-
</Layout>
11+
<section className='container self-center'>
12+
<div className='flex grow'>Strona główna</div>
13+
</section>
14+
</Page>
5515
);
5616
}

src/styles/globals.css

+7-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
@tailwind utilities;
44

55
:root {
6-
/* #region /**=========== Primary Color =========== */
6+
/* #region /**=========== Colors =========== */
7+
--color-primary: 17 20 45; /* #11142d */
8+
--color-secondary: 108 93 211; /* #6C5DD3 */
79
--tw-color-primary-50: 245 243 255;
810
--tw-color-primary-100: 237 233 254;
911
--tw-color-primary-200: 221 214 254;
@@ -24,7 +26,7 @@
2426
--color-primary-700: rgb(var(--tw-color-primary-700)); /* #6d28d9 */
2527
--color-primary-800: rgb(var(--tw-color-primary-800)); /* #5b21b6 */
2628
--color-primary-900: rgb(var(--tw-color-primary-900)); /* #4c1d95 */
27-
/* #endregion /**======== Primary Color =========== */
29+
/* #endregion /**======== Colors =========== */
2830
}
2931

3032
@layer base {
@@ -40,10 +42,6 @@
4042
U+2215, U+FEFF, U+FFFD;
4143
}
4244

43-
.cursor-newtab {
44-
cursor: url('/images/new-tab.png') 10 10, pointer;
45-
}
46-
4745
/* #region /**=========== Typography =========== */
4846
.h0 {
4947
@apply font-primary text-3xl font-bold md:text-5xl;
@@ -75,7 +73,7 @@
7573
}
7674
/* #endregion /**======== Typography =========== */
7775

78-
.layout {
76+
.container {
7977
/* 1100px */
8078
max-width: 68.75rem;
8179
@apply mx-auto w-11/12;
@@ -96,8 +94,8 @@
9694
background-image: linear-gradient(#33333300, #33333300),
9795
linear-gradient(
9896
to right,
99-
var(--color-primary-400),
100-
var(--color-primary-500)
97+
rgb(var(--color-secondary)),
98+
rgb(var(--color-secondary))
10199
);
102100
background-size: 100% 2px, 0 2px;
103101
background-position: 100% 100%, 0 100%;

0 commit comments

Comments
 (0)