From 280c266c89d3ffa2bea0516ca7bbc20ff13ca1dd Mon Sep 17 00:00:00 2001
From: goncy
Date: Fri, 5 May 2023 13:16:42 -0300
Subject: [PATCH] Use layouts
---
.eslintrc.cjs | 2 +-
package.json | 2 +
pnpm-lock.yaml | 72 +++++++
src/app/layout.tsx | 10 +-
src/app/mocks/[mock]/page.tsx | 6 +-
src/app/page.tsx | 6 +-
.../cart/components/CartDrawer/CartDrawer.tsx | 10 +-
.../cart/components/CartDrawer/Fields.tsx | 2 +-
.../cart/components/CartItemDrawer.tsx | 2 +-
src/modules/product/screens/Store.tsx | 95 ---------
src/modules/product/utils.ts | 17 --
src/modules/store/screens/Store.tsx | 185 ++++++++++++++++++
src/modules/ui/components/form/toggle.tsx | 45 +++++
src/modules/ui/components/overlay/sheet.tsx | 6 +-
14 files changed, 320 insertions(+), 140 deletions(-)
delete mode 100644 src/modules/product/screens/Store.tsx
delete mode 100644 src/modules/product/utils.ts
create mode 100644 src/modules/store/screens/Store.tsx
create mode 100644 src/modules/ui/components/form/toggle.tsx
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index d2f2b26..f7c96bc 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -10,7 +10,6 @@ module.exports = {
require.resolve("@vercel/style-guide/eslint/react"),
require.resolve("@vercel/style-guide/eslint/next"),
"plugin:prettier/recommended",
- "plugin:tailwindcss/recommended",
],
parserOptions: {
ecmaVersion: "latest",
@@ -35,6 +34,7 @@ module.exports = {
bracketSpacing: false,
arrowParens: "always",
endOfLine: "auto",
+ plugins: ["prettier-plugin-tailwindcss"],
},
],
"import/order": [
diff --git a/package.json b/package.json
index 991df3f..d39fa5d 100644
--- a/package.json
+++ b/package.json
@@ -18,6 +18,7 @@
"@radix-ui/react-label": "^2.0.1",
"@radix-ui/react-radio-group": "^1.1.2",
"@radix-ui/react-slot": "^1.0.1",
+ "@radix-ui/react-toggle": "^1.0.2",
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1",
"framer-motion": "^9.0.2",
@@ -55,6 +56,7 @@
"jest": "^29.4.2",
"postcss": "^8.4.21",
"prettier": "^2.8.4",
+ "prettier-plugin-tailwindcss": "^0.2.8",
"tailwindcss": "^3.3.2",
"ts-jest": "^29.0.5",
"ts-standard": "^12.0.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index dfda5f5..d530894 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -13,6 +13,9 @@ dependencies:
'@radix-ui/react-slot':
specifier: ^1.0.1
version: 1.0.1(react@18.2.0)
+ '@radix-ui/react-toggle':
+ specifier: ^1.0.2
+ version: 1.0.2(react-dom@18.2.0)(react@18.2.0)
class-variance-authority:
specifier: ^0.6.0
version: 0.6.0(typescript@4.9.5)
@@ -120,6 +123,9 @@ devDependencies:
prettier:
specifier: ^2.8.4
version: 2.8.4
+ prettier-plugin-tailwindcss:
+ specifier: ^0.2.8
+ version: 0.2.8(prettier@2.8.4)
tailwindcss:
specifier: ^3.3.2
version: 3.3.2
@@ -1266,6 +1272,20 @@ packages:
react: 18.2.0
dev: false
+ /@radix-ui/react-toggle@1.0.2(react-dom@18.2.0)(react@18.2.0):
+ resolution: {integrity: sha512-1MhVrHjgdmYDBgBpmOB0sjK096gFrVqUocsHNapkOTkZIxOwjpGxnW9e24CjQQX9D/c57dI6E8zAAdeAeIdY8g==}
+ peerDependencies:
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ dependencies:
+ '@babel/runtime': 7.20.13
+ '@radix-ui/primitive': 1.0.0
+ '@radix-ui/react-primitive': 1.0.2(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-use-controllable-state': 1.0.0(react@18.2.0)
+ react: 18.2.0
+ react-dom: 18.2.0(react@18.2.0)
+ dev: false
+
/@radix-ui/react-use-callback-ref@1.0.0(react@18.2.0):
resolution: {integrity: sha512-GZtyzoHz95Rhs6S63D2t/eqvdFCm7I+yHMLVQheKM7nBD8mbZIt+ct1jz4536MDnaOGKIxynJ8eHTkVGVVkoTg==}
peerDependencies:
@@ -5459,6 +5479,58 @@ packages:
synckit: 0.8.5
dev: true
+ /prettier-plugin-tailwindcss@0.2.8(prettier@2.8.4):
+ resolution: {integrity: sha512-KgPcEnJeIijlMjsA6WwYgRs5rh3/q76oInqtMXBA/EMcamrcYJpyhtRhyX1ayT9hnHlHTuO8sIifHF10WuSDKg==}
+ engines: {node: '>=12.17.0'}
+ peerDependencies:
+ '@ianvs/prettier-plugin-sort-imports': '*'
+ '@prettier/plugin-pug': '*'
+ '@shopify/prettier-plugin-liquid': '*'
+ '@shufo/prettier-plugin-blade': '*'
+ '@trivago/prettier-plugin-sort-imports': '*'
+ prettier: '>=2.2.0'
+ prettier-plugin-astro: '*'
+ prettier-plugin-css-order: '*'
+ prettier-plugin-import-sort: '*'
+ prettier-plugin-jsdoc: '*'
+ prettier-plugin-organize-attributes: '*'
+ prettier-plugin-organize-imports: '*'
+ prettier-plugin-style-order: '*'
+ prettier-plugin-svelte: '*'
+ prettier-plugin-twig-melody: '*'
+ peerDependenciesMeta:
+ '@ianvs/prettier-plugin-sort-imports':
+ optional: true
+ '@prettier/plugin-pug':
+ optional: true
+ '@shopify/prettier-plugin-liquid':
+ optional: true
+ '@shufo/prettier-plugin-blade':
+ optional: true
+ '@trivago/prettier-plugin-sort-imports':
+ optional: true
+ prettier-plugin-astro:
+ optional: true
+ prettier-plugin-css-order:
+ optional: true
+ prettier-plugin-import-sort:
+ optional: true
+ prettier-plugin-jsdoc:
+ optional: true
+ prettier-plugin-organize-attributes:
+ optional: true
+ prettier-plugin-organize-imports:
+ optional: true
+ prettier-plugin-style-order:
+ optional: true
+ prettier-plugin-svelte:
+ optional: true
+ prettier-plugin-twig-melody:
+ optional: true
+ dependencies:
+ prettier: 2.8.4
+ dev: true
+
/prettier@2.8.4:
resolution: {integrity: sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==}
engines: {node: '>=10.13.0'}
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 1db733c..cb5c460 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -23,7 +23,7 @@ const App = async ({children}: {children: React.ReactNode}) => {
-