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
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import js from '@eslint/js'
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"name": "tailwind-react-starter",
"version": "0.0.0",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
autoprefixer: {},
},
}

2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/App.tsx
Copy link
Member

Choose a reason for hiding this comment

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

πŸš€Challenge λ―Έμ…˜μ— 따라 ν”„λ‘œμ νŠΈ μ „μ²΄μ˜ μ„±λŠ₯ μ΅œμ ν™”λ‚˜ UX κ°œμ„ μ—λ„ λ„μ „ν•΄λ³΄μ„Έμš”! μ½”λ“œ ν’ˆμ§ˆ μΈ‘λ©΄μ—μ„œλ„ 쀑볡 제거, μ±…μž„ 뢄리, μ˜ˆμ™Έ 처리 κ°œμ„  등을 톡해 가독성과 μœ μ§€λ³΄μˆ˜μ„±μ΄ 쒋은 μ½”λ“œλ‘œ λ¦¬νŒ©ν† λ§ 해보면 μ–΄λ–¨κΉŒμš” 😊

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import {
RouterProvider,
createBrowserRouter,
redirect,
Expand Down
3 changes: 0 additions & 3 deletions Week10/wendy0802/mission/src/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@

// src/api/auth.ts
import axios, { AxiosError, AxiosInstance, InternalAxiosRequestConfig } from "axios";

const api = axios.create({
baseURL: "http://localhost:8000",
withCredentials: true,
});

// 토큰 관리 ν•¨μˆ˜
const getAccessToken = () => localStorage.getItem("accessToken");
const getRefreshToken = () => localStorage.getItem("refreshToken");
const setAccessToken = (token: string) => localStorage.setItem("accessToken", token);
const setRefreshToken = (token: string) => localStorage.setItem("refreshToken", token);

// (λ¬΄ν•œ μž¬μ‹œλ„ λ°©μ§€)
let isRefreshing = false;
// 토큰 κ°±μ‹  쀑 λŒ€κΈ°μ€‘μΈ μš”μ²­λ“€μ„ μ €μž₯
let failedQueue: any[] = [];
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Controller, Get, Req, Res, UseGuards } from '@nestjs/common';
import { Controller, Get, Req, Res, UseGuards } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { UserService } from './user.service'; // 같은 폴더에 μžˆλŠ” user.service.ts
import { JwtService } from '@nestjs/jwt';
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/auth/google.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PassportStrategy } from '@nestjs/passport';
import { Strategy, VerifyCallback } from 'passport-google-oauth20';
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';

@Injectable()
export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
constructor(configService: ConfigService) {
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/auth/user.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable } from '@nestjs/common';

export interface User {
id: string;
email: string;
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/components/MovieCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from "react";
import { useState } from "react";

interface MovieCardProps {
movie: any;
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link } from "react-router-dom";
import { Link } from "react-router-dom";

const Navbar = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/components/searchForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";

interface SearchFormProps {
query: string;
setQuery: (v: string) => void;
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/constants/storage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

export const LOCAL_STORAGE_KEY = {
accessToken: 'accessToken',
refreshToken: 'refreshToken',
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/context/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useLocalStorage } from "../hooks/useLocalStorage";
import { loginApi, logoutApi } from "../api/auth";
import { LOCAL_STORAGE_KEY } from "../constants/storage";
import { LoginRequest } from "../api/auth";

interface AuthContextType {
accessToken: string | null;
refreshToken: string | null;
Expand Down
1 change: 0 additions & 1 deletion Week10/wendy0802/mission/src/hooks/useFecthMovies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { useState, useEffect } from "react";
import axios from "axios";

// βœ… μΉ΄ν…Œκ³ λ¦¬ 이름을 μ‹€μ œ API endpoint에 맞게 λ³€ν™˜ν•˜λŠ” λ§΅
const categoryMap: Record<string, string> = {
popular: "popular",
"top-rated": "top_rated",
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/hooks/useForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { ZodType, ZodTypeDef } from "zod";

export function useForm<T extends FieldValues>(
schema: ZodType<T, ZodTypeDef, T>,
options?: UseFormProps<T>
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/hooks/useLocalStorage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const useLocalStorage = (key: string) => {
console.log(error);
}
};

const getItem = () => {
try {
const item: string | null = window.localStorage.getItem(key);
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

@tailwind base;
@tailwind components;
@tailwind utilities;
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./index.css";
Expand Down
3 changes: 2 additions & 1 deletion Week10/wendy0802/mission/src/modal/MovieModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { useSelector, useDispatch } from 'react-redux';
import { RootState } from '../store/store';
import { closeModal, ModalState } from './modalslice';

const MovieModal = () => {

const MovieModal = () => {
const modalState = useSelector((state: RootState): ModalState => state.modal as ModalState);
const { isOpen, movie } = modalState;
const dispatch = useDispatch();
Expand Down
8 changes: 4 additions & 4 deletions Week10/wendy0802/mission/src/modal/modalslice.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createSlice } from '@reduxjs/toolkit';

import { createSlice } from "@reduxjs/toolkit";
// modalSlice.ts λ˜λŠ” modalslice.ts
export interface Movie {
backdrop_path: string;
Expand All @@ -26,7 +26,7 @@ const initialState: ModalState = {
};

const modalSlice = createSlice({
name: 'modal',
name: "modal",
initialState,
reducers: {
openModal: (state, action) => {
Expand All @@ -41,4 +41,4 @@ const modalSlice = createSlice({
});

export const { openModal, closeModal } = modalSlice.actions;
export default modalSlice.reducer;
export default modalSlice.reducer;
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/pages/HomeLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

import Navbar from "../components/Navbar";
import { Outlet } from "react-router-dom";

Expand Down
1 change: 0 additions & 1 deletion Week10/wendy0802/mission/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Navbar from "../components/Navbar"
const HomePage = (): JSX.Element => {
return <div>
<>

<Outlet />
</>
</div>;
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/pages/LoadingSpinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const LoadingSpinner = (): JSX.Element => {
role="status"
></div>
<p className="mt-4 text-xl text-blue-300 font-bold">πŸ”΅πŸ”΅πŸ”΅</p>
</div>
</div>
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { loginApi } from "../api/auth";
import { useAuth } from "../context/AuthContext";
import { useEffect, useCallback } from "react";
import { useLocation } from "react-router-dom";

// 둜그인 μŠ€ν‚€λ§ˆ μ •μ˜
const loginSchema = z.object({
email: z.string().email("μ˜¬λ°”λ₯Έ 이메일 ν˜•μ‹μ΄ μ•„λ‹™λ‹ˆλ‹€."),
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/pages/MovieDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useParams } from "react-router-dom";
import axios from "axios";
import LoadingSpinner from "./LoadingSpinner";
import NotFoundPage from "./NotFoundPage";

const MovieDetailPage = (): JSX.Element => {
const { movieId } = useParams();
const [movieDetails, setMovieDetails] = useState<any>(null);
Copy link
Member

Choose a reason for hiding this comment

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

ν˜„μž¬ MovieDetailPage.tsx와 useFetchMovies.tsxμ—μ„œ any νƒ€μž…μ„ μ‚¬μš©ν•˜κ³  μžˆλŠ”λ°, μ˜ν™” λ°μ΄ν„°μ˜ ꡬ체적인 μΈν„°νŽ˜μ΄μŠ€λ₯Ό μ •μ˜ν•˜λ©΄ νƒ€μž… μ•ˆμ •μ„±μ΄ ν–₯μƒλ˜κ³  개발 μ‹œ μžλ™μ™„μ„±κ³Ό 였λ₯˜ 방지에 도움이 될 κ²ƒμž…λ‹ˆλ‹€! Movie μΈν„°νŽ˜μ΄μŠ€λ₯Ό ν™•μž₯ν•˜μ—¬ λͺ¨λ“  μ˜ν™” κ΄€λ ¨ 데이터에 μ μš©ν•΄λ³΄λ©΄ μ–΄λ–¨κΉŒμš”?

Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/pages/MoviePage.tsx
Copy link
Member

Choose a reason for hiding this comment

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

MoviePage.tsxμ—μ„œ renderedSearchResultsμ—λ§Œ useMemoκ°€ μ μš©λ˜μ–΄ 있고, 일반 μ˜ν™” λͺ©λ‘ λ Œλ”λ§μ—λŠ” μ΅œμ ν™”κ°€ μ—†μ–΄ νŽ˜μ΄μ§€ λ³€κ²½ μ‹œλ§ˆλ‹€ 전체 λͺ©λ‘μ΄ λ¦¬λ Œλ”λ§λ˜κ³  μžˆμŠ΅λ‹ˆλ‹€. 일반 μ˜ν™” λͺ©λ‘λ„ useMemo둜 감싸고, μ˜ν™” μΉ΄λ“œ 클릭 ν•Έλ“€λŸ¬λ„ useCallback으둜 μ΅œμ ν™”ν•˜λ©΄ μ„±λŠ₯ μΈ‘λ©΄μ—μ„œ 더 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€!

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import SearchForm from "../components/searchForm";
import { useDispatch } from "react-redux";
import { openModal } from "../modal/modalslice";
import MovieModal from "../modal/MovieModal";

export default function MoviePage(): JSX.Element {
const [page, setPage] = useState(1);
const { category } = useParams<{ category: string }>();
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/pages/MyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const MyPage = () => {
const [nickname, setNickname] = useState("");
const navigate = useNavigate();

// localStorageμ—μ„œ μœ μ € 정보 λ‘œλ“œ
/
Copy link
Member

@hyesngy hyesngy Jun 4, 2025

Choose a reason for hiding this comment

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

이 λΆ€λΆ„ μ‹€μˆ˜μΈ 것 같은데 / κ°€ 남아 μžˆμ–΄μ„œ, μ—λŸ¬ λ°œμƒν•˜λ―€λ‘œ μ§€μ›Œμ£Όμ„Έμš”~!

useEffect(() => {
const storedEmail = localStorage.getItem("signup_email") || "";
const storedNickname = localStorage.getItem("signup_nickname") || "";
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/pages/NotFoundPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function NotFoundPage(): JSX.Element {
return (
return (
<div className="flex items-center justify-center h-screen">
<div className="text-red-500 font-bold text-2xl">
πŸ’₯μ—λŸ¬ λ°œμƒπŸ’₯
Expand Down
3 changes: 2 additions & 1 deletion Week10/wendy0802/mission/src/pages/NowPlayingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// NowPlayingPage.tsx
import { Navigate } from "react-router-dom";

const NowPlayingPage = (): JSX.Element => {

const NowPlayingPage = (): JSX.Element => {
return <Navigate to="/movies/now-playing" />;
};

Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/pages/PopularPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ const PopularPage = (): JSX.Element => {
};

export default PopularPage;

2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/pages/ProtectedLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const ProtectedLayout = () => {
if (!accessToken) {
return <Navigate to="/login" replace />;
}

return <Outlet />;
};

Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/pages/SignUp.tsx
Copy link
Member

Choose a reason for hiding this comment

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

ν˜„μž¬ UI와 둜직이 ν•œ νŒŒμΌμ— λͺ¨λ‘ λ“€μ–΄κ°€ μžˆλŠ” νŽ˜μ΄μ§€λ“€μ΄ κ½€ μžˆλŠ”λ°, πŸ›Ό Standard Mission에 따라 μ»΄ν¬λ„ŒνŠΈλ₯Ό κΈ°λŠ₯ λ‹¨μœ„λ‘œ λΆ„λ¦¬ν•΄μ„œ κ΄€λ¦¬ν•˜λ©΄ 가독성, μž¬μ‚¬μš©μ„±, μœ μ§€λ³΄μˆ˜ μΈ‘λ©΄μ—μ„œ 훨씬 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€!

λ˜ν•œ μ‚¬μš©λ˜μ§€ μ•ŠλŠ” μ»΄ν¬λ„ŒνŠΈ 및 νŽ˜μ΄μ§€ νŒŒμΌλ“€λ„ μ œκ±°ν•˜μ—¬ ν”„λ‘œμ νŠΈ ꡬ쑰λ₯Ό λͺ…ν™•νžˆ ν•˜λ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€!

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useState } from "react";
import Navbar from "../components/Navbar";
import { useForm } from "../hooks/useForm";
import {
emailSchema,
emailSchema,
passwordSchema,
nicknameSchema,
EmailForm,
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/pages/TopRatedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Navigate } from "react-router-dom";

const TopRatedPage = (): JSX.Element => {
return <Navigate to="/movies/top-rated" />;
};
};

export default TopRatedPage;

2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/pages/UpcomingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Navigate } from "react-router-dom";

const UpcomingPage = (): JSX.Element => {
return <Navigate to="/movies/upcoming" />;
};
};

export default UpcomingPage;

2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/routes/ProtectedRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Navigate } from "react-router-dom";
interface ProtectedRouteProps {
children: React.ReactNode;
}

const ProtectedRoute = ({ children }: ProtectedRouteProps) => {
const token =
typeof window !== "undefined" ? localStorage.getItem("accessToken") : null;
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const store = configureStore({
modal: modalReducer,
},
});

export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
export default store;
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/validation/loginSchema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "zod";

export const loginSchema = z.object({
email: z.string().email("μ˜¬λ°”λ₯Έ 이메일 ν˜•μ‹μ„ μž…λ ₯ν•΄ μ£Όμ„Έμš”!"),
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/validation/signupSchema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "zod";

export const emailSchema = z.object({
email: z.string().email("μ˜¬λ°”λ₯Έ 이메일 ν˜•μ‹μ΄ μ•„λ‹™λ‹ˆλ‹€!"),
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference types="vite/client" />
/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly VITE_TMDB_KEY: string;
Expand Down
1 change: 1 addition & 0 deletions Week10/wendy0802/mission/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ export default {
},
plugins: [],
}

2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2020",
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2022",
Expand Down
2 changes: 1 addition & 1 deletion Week10/wendy0802/mission/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from 'vite'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'

// https://vite.dev/config/
Expand Down