From 15c2d698da57757152ee720e04800b552a67ec64 Mon Sep 17 00:00:00 2001 From: KangYeonbae <153577573+KangYeonbae@users.noreply.github.com> Date: Tue, 12 Nov 2024 20:23:39 +0900 Subject: [PATCH] =?UTF-8?q?category=20>=20type,=20title=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20/=20=ED=83=80=EC=9E=85=EB=B3=84=EB=A1=9C=EB=82=98?= =?UTF-8?q?=EB=88=84=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/route/category.js | 54 ++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/src/route/category.js b/src/route/category.js index ac31b46..7f83c07 100644 --- a/src/route/category.js +++ b/src/route/category.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { Link } from 'react-router-dom'; import { IoIosMicrophone } from "react-icons/io"; -import { FaCamera, FaCampground } from "react-icons/fa"; +import { FaCampground } from "react-icons/fa"; import { IoVideocamSharp } from "react-icons/io5"; import { GiBandana, GiPartyPopper, GiGuitar } from "react-icons/gi"; import { FaDumbbell } from "react-icons/fa6"; @@ -11,39 +11,31 @@ import '../css/category.css' import { FaBookOpenReader } from "react-icons/fa6"; // 카테고리별 아이템 매핑 -const categoryItems = { - all: [ - { icon: , label: "악기연주(합주실)", isNew: true, to: "/playing" }, - { icon: , label: "파티룸", to: "/spaces/party" }, - { icon: , label: "댄스연습실", to: "/spaces/dance" }, - { icon: , label: "노래방", to: "/spaces/karaoke" }, - { icon: , label: "스튜디오", to: "/spaces/studio" }, - { icon: , label: "캠핑장", to: "/camping" }, - { icon: , label: "헬스장", to: "/spaces/gym" }, - { icon: , label: "사무실", to: "/spaces/office" }, - { icon: , label: "숙박", to: "/spaces/accommodation" }, - { icon: , label: "공용주방", to: "/spaces/kitchen" }, - { icon: , label: "스터디룸", to: "/spaces/kitchen" } - ], - meeting: [ - { icon: , label: "파티룸", to: "/spaces/party" }, - { icon: , label: "사무실", to: "/spaces/office" }, - { icon: , label: "공용주방", to: "/spaces/kitchen" } - ], - practice: [ { icon: , label: "악기연주(합주실)", isNew: true, to: "/playing" }, - { icon: , label: "댄스연습실", to: "/spaces/dance" }, +const itemType = [ + { type: 'playing', title: "악기연주(합주실)", icon: , label:"악기연주(합주실)", isNew: true,to: "/playing" }, + { type: 'party', title: '파티룸', icon: , label:"파티룸", to: "/spaces/party" }, + { type: 'dance', title: "댄스연습실", icon: , label:"댄스연습실", to: "/spaces/dance" }, + { type: 'karaoke', title: "노래방", icon: , label:"노래방", to: "/spaces/karaoke" }, + { type: 'studio', title: "스튜디오", icon: , label:"스튜디오", to: "/spaces/studio" }, + { type: 'camping', title: "캠핑장", icon: , label:"캠핑장", to: "/camping" }, + { type: 'gym', title: "헬스장", icon: , label:"헬스장", to: "/spaces/gym" }, + { type: 'office', title: "사무실", icon: , label:"사무실",to: "/spaces/office" }, + { type: 'accommodation', title: "숙박", icon: , label:"숙박",to: "/spaces/accommodation" }, + { type: 'kitchen', title: "공용주방", icon: , label:"공용주방", to: "/spaces/kitchen" }, + { type: 'studyroom', title: "스터디룸", icon: , label:"스터디룸",to: "/spaces/studyroom" } +]; + - ], - shooting: [{ icon: , label: "스튜디오", to: "/spaces/studio" },], - bead: [ { icon: , label: "캠핑장", to: "/camping"}, - { icon: , label: "숙박", to: "/spaces/accommodation" }, - ], - office: [ - { icon: , label: "사무실", to: "/spaces/office" }, - { icon: , label: "스터디룸", to: "/spaces/kitchen" } -] +const categoryItems = { + all: itemType, + meeting: itemType.filter(item => ['party', 'office', 'kitchen'].includes(item.type)), + practice: itemType.filter(item => ['playing', 'dance'].includes(item.type)), + shooting: itemType.filter(item => ['studio'].includes(item.type)), + bead: itemType.filter(item => ['camping', 'accommodation'].includes(item.type)), + office: itemType.filter(item => ['office', 'studyroom'].includes(item.type)) }; + const CategoryItem = ({ icon, label, isNew, to }) => (