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

pr #1

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

pr #1

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
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public ResponseEntity<String> createMultiplePlansAndDeleteByGroupId(@Authenticat
// 먼저 해당 그룹을 삭제
// planService.deletePlansByGroupId(groupid);
// 그룹테이블에 있는 그룹도 삭제한다.
groupPlanRepository.deleteByGroupid(groupid);
planService.deletePlansByGroupId(groupid);
// groupPlanRepository.deleteByGroupid(groupid);
// 그룹을 삭제한 후에 createMultiplePlansWithDetails 실행
planService.createMultiplePlansWithDetails(requests);
// 똑같이 그룹 플랜도 생성해줘야함.
Expand Down
Binary file added front/public/images/intro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion front/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>나만의 여행을 담다</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
2 changes: 1 addition & 1 deletion front/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"short_name": "React App",
"short_name": "나만의 여행을 담다",
"name": "Create React App Sample",
"icons": [
{
Expand Down
5 changes: 2 additions & 3 deletions front/src/api/clova.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ const getScheduleListByDate = (
accr[convertDateFormmat(realday)].push({
...rest,
detailPlans: [
// rest?.detailPlans[0] ??
{ id: Math.random(), detailContent: "" },
rest?.detailPlans[0] ?? { id: Math.random(), detailContent: "" },
],
isEditable,
});
Expand Down Expand Up @@ -185,7 +184,7 @@ export const getUserState = async () => {
const { data } = await api.get(`/getuserinfo`);
return data;
} catch (e) {
window.location.href = "/error";
// window.location.href = "/error";
}
};

Expand Down
4 changes: 4 additions & 0 deletions front/src/assets/complete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions front/src/assets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ import { ReactComponent as Share } from "./share.svg";
import { ReactComponent as Error } from "./error.svg";
import { ReactComponent as RoundClose } from "./roundClose.svg";
import { ReactComponent as KakaoButton } from "./kakaoButton.svg";
import { ReactComponent as Complete } from "./complete.svg";

export const Icon = {
Complete,
Article,
CreateSchedule,
KakaoButton,
Expand Down
8 changes: 6 additions & 2 deletions front/src/atom/surveyState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ type SurveyState = {
addedDestination: string;
};

export const surveyState = atom<SurveyState>({
key: "surveyState",
export const initialSurvey = {
default: {
startDate: dayjs(),
endDate: dayjs().add(2, "day"),
Expand All @@ -32,4 +31,9 @@ export const surveyState = atom<SurveyState>({
style: "",
},
},
};

export const surveyState = atom<SurveyState>({
key: "surveyState",
default: initialSurvey.default,
});
7 changes: 6 additions & 1 deletion front/src/components/CreateSchedule/FunnelSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Icon } from "../../assets";
import Complete from "../_common/Funnel/Complete";
import AddDestination from "../_common/Funnel/AddDestination";
import useConfirmModal from "../../hooks/useConfirmModal";
import useSurvey from "../../hooks/useSurvey";

type PageType =
| "date"
Expand All @@ -27,13 +28,17 @@ const FunnelSection = () => {
const navigate = useNavigate();
const params = useParams<{ state: PageType }>();

const { initSurvey } = useSurvey();
const { openConfirmModal, closeConfirmModal } = useConfirmModal();

// TODO: 저장하기
const onSubmitModal = async () => {
openConfirmModal({
type: "COMPLETE",
confirm: () => navigate("/mySchedule"),
confirm: () => {
initSurvey();
navigate("/mySchedule");
},
cancel: closeConfirmModal,
});
};
Expand Down
2 changes: 1 addition & 1 deletion front/src/components/_common/BottomSheet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const BottomSheet = ({ onClose, id, title, desc }: Props) => {
<Style.BottomSheetButton
onClick={() =>
shareKakao(
`https://d1zdvff23sqy4w.cloudfront.net/mySchedule/detail/${id}`,
`http://localhost:3000/mySchedule/detail/${id}`,
title,
desc
)
Expand Down
11 changes: 8 additions & 3 deletions front/src/components/_common/ConfirmModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
initialConfirmModalState,
} from "../../../atom/confirmModalState";
import useConfirmModal from "../../../hooks/useConfirmModal";
import { Icon } from "../../../assets";

interface Props {
modalHandler: () => void;
Expand Down Expand Up @@ -40,9 +41,13 @@ export const ConfirmModal = ({

return (
<Modal.Frame borderRadius="8px" onClick={modalHandler}>
{/* <Modal.Header>
<Style.Title>{CONFIRM_MODAL[type].title}</Style.Title>
</Modal.Header> */}
{type === "COMPLETE" && (
<Modal.Header>
<Style.Title>
<Icon.Complete></Icon.Complete>
</Style.Title>
</Modal.Header>
)}
<Modal.Body>
<Style.Desc>{CONFIRM_MODAL[type].description}</Style.Desc>
</Modal.Body>
Expand Down
2 changes: 1 addition & 1 deletion front/src/components/_common/Funnel/Complete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type Schedule = {

const Complete = ({ onNext }: Props) => {
const navigate = useNavigate();
const { survey, getTripPeriod } = useSurvey();
const { survey, getTripPeriod, initSurvey } = useSurvey();

const {
day,
Expand Down
1 change: 1 addition & 0 deletions front/src/components/_common/Modal/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const ModalFrame = styled.div<ModalProps>`

/* ${({ theme }) => (isMobile ? theme.font.subhead_04 : theme.font.headline)}; */
export const ModalHeader = styled.div<ModalHeaderProps>`
padding-top: 30px;
width: 100%;
text-align: ${({ align }) => align === "center" && "center"};
margin-bottom: ${(props) => props.margin};
Expand Down
1 change: 1 addition & 0 deletions front/src/components/_common/ScheduleCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const ScheduleCard = ({
index,
moveItem,
}: Props) => {
console.log(description);
const location = useLocation();

const [, drop] = useDrop({
Expand Down
8 changes: 7 additions & 1 deletion front/src/hooks/useSchedule2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const useSchedule2 = () => {
const { mutate } = useSaveScehdule();

const scheduleList = data as NewSceduleInfo;
console.log("scheduleList", scheduleList);

const [schedule, setSchedule] = useState<NewSceduleInfo>({});
const [date, setDate] = useState("");
Expand Down Expand Up @@ -94,7 +95,12 @@ const useSchedule2 = () => {
const onChangeDescription = (id: number, description: string) => {
setSchedule((prev) => {
const result = prev[date].map((schedule) =>
schedule.id === id ? { ...schedule, description } : schedule
schedule.id === id
? {
...schedule,
detailPlans: [{ id: Math.random(), detailContent: description }],
}
: schedule
);
return {
...prev,
Expand Down
7 changes: 6 additions & 1 deletion front/src/hooks/useSurvey.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { useRecoilState } from "recoil";
import { surveyState } from "../atom/surveyState";
import { initialSurvey, surveyState } from "../atom/surveyState";
import dayjs from "dayjs";

const useSurvey = () => {
const [survey, setSurvey] = useRecoilState(surveyState);

const initSurvey = () => {
setSurvey(initialSurvey.default);
};

const setDestinationType = (type: string) => {
if (type === survey.destination.type) return;
setSurvey((prev) => ({
Expand Down Expand Up @@ -71,6 +75,7 @@ const useSurvey = () => {
setTripInterest,
setTripStyle,
getTripPeriod,
initSurvey,
};
};

Expand Down
29 changes: 0 additions & 29 deletions front/src/pages/AddSchedule.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions front/src/pages/Article.tsx

This file was deleted.

19 changes: 19 additions & 0 deletions front/src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ const Login = () => {
return (
<Style.Container>
<Style.Background></Style.Background>
<div
style={{
width: "100%",
position: "absolute",
top: 250,
// height: "100%",
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
}}
>
<img
src="/images/logo.png"
alt=""
style={{ width: 185, height: 185 }}
/>
<Style.Title>나만을 위한 AI 여행 플래너</Style.Title>
</div>
<Style.KakaoLoginButton
onClick={() => {
window.location.href =
Expand Down
Loading