diff --git a/src/components/event/eventForm/EventForm.jsx b/src/components/event/eventForm/EventForm.jsx index d72956b..88defe1 100644 --- a/src/components/event/eventForm/EventForm.jsx +++ b/src/components/event/eventForm/EventForm.jsx @@ -1,21 +1,14 @@ import React, { useState } from "react"; import "./eventForm.css"; import { useNavigate } from 'react-router-dom'; +import Select from 'react-select' const EventForm = () => { -const subjects = ["Korean", "English", "Math", "Social Studies", "Science", "Music", "Art", "Physical Education"]; -const initialSubject = subjects[0]; -const activities = ["reading", "gaming", "swimming", "hiking"]; -const initialActivity = activities[0]; -const routines = ["I do it every day", "I do it every week", "I do it every month"]; -const initialRoutine = routines[0]; -const wheres = ["on games", "on transportation", "on buying accessories", "on exercising", "on snacks"]; -const initialWhere = wheres[0]; - - const [selectedActivity, setSelectedActivity] = useState(initialActivity); - const [selectedSubject, setSelectedSubject] = useState(initialSubject); - const [selectedRoutine, setSelectedRoutine] = useState(initialRoutine); - const [selectedWhere, setSelectedWhere] = useState(initialWhere); + + const [selectedActivity, setSelectedActivity] = useState(); + const [selectedSubject, setSelectedSubject] = useState(); + const [selectedRoutine, setSelectedRoutine] = useState(); + const [selectedWhere, setSelectedWhere] = useState(); const [selectedAmount, setSelectedAmount] = useState(""); const [loading, setLoading] = useState(false); const navigate = useNavigate(); @@ -61,12 +54,12 @@ const sociability = sociabilityInput.value; navigate('/event-result', { state: { requestPrompt } }); }; - return ( - <> +
-
+
+
어떤 방식을 더 좋아하세요?
@@ -94,65 +87,153 @@ const sociability = sociabilityInput.value;
좋아하는 과목은 무엇인가요? - + value={selectedSubject ? { value: selectedSubject, label: selectedSubject } : null} + onChange={(selectedOption) => setSelectedSubject(selectedOption.label)} + options={[ + { value: "Korean", label: "국어" }, + { value: "English", label: "영어" }, + { value: "Math", label: "수학" }, + { value: "Social Studies", label: "사회" }, + { value: "Science", label: "과학" }, + { value: "Music", label: "음악" }, + { value: "Art", label: "미술" }, + { value: "Physical Education", label: "체육" } + ]} + theme={(theme) => ({ + ...theme, + colors: { + ...theme.colors, + primary25: '#E5FAFC', + primary: '#F4C4D2', + }, + })} + styles={{ + control: (provided, state) => ({ + ...provided, + borderColor: state.isFocused ? '#F4C4D2' : '#F4C4D2', + borderRadius: "10px", + boxShadow: "none", + "&:hover": { + borderColor: '#F4C4D2' + }, + width: '20rem' + }), + option: (provided, state) => ({ + ...provided, + cursor: "pointer" + }) + }} + /> +
취미가 무엇인가요? - + styles={{ + control: (provided, state) => ({ + ...provided, + borderColor: state.isFocused ? '#F4C4D2' : '#F4C4D2', + borderRadius: "10px", + boxShadow: "none", + "&:hover": { + borderColor: '#F4C4D2' + }, + width: '20rem' + }), + option: (provided, state) => ({ + ...provided, + cursor: "pointer" + }) + }} + />
- 나는 매 - - - -  에
+
+ 나는 매 + setSelectedWhere(selectedOption.label)} + options={[ + { value: "on game", label: "게임" }, + { value: "on traffic fee", label: "교통비" }, + { value: "on fangirling", label: "덕질" }, + { value: "on buying accessories", label: "악세사리 구매" }, + { value: "on work out", label: "운동" }, + { value: "on snacks", label: "간식" } + ]} + required + styles={{ + control: (provided, state) => ({ + ...provided, + borderColor: state.isFocused ? '#F4C4D2' : '#F4C4D2', + borderRadius: "10px", + boxShadow: "none", + "&:hover": { + borderColor: '#F4C4D2' + }, + width: '20rem' + }), + option: (provided, state) => ({ + ...provided, + cursor: "pointer" + }) + }} + /> + +  에
+
{ const value = parseInt(e.target.value); @@ -166,9 +247,10 @@ const sociability = sociabilityInput.value;
+
- +
); }; diff --git a/src/components/event/eventForm/eventForm.css b/src/components/event/eventForm/eventForm.css index 0580341..a70b91f 100644 --- a/src/components/event/eventForm/eventForm.css +++ b/src/components/event/eventForm/eventForm.css @@ -1,38 +1,72 @@ +.event-gpt-wrap{ + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.event-gpt-container{ + width: 100%; + margin: 2rem 0; + display: flex; + justify-content: center; + align-items: center; +} + .eventForm{ background-color: #DD5475; - padding: 1.5rem 0rem; - margin: 2.3rem 2rem; color: #FFF; - + width: 60%; + height: 29rem; + overflow: scroll; + padding: 1rem; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50px; } -.formBox{ + +.form-container{ width: 100%; - border: 3px dashed #FFF; + height: 95%; border-left: none; border-right: none; - padding: 1rem; - font-size: 1.8rem; + border: 3px dashed #FFF; display: flex; justify-content: center; - align-items: center; + align-items: center; + border-radius: 50px; +} + +.form-box{ + width: 70%; + height: 90%; + font-size: 1.8rem; + overflow: scroll; } .selectLabel{ color: #FFF; - } #subject-select, #activity-select, #routine-select, #where-select{ color: #000; - font-size: 1.8rem; + font-size: 2rem; margin-left: 3%; + margin-top: 0.4rem } .question { margin-bottom: 5%; } +.flex-q{ + display: flex; + align-items: center; +} + label{ margin-right: 3%; } @@ -50,4 +84,23 @@ label{ height: 1.4rem; color: #000; font-size: 1.3rem; -} \ No newline at end of file +} + +[type="radio"] { + vertical-align: middle; + appearance: none; + border: max(2px, 0.1em) solid rgb(255, 255, 255); + border-radius: 50%; + width: 1.25em; + height: 1.25em; + transition: border 0.5s ease-in-out; + } + + [type="radio"]:checked { + border: 0.4em solid #F4C4D2; + } + + [type="radio"]:focus-visible { + outline-offset: max(2px, 0.1em); + outline: max(2px, 0.1em) dotted #F4C4D2; + } \ No newline at end of file diff --git a/src/pages/event/EventGPT.jsx b/src/pages/event/EventGPT.jsx index 3229cfb..d053f7b 100644 --- a/src/pages/event/EventGPT.jsx +++ b/src/pages/event/EventGPT.jsx @@ -6,7 +6,7 @@ import EventForm from '../../components/event/eventForm/EventForm'; const EventGPT = () => { return ( -
+