Skip to content

Commit ab3c4b0

Browse files
committed
chore: add storefront example
1 parent dee6094 commit ab3c4b0

File tree

11 files changed

+199
-6
lines changed

11 files changed

+199
-6
lines changed

apps/storefront/.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['tih'],
4+
parserOptions: {
5+
tsconfigRootDir: __dirname,
6+
project: ['./tsconfig.json'],
7+
},
8+
};

apps/storefront/next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

apps/storefront/next.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
reactStrictMode: true,
3+
};

apps/storefront/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "storefront",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"build": "next build",
7+
"clean": "rm -rf .next",
8+
"dev": "next dev -p 3002",
9+
"lint": "TIMING=1 next lint",
10+
"start": "next start "
11+
},
12+
"dependencies": {
13+
"next": "^12.3.0",
14+
"react": "^18.2.0",
15+
"react-dom": "^18.2.0",
16+
"@tih/ui": "*"
17+
},
18+
"devDependencies": {
19+
"@types/jest": "^26.0.22",
20+
"@types/node": "^17.0.12",
21+
"@types/react": "^17.0.13",
22+
"@types/react-dom": "^17.0.8",
23+
"eslint-config-custom": "*",
24+
"@tih/tsconfig": "*",
25+
"typescript": "^4.8.3"
26+
}
27+
}

apps/storefront/public/favicon.ico

14.7 KB
Binary file not shown.

apps/storefront/src/pages/_app.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type { AppProps } from "next/app";
2+
import "../styles.css";
3+
4+
export default function MyApp({ Component, pageProps }: AppProps) {
5+
return <Component {...pageProps} />;
6+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import Head from 'next/head';
2+
import { CounterButton, NewTabLink } from '@tih/ui';
3+
4+
export default function Store() {
5+
return (
6+
<div className="container">
7+
<Head>
8+
<title>Store | Kitchen Sink</title>
9+
</Head>
10+
<h1 className="title">
11+
Store <br />
12+
<span>Kitchen Sink</span>
13+
</h1>
14+
<CounterButton />
15+
<p className="description">
16+
Built With{' '}
17+
<NewTabLink href="https://turborepo.org/">Turborepo</NewTabLink> +{' '}
18+
<NewTabLink href="https://nextjs.org/">Next.js</NewTabLink>
19+
</p>
20+
</div>
21+
);
22+
}

apps/storefront/src/styles.css

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
html {
2+
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
3+
-webkit-text-size-adjust: 100%;
4+
-webkit-font-smoothing: antialiased;
5+
-moz-osx-font-smoothing: grayscale;
6+
-webkit-tap-highlight-color: transparent;
7+
line-height: 1.5;
8+
tab-size: 4;
9+
}
10+
11+
body {
12+
margin: 0;
13+
}
14+
15+
.container {
16+
min-height: 100vh;
17+
display: flex;
18+
flex-direction: column;
19+
align-items: center;
20+
justify-content: center;
21+
gap: 1.5rem;
22+
max-width: 100%;
23+
margin: 0 auto;
24+
padding: 0 16px;
25+
text-align: center;
26+
}
27+
28+
.title {
29+
font-size: 3rem;
30+
font-weight: 700;
31+
margin: 0;
32+
}
33+
34+
.title span {
35+
display: inline-block;
36+
background-image: linear-gradient(to right, #3b82f6, #ef4444);
37+
-webkit-background-clip: text;
38+
background-clip: text;
39+
color: transparent;
40+
}
41+
42+
.description {
43+
color: #9ca3af;
44+
font-weight: 500;
45+
}
46+
47+
.description a {
48+
color: #3b82f6;
49+
text-decoration: none;
50+
}
51+
52+
.description a:hover {
53+
text-decoration: underline;
54+
}

apps/storefront/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"exclude": ["node_modules"],
3+
"extends": "@tih/tsconfig/nextjs.json",
4+
"compilerOptions": {
5+
"rootDir": "src",
6+
"outDir": "dist"
7+
},
8+
"include": ["src", "next-env.d.ts"]
9+
}

packages/ui/src/CounterButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function CounterButton() {
1111
padding: '1.5rem',
1212
}}>
1313
<p style={{ margin: '0 0 1.5rem 0' }}>
14-
This component is from{' '}
14+
This componentzz is from{' '}
1515
<code
1616
style={{
1717
background: `rgba(0,0,0,0.1)`,

0 commit comments

Comments
 (0)