From 4c55509434558c334bf366d0b20854b88acf1feb Mon Sep 17 00:00:00 2001 From: hamo-o Date: Sun, 3 Sep 2023 14:09:10 +0900 Subject: [PATCH 1/6] =?UTF-8?q?chore:=20react-stack-grid=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 150 +--------------------------------------------- package.json | 1 - 2 files changed, 2 insertions(+), 149 deletions(-) diff --git a/package-lock.json b/package-lock.json index f879d50..aabac2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,6 @@ "react-cookie": "^6.1.0", "react-dom": "18.2.0", "react-intersection-observer": "^9.5.2", - "react-stack-grid": "^0.7.1", "styled-components": "^6.0.7", "swc": "^1.0.11", "tailwindcss": "3.3.3", @@ -10312,11 +10311,6 @@ } ] }, - "node_modules/batch-processor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/batch-processor/-/batch-processor-1.0.0.tgz", - "integrity": "sha512-xoLQD8gmmR32MeuBHgH0Tzd5PuSZx71ZsbhVxOCRbgktZEPe4SQy7s9Z50uPp0F/f7iw2XmkHN2xkgbMfckMDA==" - }, "node_modules/better-opn": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/better-opn/-/better-opn-3.0.2.tgz", @@ -10741,11 +10735,6 @@ "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", "dev": true }, - "node_modules/bowser": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-1.9.4.tgz", - "integrity": "sha512-9IdMmj2KjigRq6oWhmwv1W36pDuA4STQZ8q6YO9um+x07xgYNCD3Oou+WP/3L1HNz7iqythGet3/p4wvc8AAwQ==" - }, "node_modules/bplist-parser": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", @@ -11149,11 +11138,6 @@ "node": ">=4" } }, - "node_modules/chain-function": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/chain-function/-/chain-function-1.0.1.tgz", - "integrity": "sha512-SxltgMwL9uCko5/ZCLiyG2B7R9fY4pDZUw7hJ4MhirdjBLosoDqkWABi3XMucddHdLiFJMb7PD2MZifZriuMTg==" - }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -11768,15 +11752,6 @@ "node": ">=4" } }, - "node_modules/css-in-js-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/css-in-js-utils/-/css-in-js-utils-2.0.1.tgz", - "integrity": "sha512-PJF0SpJT+WdbVVt0AOYp9C8GnuruRlL/UFW7932nLWmFLQTaWEzTBQEx7/hn4BuV+WON75iAViSUJLiU3PKbpA==", - "dependencies": { - "hyphenate-style-name": "^1.0.2", - "isobject": "^3.0.1" - } - }, "node_modules/css-loader": { "version": "6.8.1", "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.8.1.tgz", @@ -12297,14 +12272,6 @@ "utila": "~0.4" } }, - "node_modules/dom-helpers": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.4.0.tgz", - "integrity": "sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA==", - "dependencies": { - "@babel/runtime": "^7.1.2" - } - }, "node_modules/dom-serializer": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", @@ -12457,14 +12424,6 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, - "node_modules/easy-css-transform-builder": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/easy-css-transform-builder/-/easy-css-transform-builder-0.0.2.tgz", - "integrity": "sha512-YNwjrdA2RWcF01FkpMtgHrDCicP/oVBEGcILw8dX7wx4q8+KH8A0Lth2Csc7s09DpUVuqcyKIjMXSzZBAT9P7Q==", - "dependencies": { - "invariant": "^2.2.2" - } - }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -12491,14 +12450,6 @@ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.508.tgz", "integrity": "sha512-FFa8QKjQK/A5QuFr2167myhMesGrhlOBD+3cYNxO9/S4XzHEXesyTD/1/xF644gC8buFPz3ca6G1LOQD0tZrrg==" }, - "node_modules/element-resize-detector": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/element-resize-detector/-/element-resize-detector-1.2.4.tgz", - "integrity": "sha512-Fl5Ftk6WwXE0wqCgNoseKWndjzZlDCwuPTcoVZfCP9R3EHQF8qUtr3YUPNETegRBOKqQKPW3n4kiIWngGi8tKg==", - "dependencies": { - "batch-processor": "1.0.0" - } - }, "node_modules/elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", @@ -13367,11 +13318,6 @@ "node": ">= 0.6" } }, - "node_modules/ev-emitter": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ev-emitter/-/ev-emitter-1.1.1.tgz", - "integrity": "sha512-ipiDYhdQSCZ4hSbX4rMW+XzNKMD1prg/sTvoVmSLkuQ1MVlwjJQQA+sW8tMYR3BLUr9KjodFV4pvzunvRhd33Q==" - }, "node_modules/event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", @@ -13433,11 +13379,6 @@ "node": ">=4" } }, - "node_modules/exenv": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz", - "integrity": "sha512-Z+ktTxTwv9ILfgKCk32OX3n/doe+OcLTRtqK9pcL+JsP3J1/VW8Uvl4ZjLlKqeW4rzK4oesDOGMEMRIZqtP4Iw==" - }, "node_modules/express": { "version": "4.18.2", "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", @@ -14870,11 +14811,6 @@ "node": ">=14.18.0" } }, - "node_modules/hyphenate-style-name": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz", - "integrity": "sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==" - }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -14941,14 +14877,6 @@ "node": ">=14.0.0" } }, - "node_modules/imagesloaded": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/imagesloaded/-/imagesloaded-4.1.4.tgz", - "integrity": "sha512-ltiBVcYpc/TYTF5nolkMNsnREHW+ICvfQ3Yla2Sgr71YFwQ86bDwV9hgpFhFtrGPuwEx5+LqOHIrdXBdoWwwsA==", - "dependencies": { - "ev-emitter": "^1.0.0" - } - }, "node_modules/immer": { "version": "9.0.21", "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.21.tgz", @@ -15004,15 +14932,6 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "node_modules/inline-style-prefixer": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-3.0.8.tgz", - "integrity": "sha512-ne8XIyyqkRaNJ1JfL1NYzNdCNxq+MCBQhC8NgOQlzNm2vv3XxlP0VSLQUbSRCF6KPEoveCVEpayHoHzcMyZsMQ==", - "dependencies": { - "bowser": "^1.7.3", - "css-in-js-utils": "^2.0.0" - } - }, "node_modules/internal-slot": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", @@ -15030,6 +14949,7 @@ "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, "dependencies": { "loose-envify": "^1.0.0" } @@ -15540,6 +15460,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -18390,57 +18311,6 @@ } } }, - "node_modules/react-stack-grid": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/react-stack-grid/-/react-stack-grid-0.7.1.tgz", - "integrity": "sha512-Fw7qMt5Rd9wQpNCnvK4Gi+ry/nL5rKfzP2hGsw5/DZxArEMk60VoDLy68Uskq09l6wk7qb2w7P2+lNzSd9mYEw==", - "dependencies": { - "easy-css-transform-builder": "^0.0.2", - "exenv": "^1.2.1", - "imagesloaded": "^4.1.1", - "inline-style-prefixer": "^3.0.6", - "invariant": "^2.2.2", - "prop-types": "^15.5.10", - "react-sizeme": "^2.2.0", - "react-transition-group": "^1.2.0", - "shallowequal": "^1.0.1" - }, - "peerDependencies": { - "react": ">=15.3.0", - "react-dom": ">=15.3.0" - } - }, - "node_modules/react-stack-grid/node_modules/react-sizeme": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/react-sizeme/-/react-sizeme-2.6.12.tgz", - "integrity": "sha512-tL4sCgfmvapYRZ1FO2VmBmjPVzzqgHA7kI8lSJ6JS6L78jXFNRdOZFpXyK6P1NBZvKPPCZxReNgzZNUajAerZw==", - "dependencies": { - "element-resize-detector": "^1.2.1", - "invariant": "^2.2.4", - "shallowequal": "^1.1.0", - "throttle-debounce": "^2.1.0" - }, - "peerDependencies": { - "react": "^0.14.0 || ^15.0.0-0 || ^16.0.0", - "react-dom": "^0.14.0 || ^15.0.0-0 || ^16.0.0" - } - }, - "node_modules/react-stack-grid/node_modules/react-transition-group": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-1.2.1.tgz", - "integrity": "sha512-CWaL3laCmgAFdxdKbhhps+c0HRGF4c+hdM4H23+FI1QBNUyx/AMeIJGWorehPNSaKnQNOAxL7PQmqMu78CDj3Q==", - "dependencies": { - "chain-function": "^1.0.0", - "dom-helpers": "^3.2.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.5.6", - "warning": "^3.0.0" - }, - "peerDependencies": { - "react": "^15.0.0 || ^16.0.0", - "react-dom": "^15.0.0 || ^16.0.0" - } - }, "node_modules/react-style-singleton": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.1.tgz", @@ -20481,14 +20351,6 @@ "node": ">=0.8" } }, - "node_modules/throttle-debounce": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-2.3.0.tgz", - "integrity": "sha512-H7oLPV0P7+jgvrk+6mwwwBDmxTaxnu9HMXmloNLXwnNO0ZxZ31Orah2n8lU1eMPvsaowP2CX+USCgyovXfdOFQ==", - "engines": { - "node": ">=8" - } - }, "node_modules/through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", @@ -21216,14 +21078,6 @@ "makeerror": "1.0.12" } }, - "node_modules/warning": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", - "integrity": "sha512-jMBt6pUrKn5I+OGgtQ4YZLdhIeJmObddh6CsibPxyQ5yPZm1XExSyzC1LCNX7BzhxWgiHmizBWJTHJIjMjTQYQ==", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, "node_modules/watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", diff --git a/package.json b/package.json index 9b12a3a..d76c93a 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "react-cookie": "^6.1.0", "react-dom": "18.2.0", "react-intersection-observer": "^9.5.2", - "react-stack-grid": "^0.7.1", "styled-components": "^6.0.7", "swc": "^1.0.11", "tailwindcss": "3.3.3", From 463c36ab5cac27455d6584069e7bb1de0cbd3e56 Mon Sep 17 00:00:00 2001 From: hamo-o Date: Sun, 3 Sep 2023 14:16:58 +0900 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20ios=20zoom=20=EB=A7=89=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/App.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/App.tsx b/src/app/App.tsx index 7bfbe50..92983c9 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -7,6 +7,13 @@ import BottomSheet from "src/components/BottomSheet"; export default function App({ children }: { children: React.ReactNode }) { const { visible } = useAppSelector((state) => state.bottomSheet); + const preventZoom = (event: TouchEvent) => { + if (event.touches.length > 1) { + event.preventDefault(); + } + }; + document.addEventListener("touchmove", preventZoom, { passive: false }); + return ( <> From c09c1aff20a1c7cc121aa8469aef58be57da8087 Mon Sep 17 00:00:00 2001 From: hamo-o Date: Sun, 3 Sep 2023 14:17:12 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=EC=B9=9C=EA=B5=AC=20filter=20query?= =?UTF-8?q?Key=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/queryKeys/accountKeys.ts | 3 ++- src/hooks/account/useUsersQuery.ts | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/constants/queryKeys/accountKeys.ts b/src/constants/queryKeys/accountKeys.ts index 3ed870f..1d59178 100644 --- a/src/constants/queryKeys/accountKeys.ts +++ b/src/constants/queryKeys/accountKeys.ts @@ -7,7 +7,8 @@ export const userKeys = { }; export const usersKeys = { - all: ["users"] as const + all: ["users"] as const, + filter: (filter: string) => [...usersKeys.all, filter] as const }; export const friendKeys = { diff --git a/src/hooks/account/useUsersQuery.ts b/src/hooks/account/useUsersQuery.ts index b310039..1b87377 100644 --- a/src/hooks/account/useUsersQuery.ts +++ b/src/hooks/account/useUsersQuery.ts @@ -8,11 +8,15 @@ const useUsersQuery = (filter: string) => { data: users, isLoading, refetch - } = useQuery(usersKeys.all, () => accountAPI.getUsers(filter), { - onError: (error: any) => { - alert(error); + } = useQuery( + usersKeys.filter(filter), + () => accountAPI.getUsers(filter), + { + onError: (error: any) => { + alert(error); + } } - }); + ); return { users, isLoading, refetch }; }; From 96a7e898f1d51b359a5463cfb9dc2eabef0ba102 Mon Sep 17 00:00:00 2001 From: hamo-o Date: Sun, 3 Sep 2023 14:22:48 +0900 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20prevent=20zoom=20=EA=B4=80=EB=A0=A8?= =?UTF-8?q?=20error=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/App.tsx | 7 ------- src/components/layout/Layout.tsx | 8 +++++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/app/App.tsx b/src/app/App.tsx index 92983c9..7bfbe50 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -7,13 +7,6 @@ import BottomSheet from "src/components/BottomSheet"; export default function App({ children }: { children: React.ReactNode }) { const { visible } = useAppSelector((state) => state.bottomSheet); - const preventZoom = (event: TouchEvent) => { - if (event.touches.length > 1) { - event.preventDefault(); - } - }; - document.addEventListener("touchmove", preventZoom, { passive: false }); - return ( <> diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index da9cbd8..333c336 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -3,8 +3,14 @@ import styled from "styled-components"; import { colors, media } from "styles/theme"; const Layout = ({ children }: { children: React.ReactNode }) => { + const preventZoom = (event: any) => { + if (event.touches.length > 1) { + event.preventDefault(); + } + }; + return ( - + {children} ); From c323f2393ed8b2dc7df9aed9974e9aac82b847b3 Mon Sep 17 00:00:00 2001 From: hamo-o Date: Sun, 3 Sep 2023 14:31:36 +0900 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20prevent=20zoom=20window=EC=97=90=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/Layout.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index 333c336..a933a0e 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -9,8 +9,10 @@ const Layout = ({ children }: { children: React.ReactNode }) => { } }; + window.addEventListener("touchmove", preventZoom, { passive: false }); + return ( - + {children} ); From 60992b72b9c5645ad19975e933c18e5e81a10efd Mon Sep 17 00:00:00 2001 From: hamo-o Date: Sun, 3 Sep 2023 14:36:27 +0900 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20window=20is=20not=20defined=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/Layout.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index a933a0e..8874cab 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -1,4 +1,5 @@ "use client"; +import { useEffect } from "react"; import styled from "styled-components"; import { colors, media } from "styles/theme"; @@ -9,7 +10,9 @@ const Layout = ({ children }: { children: React.ReactNode }) => { } }; - window.addEventListener("touchmove", preventZoom, { passive: false }); + useEffect(() => { + window.addEventListener("touchmove", preventZoom, { passive: false }); + }, []); return (