Skip to content

Commit

Permalink
Merge pull request #52 from Qfeed-Dev/hotfix
Browse files Browse the repository at this point in the history
[Feat] 쿼리키 관리
  • Loading branch information
hamo-o authored Sep 3, 2023
2 parents 34a3456 + 7a1ebfb commit 72261e8
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/Title/BackTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const BackTitle = forwardRef(function Div(
</div>
)}
<Menu>
<Report type={props.reportType} />
{/* <Report type={props.reportType} /> */}
</Menu>
</>
) : null}
Expand Down
4 changes: 4 additions & 0 deletions src/constants/queryKeys/questionKeys.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Qtype } from "src/models/questions";

export const questionKeys = {
all: ["question"] as const,
qtype: (id: number, qtype: Qtype) =>
[...questionKeys.all, id, qtype] as const,
detail: (id: number) => [...questionKeys.all, id] as const
};

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/questions/useGetUserQQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const useGetUserQQuery = (id: number, qtype: Qtype) => {
isLoading,
refetch
} = useQuery<any>(
questionKeys.detail(id),
questionKeys.qtype(id, qtype),
() => getUserQuestions(id, qtype),
{
onError: (error: any) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages-edit/friend/Friend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { enterComponentVariants } from "src/constants/animation";

export default function Mypage() {
const router = useRouter();
const search = useInput();
const search = useInput("");
const searchResult = useUsersQuery(search.value);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages-edit/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function Home() {
<MakeOfficial onClick={handleClickBasicQuestion} />
<Spacing size={20} />

<Filter isSort={isSort} setIsSort={setIsSort} />
{/* <Filter isSort={isSort} setIsSort={setIsSort} /> */}
<Spacing size={14} />
{isLoading ? <></> : data && <QuestionGrid {...data} />}
{isLoading ? (
Expand Down
7 changes: 4 additions & 3 deletions src/pages-edit/home/components/MakeOfficial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ const MakeOfficial = (props: QuestionProps) => {

const getTime = () => {
const date = new Date();
if (!isNaN(endTime) && +date > endTime + 24 * 60 * 60 * 1000) {
const times = new Date(endTime + 24 * 60 * 60 * 1000 - +date);

if (+times <= 0) {
newQSet.mutate();
}

const times = new Date(endTime + 24 * 60 * 60 * 1000 - +date);
const hours = String(times.getHours()).padStart(2, "0");
const minutes = String(times.getMinutes()).padStart(2, "0");
const seconds = String(times.getSeconds()).padStart(2, "0");
Expand Down Expand Up @@ -70,7 +71,7 @@ const MakeOfficial = (props: QuestionProps) => {
<Text typo="Headline2b" color="light_qblack">
{time
? `${time.hour}:${time.min}:${time.sec}`
: ""}
: "00:00:00"}
</Text>
{/* <BottomButton>
<Text
Expand Down
2 changes: 0 additions & 2 deletions src/pages-edit/mypage/components/ButtonQfeedSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ const SelectWrapper = styled(Flex)`
max-width: 600px;
padding: 0 1rem;
border-bottom: 1px solid ${colors.light_qwhite};
position: relative;
`;

const ButtonWrapper = styled.div`
Expand Down

0 comments on commit 72261e8

Please sign in to comment.