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

[7주차/민] 워크북 제출합니다 #71

Merged
merged 2 commits into from
Nov 22, 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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import useCustomFetch from "../../hooks/useCustomFetch"
import { Link,useSearchParams } from 'react-router-dom';
import MoviePoster from '../moviePoster/moviePoster';
import * as S from '../../pages/basicPages/searchPage/styled/searchPage.style'
import CardListSkeleton from "../Skeleton/card-list-skeleton";
import MovieFrameList from "../Skeleton/movieFrameList";

const SearchMovieList = ()=>{
const [searchParams, setSearchParams] = useSearchParams({
Expand All @@ -17,7 +17,7 @@ const SearchMovieList = ()=>{
}
if(isLoading){
return(
<CardListSkeleton number = {20}/>
<MovieFrameList number = {20}/>
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as S from './styled/card-skeleton.styled'
import * as S from './styled/styled'

const CardSkeleton = ()=>{
const MovieFrame = ()=>{
return(
<S.Container>
<S.CardMain/>
Expand All @@ -12,4 +12,4 @@ const CardSkeleton = ()=>{
)
}

export default CardSkeleton;
export default MovieFrame;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import MovieFrame from "./movieFrame"
import * as S from '../../pages/basicPages/searchPage/styled/searchPage.style'
const MovieFrameList = ({number}) => {
return(
<S.MovieGridContainer>
{new Array(number).fill(0).map((_,idx)=> <MovieFrame/>)}
</S.MovieGridContainer>
)
}

export default MovieFrameList;
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { useState, useEffect } from 'react'
import MoviePoster from '../../../components/moviePoster/moviePoster.jsx';
import './moviesPages.css'
import axios from "axios";
import { useParams } from 'react-router-dom';
import { axiosInstance } from '../../../apis/axios-instance.js';
import useCustomFetch from '../../../hooks/useCustomFetch.js';
import { Link } from "react-router-dom";
import CardListSkeleton from '../../../components/Skeleton/card-list-skeleton.jsx';
import MovieFrameList from '../../../components/Skeleton/movieFrameList.jsx';

const APIurl={
"now-playing" : '/movie/now_playing?language=ko-KR&page=1',
Expand All @@ -19,7 +15,7 @@ const MoviesPage = (props) => {
const {category} = props
const {data : movies, isLoading, isError} = useCustomFetch(APIurl[category]);
if(isLoading){
return <CardListSkeleton number={20}/>
return <MovieFrameList number={20}/>
}

if(isError){
Expand Down
25 changes: 25 additions & 0 deletions mission/chapter07/mission/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.env
8 changes: 8 additions & 0 deletions mission/chapter07/mission/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# React + Vite

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

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
38 changes: 38 additions & 0 deletions mission/chapter07/mission/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import js from '@eslint/js'
import globals from 'globals'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'

export default [
{ ignores: ['dist'] },
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
settings: { react: { version: '18.3' } },
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
]
13 changes: 13 additions & 0 deletions mission/chapter07/mission/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading