Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
276 changes: 138 additions & 138 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"axios": "^0.24.0",
"framer-motion": "^4.1.17",
"mongodb": "^3.7.3",
"next": "^12.0.3",
"next": "^12.0.7",
"next-images": "^1.8.2",
"package": "^1.0.1",
"react": "17.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-hook-form": "^7.19.5",
"react-icons": "^4.3.1",
Expand Down
2 changes: 1 addition & 1 deletion pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MyDocument extends Document {
<Head />
<script
type="text/javascript"
src="//dapi.kakao.com/v2/maps/sdk.js?appkey=701308a3e8b821d1b64da85d9c5380fe&libraries=services"
src="//dapi.kakao.com/v2/maps/sdk.js?appkey=fe85b15004e2d9af95757d74647d37fc&libraries=services"
></script>
<body>
<Main />
Expand Down
13 changes: 6 additions & 7 deletions src/components/Card.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Box, Text, Flex, Spacer, Image, useDisclosure } from "@chakra-ui/react";
import React, { useState, useEffect } from "react";
import { Box, Text, Image, useDisclosure } from "@chakra-ui/react";
import React from "react";
import DetailedShop from "./DetailedShop";
import noimage from "../../public/img/noimage.jpg"

export default function Card({ value }) {
// console.log(value);
const { isOpen, onOpen, onClose } = useDisclosure()
const tmp = value.name;
const tmp_t = tmp.split(" (");
Expand All @@ -24,8 +23,8 @@ export default function Card({ value }) {
onClick={onOpen}
>
<DetailedShop onOpen={onOpen} isOpen={isOpen} onClose={onClose} value={value}/>
{ `img_res/${value.name}/1.png` ? (
<Image src={`img_res/${value.name}/1.png`} objectFit="fill" maxW="15vw" maxH="13vw" w="15vw" h="13vw" />
{ `../../public/img_res/${value.name}/1.png` ? (
<Image src={`../../public/img_res/${value.name}/1.png`} objectFit="fill" maxW="15vw" maxH="13vw" w="15vw" h="13vw" />
):(<Image src={noimage.src} objectFit="fill" maxW="15vw" maxH="13vw" w="15vw" h="13vw" />)
}
<Box m={2} textAlign="left">
Expand Down Expand Up @@ -53,8 +52,8 @@ export default function Card({ value }) {
onClick={onOpen}
>
<DetailedShop onOpen={onOpen} isOpen={isOpen} onClose={onClose} value={value}/>
{ `img_res/` + tmp_t[0] + `/1.png` ? (
<Image src={`img_res/` + tmp_t[0] + `/1.png`} objectFit="fill" maxW="15vw" maxH="13vw" w="15vw" h="13vw" />
{ `../../public/img_res/` + tmp_t[0] + `/1.png` ? (
<Image src={`../../public/img_res/` + tmp_t[0] + `/1.png`} objectFit="fill" maxW="15vw" maxH="13vw" w="15vw" h="13vw" />
):(<Image src={noimage.src} objectFit="fill" maxW="15vw" maxH="13vw" w="15vw" h="13vw" />)
}

Expand Down
17 changes: 13 additions & 4 deletions src/components/SearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useRouter } from "next/router";
import { useRecoilValue, useRecoilState, useSetRecoilState } from "recoil";

import Filter from "./filter/Filter";
import { queryState, inputState, pageState} from "../states";
import { queryState, inputState, pageState, filterState} from "../states";

export default function SearchForm({ width, marginTop, inputVariant }) {
const [inputValue, setInputValue] = useState("");
Expand All @@ -27,6 +27,7 @@ export default function SearchForm({ width, marginTop, inputVariant }) {
const query = useRecoilValue(queryState);
const setPage = useSetRecoilState(pageState);
const [inputText, setInputText] = useRecoilState(inputState);
const [filter, setFilter] = useRecoilState(filterState);

const showToast = () => toast({
title: "입력된 검색어가 없습니다.",
Expand All @@ -41,9 +42,12 @@ export default function SearchForm({ width, marginTop, inputVariant }) {
const onSubmit = (e) => {
if (query.area === undefined && query.stage === undefined && query.type === undefined && inputText.length === 0) showToast();
else {
console.log(query);
setFilter({
area: [],
stage: [],
type: [],
})
setPage(1);
setInputValue("");
router.push({
pathname: "/ResultPage",
});
Expand Down Expand Up @@ -92,7 +96,12 @@ export default function SearchForm({ width, marginTop, inputVariant }) {
variant="ghost"
color="green"
mr="10px"
onClick={onOpen}
onClick={() => {
onOpen();
setFilter({});
setInputText("");
setInputValue("");
}}
/>
</InputRightElement>
</InputGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/components/filter/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useState } from "react";
import { useRouter } from "next/router";

import FilterTypeBox from "./FilterTypeBox";
import { filterState, inputState, pageState } from "../../states";
import { filterState, inputState, pageState, queryState } from "../../states";
import { useRecoilState, useRecoilValue, useSetRecoilState } from "recoil";

export default function Filter({ isOpen, onClose, showToast }) {
Expand All @@ -24,10 +24,10 @@ export default function Filter({ isOpen, onClose, showToast }) {
const router = useRouter();

const [filter, setFilter] = useRecoilState(filterState);
const query = useRecoilValue(queryState);
const inputText = useRecoilValue(inputState);
const setPage = useSetRecoilState(pageState);


const updateFilters = (e) => {
setPage(1);
setFilter({
Expand Down
Loading