Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: complete trip space page #92

Merged
merged 9 commits into from
Jan 15, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/chakra/chakraCustomTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const customTheme = extendTheme({

"&__current-month": {
display: "flex",
paddingLeft: "5.5rem",
paddingLeft: "calc((100% - 30rem)/2)",
fontSize: "1.6rem",
fontStyle: "normal",
fontWeight: "700",
Expand Down
4 changes: 2 additions & 2 deletions src/components/GlobalNavigationBar/GlobalNavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function GlobalNavigationBar() {
<Link to="/">
<AiOutlineHome fontSize="24px" color={!pathname && "#0086ff"} />
</Link>
<Link to="/carryout">
<Link to="/trip">
<AiOutlineCarryOut
fontSize="24px"
color={pathname === "carryout" && "#0086ff"}
color={pathname === "trip" && "#0086ff"}
/>
</Link>
<Link to="/heart">
Expand Down

This file was deleted.

32 changes: 32 additions & 0 deletions src/components/TripSpace/EditTripSpace/EditTripSpace.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { useDisclosure } from "@chakra-ui/react";
import { useNavigate } from "react-router-dom";

import styles from "./EditTripSpace.module.scss";

import LeaveTripModal from "../LeaveTripModal/LeaveTripModal";

function EditTripSpace() {
const navigate = useNavigate();
const {
isOpen: isModalOpen,
onOpen: onModalOpen,
onClose: onModalClose,
} = useDisclosure();

return (
<>
<div className={styles.ContentContainer}>
<button onClick={() => navigate("/trip/selectRegion")}>
여행도시 편집
</button>
<button onClick={() => navigate("/trip/selectDate")}>
여행날짜 수정
</button>
<button onClick={onModalOpen}>여행 나가기</button>
</div>
<LeaveTripModal isOpen={isModalOpen} onClose={onModalClose} />
</>
);
}

export default EditTripSpace;
68 changes: 68 additions & 0 deletions src/components/TripSpace/LeaveTripModal/LeaveTripModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import {
Button,
Modal,
ModalBody,
ModalContent,
ModalFooter,
ModalHeader,
} from "@chakra-ui/react";

import { LeaveTripModalProps } from "@/types/modal";

function LeaveTripModal({ isOpen, onClose }: LeaveTripModalProps) {
Copy link
Contributor

@SKY-PEY SKY-PEY Jan 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헉 저도 지금 이 모달 만들고 있었는데 혹시 모달뜨면서 바텀슬라이드 내려가는거 해보셨나요??ㅜ
모달이나 바텀슬라이드나 같은 onClose를 쓰니까 꼬이는 것 같더라구요,,,, 우선 지금 이것저것 해보는데 시간을 많이 빼앗겨서... 서현님은 어떻게 하시나 궁금했습니다😥

(수정)
방금 해결했습니다ㅎㅎ..!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

은영님 PR 확인했습니다!! 참고할게요 👍🏻

return (
<Modal isOpen={isOpen} onClose={onClose} size="lg" isCentered>
<ModalContent
display="flex"
flexDirection="column"
alignItems="center"
gap="1.2rem"
borderRadius="16px"
bg="neutral.0"
p="32px"
>
<ModalHeader
fontSize="subTitle"
fontWeight="subTitle"
lineHeight="subTitle"
color="neutral.900"
p="0"
>
여행을 나가시겠어요?
</ModalHeader>
<ModalBody
fontSize="tabLabel"
fontWeight="tabLabel"
lineHeight="tabLabel"
color="neutral.400"
p="0"
>
<p>동행의 초대없이 다시 참여가 불가능합니다</p>
</ModalBody>
<ModalFooter display="flex" gap="8rem" p="0" mt="1.2rem">
<Button
variant="none"
fontSize="button"
fontWeight="button"
lineHeight="button"
color="neutral.400"
onClick={onClose}
>
취소
</Button>
<Button
variant="none"
fontSize="button"
fontWeight="button"
lineHeight="button"
color="primary.400"
>
확인
</Button>
</ModalFooter>
</ModalContent>
</Modal>
);
}

export default LeaveTripModal;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use "@/sass" as *;

header {
.titleHeader {
background-color: $neutral0;
width: 100%;
max-width: 45rem;
Expand Down
4 changes: 2 additions & 2 deletions src/components/TripSpace/SelectHeader/SelectHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useNavigate } from "react-router-dom";

import "./SelectHeader.module.scss";
import styles from "./SelectHeader.module.scss";

import BackIcon from "@/assets/back.svg?react";

Expand All @@ -10,7 +10,7 @@ function SelectHeader({ title }: SelectHeaderProps) {
const navigate = useNavigate();

return (
<header>
<header className={styles.titleHeader}>
<nav>
<button onClick={() => navigate(-1)}>
<BackIcon />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

.dateChoice {
display: flex;
padding: 20px 60px;
padding: 22px 0;
padding-left: calc((100% - 32.7rem) / 2);
align-items: center;
gap: 8px;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import DatePicker, { registerLocale } from "react-datepicker";
import { BsCalendarCheck as CalendarIcon } from "react-icons/bs";

import "react-datepicker/dist/react-datepicker.css";
import styles from "./CalendarModal.module.scss";
import styles from "./Calendar.module.scss";

import { printDayNight } from "@/utils/printDayNight";
import SelectHeader from "@/components/TripSpace/SelectHeader/SelectHeader";

import SelectHeader from "../SelectHeader/SelectHeader";
import { printDayNight } from "@/utils/printDayNight";

function CalendarModal() {
function Calendar() {
registerLocale("ko", ko);
const today = new Date();
const [startDate, setStartDate] = useState<Date | null>(null);
Expand Down Expand Up @@ -83,4 +83,4 @@ function CalendarModal() {
);
}

export default CalendarModal;
export default Calendar;
6 changes: 3 additions & 3 deletions src/pages/RegionSearch/RegionSearch.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
transition: all 0.5s;
}

.contentsContainer {
.regionListsContainer {
width: 100%;
min-width: 36rem;
max-width: 45rem;
height: calc(100vh - 17rem);
margin-top: 17rem;
// margin-top: 17rem;
margin-bottom: 15.5rem;
position: sticky;
top: 17rem;
Expand All @@ -36,7 +36,7 @@
min-width: 36rem;
max-width: 45rem;
height: calc(100vh - 5rem);
margin-top: 5rem;
// margin-top: 5rem;
margin-bottom: 15.5rem;
position: sticky;
top: 5rem;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/RegionSearch/RegionSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ function RegionSearch() {
<div
className={
isInputFocused || regionValue
? styles.contentsContainer__focus
: styles.contentsContainer
? styles.regionListsContainer__focus
: styles.regionListsContainer
}
>
{regions.length ? (
Expand Down
5 changes: 4 additions & 1 deletion src/pages/Trip/Trip.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

.container {
margin-top: 56px;
width: 45rem;
width: 100%;
min-width: 36rem;
max-width: 45rem;
background-color: $primary200;
position: relative;
Expand All @@ -21,6 +22,7 @@
//바텀패딩을 추가해야 탭 보더래디우스 뒤에 색이 보여요,,ㅠ
.iconTab {
width: 100%;
min-width: 36rem;
max-width: 45rem;
padding: 16px 16px 25px;

Expand All @@ -40,6 +42,7 @@
.header {
color: $neutral0;
width: 100%;
min-width: 36rem;
max-width: 45rem;
padding-bottom: 5px;
//position:fixed;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Trip/Trip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import styles from "./Trip.module.scss";

import BottomSlide from "@/components/BottomSlide/BottomSlide";
import SlideBar from "@/components/SideBar/SideBar";
import EditBottomSlideContent from "@/components/TripSpace/EditBottomSlideContent/EditBottomSlideContent";
import EditTripSpace from "@/components/TripSpace/EditTripSpace/EditTripSpace";
import FriendList from "@/components/TripSpace/FriendList/FriendList";
import InviteFriends from "@/components/TripSpace/InviteFriends/InviteFriends";
import VoteTabPanel from "@/components/VoteTabPanel/VoteTabPanel";
Expand Down Expand Up @@ -152,7 +152,7 @@ function Trip() {
<BottomSlide
isOpen={isBottomSlideOpen}
onClose={onBottomSlideClose}
children={<EditBottomSlideContent />}
children={<EditTripSpace />}
/>
<BottomSlide
isOpen={isInviteOpen}
Expand Down
9 changes: 6 additions & 3 deletions src/routes/MainRouter/MainRouter.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import { Route, Routes } from "react-router-dom";

import Alarm from "@/pages/Alarm/Alarm";
import Calendar from "@/pages/Calendar/Calendar";
import Detail from "@/pages/Detail/Detail";
import Home from "@/pages/Home/Home";
import Login from "@/pages/Login/Login";
import Signup from "@/pages/Signup/Signup";
import RegionSearch from "@/pages/RegionSearch/RegionSearch";
import SearchFromHome from "@/pages/SearchFromHome/SearchFromHome";
import AgreePrivacy from "@/pages/Signup/Agree/AgreePrivacy";
import AgreeService from "@/pages/Signup/Agree/AgreeService";
import Signup from "@/pages/Signup/Signup";
import Trip from "@/pages/Trip/Trip";
import Vote from "@/pages/Vote/Vote";
import Dashboard from "@/routes/Dashboard/Dashboard";


function MainRouter() {
return (
<Routes>
<Route element={<Dashboard />}>
<Route index element={<Home />} />
<Route path="/carryout" element={<Trip />} />
<Route path="/trip" element={<Trip />} />
<Route path="/heart" element={<Home />} />
<Route path="/user" element={<Home />} />
</Route>
Expand All @@ -30,6 +31,8 @@ function MainRouter() {
<Route path="/signup/agreeService" element={<AgreeService />} />
<Route path="/alarm" element={<Alarm />} />
<Route path="/home/search" element={<SearchFromHome />} />
<Route path="/trip/selectDate" element={<Calendar />} />
<Route path="/trip/selectRegion" element={<RegionSearch />} />
</Routes>
);
}
Expand Down
7 changes: 7 additions & 0 deletions src/types/modal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface ModalProps {
isOpen: boolean;
onOpen: () => void;
onClose: () => void;
}

export type LeaveTripModalProps = Omit<ModalProps, "onOpen">;