Skip to content

Commit

Permalink
Merge pull request #56 from Qfeed-Dev/feature/#35
Browse files Browse the repository at this point in the history
[Feat] 패키지 수정 및 각종 chore
  • Loading branch information
hamo-o authored Sep 3, 2023
2 parents df7131d + 60992b7 commit 74ec743
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 154 deletions.
150 changes: 2 additions & 148 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions src/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
"use client";
import { useEffect } from "react";
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();
}
};

useEffect(() => {
window.addEventListener("touchmove", preventZoom, { passive: false });
}, []);

return (
<LayoutWrapper>
<LayoutContent>{children}</LayoutContent>
Expand Down
3 changes: 2 additions & 1 deletion src/constants/queryKeys/accountKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
12 changes: 8 additions & 4 deletions src/hooks/account/useUsersQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ const useUsersQuery = (filter: string) => {
data: users,
isLoading,
refetch
} = useQuery<any>(usersKeys.all, () => accountAPI.getUsers(filter), {
onError: (error: any) => {
alert(error);
} = useQuery<any>(
usersKeys.filter(filter),
() => accountAPI.getUsers(filter),
{
onError: (error: any) => {
alert(error);
}
}
});
);

return { users, isLoading, refetch };
};
Expand Down

0 comments on commit 74ec743

Please sign in to comment.