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

[2주차] 권혜인 미션 제출합니다. #3

Open
wants to merge 97 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
ff01d1b
🎉 init : react setting
hae2ni Sep 10, 2024
ce017e9
🎉 init: 초기세팅(eslint, prettier)
hae2ni Sep 10, 2024
420fa58
🎉 init: 초기세팅(파일경로)
hae2ni Sep 10, 2024
f3a3678
🎉 init: 초기세팅(html)
hae2ni Sep 10, 2024
eff2193
🎉 init: 초기세팅(stylelint)
hae2ni Sep 10, 2024
b5032fb
💄 design: globalStyle, theme, commonStyle 설정
hae2ni Sep 10, 2024
ca7fff7
🎉 init: App.jsx 초기세팅
hae2ni Sep 10, 2024
01a514a
📦 pack: stylelint-config-clean-order 추가
hae2ni Sep 10, 2024
ad8d6b9
🎉 init: 초기세팅(App.jsx)
hae2ni Sep 10, 2024
7e30b2e
✨ feat: Header 오늘 월, 년 불러오기
hae2ni Sep 10, 2024
a634729
✨ feat: 요일 별 setting
hae2ni Sep 10, 2024
153af81
🎨 style: styled-component code 구조 변화
hae2ni Sep 10, 2024
3f63a01
✨ feat: newDate 추가
hae2ni Sep 10, 2024
c14a448
💄 design: 상단 디자인 추가
hae2ni Sep 10, 2024
d33b832
💄 design: theme 추가
hae2ni Sep 10, 2024
6cb8a80
✨ feat: 각 날짜에 맞춰서 색깔 변하도록 수정
hae2ni Sep 10, 2024
38b433c
📦 pack: date-fns
hae2ni Sep 10, 2024
1a0e43c
✨ feat: 현재 주 보여주기
hae2ni Sep 10, 2024
0a4d525
⚡️ etc: html viewport 추가
hae2ni Sep 12, 2024
6ccbbcd
✨ feat: vite.config.js 절대 경로 utils 추가
hae2ni Sep 12, 2024
ecf1408
🔥 remove: 쓸모없는 파일 삭제
hae2ni Sep 12, 2024
30f1855
🎨 style: TodoPage->MainPage로 파일 이동
hae2ni Sep 12, 2024
0c1f75e
💄 design: font-face 수정
hae2ni Sep 12, 2024
8353ab6
📦 pack: zustand 추가
hae2ni Sep 12, 2024
f44e4fb
✨ feat: zustand store 추가
hae2ni Sep 12, 2024
a17251a
✨ feat: zustand 함수 추가
hae2ni Sep 12, 2024
40d6bdf
✨ feat: useStore 보정
hae2ni Sep 12, 2024
bf7e51c
⚡️ etc: 절대 경로 core 추가
hae2ni Sep 12, 2024
61979a9
✨ feat: 날짜 zustand로 옮기기
hae2ni Sep 12, 2024
7ce6cc0
✨ feat: Header 양 쪽 버튼 기능 추가
hae2ni Sep 12, 2024
407d1ea
🎨 style: SUIT-Regular로 수정
hae2ni Sep 12, 2024
9734e9f
🎨 style: date-fns 관련 작업 수정
hae2ni Sep 12, 2024
af8d597
✨ feat: dayItem, days 컴포넌트 분리
hae2ni Sep 12, 2024
6e7d640
🔥 remove: remove dead code
hae2ni Sep 12, 2024
6a0121a
🔥 remove: remove console
hae2ni Sep 12, 2024
548de8b
💄 design: Todo 추가 버튼
hae2ni Sep 12, 2024
b40b090
💄 design: Todo 추가 버튼 MainPage에 추가
hae2ni Sep 12, 2024
23ab57d
✨ feat: zustand store에 headerDay 추가
hae2ni Sep 16, 2024
e5f877a
✨ feat: 날짜 바꾸면 header날짜도 같이 바뀌도록 추가
hae2ni Sep 16, 2024
276f135
✨ feat: 오늘 날짜 화면에 나타나도록 수정
hae2ni Sep 16, 2024
fbb20c0
✨ feat: 클릭한 날짜로 이동
hae2ni Sep 16, 2024
6b5aa58
✨ feat: 클릭한 날짜 보여주기
hae2ni Sep 16, 2024
6d71eb7
✨ feat: modalhandler 추가
hae2ni Sep 16, 2024
39efac1
✨ feat: todo modal
hae2ni Sep 16, 2024
250f744
✨ feat: 버튼 눌렀을 때 모달이 띄워지도록
hae2ni Sep 16, 2024
d3466d7
✨ feat: modal과 modal 안에 요소 간 분리
hae2ni Sep 16, 2024
8c6dd0e
✨ feat: 모달이 생겼을 때 할일 추가 버튼 안 보이도록 처리
hae2ni Sep 16, 2024
8c35cea
✨ feat: clickeddate zustand로 바꾸기
hae2ni Sep 16, 2024
8d5ce61
✨ feat: input handler 추가
hae2ni Sep 16, 2024
79cfae7
✨ feat: zustand 수정
hae2ni Sep 16, 2024
55a1dd2
✨ feat: 모달창추가
hae2ni Sep 16, 2024
83ac4ac
💄 design: theme 변경
hae2ni Sep 16, 2024
8292b8a
✨ feat: todoInput 관리 zustand state
hae2ni Sep 17, 2024
ad272c9
✨ feat: todoList 나타내기
hae2ni Sep 17, 2024
99ba10b
✨ feat: todo 추가 버튼 함수 걸기
hae2ni Sep 17, 2024
5a71e66
✨ feat: 추가되도록 로직 수정
hae2ni Sep 17, 2024
b454c4b
✨ feat: todoList filtering 추가
hae2ni Sep 17, 2024
3efed7c
🔥 remove: console 삭제
hae2ni Sep 17, 2024
e6e371c
✨ feat: colorbox 추가
hae2ni Sep 17, 2024
c399530
✨ feat: colorBox 클릭함수 추가
hae2ni Sep 17, 2024
f522306
⚡️ etc: color list 추가
hae2ni Sep 17, 2024
b8869fe
✨ feat: todo한 개 커스텀
hae2ni Sep 17, 2024
bd7a646
💄 design: todoList 커스텀
hae2ni Sep 17, 2024
1052ae2
🔥 remove: 쓸모없는 코드 삭제
hae2ni Sep 17, 2024
9d5dfc7
✨ feat: 할일 입력이 안됐을 때 alert 뜨도록 추가
hae2ni Sep 17, 2024
528577a
✨ feat: onTodo 없애는 버튼 추가
hae2ni Sep 17, 2024
cb4488f
💄 design: 디자인 추가
hae2ni Sep 17, 2024
d5af965
✨ feat: 날짜 바꾸면 리스트도 바뀌도록 수정
hae2ni Sep 17, 2024
9ea397c
✨ feat: isDone toggle 함수 store에 업데이트
hae2ni Sep 17, 2024
6b19970
✨ feat: isDone 토글 컴포넌트에 추가
hae2ni Sep 17, 2024
894211b
✨ feat: remove 함수 추가
hae2ni Sep 17, 2024
8a7309c
✨ feat: zustand에 remove 함수 추가
hae2ni Sep 17, 2024
ad13ee3
✨ feat: TodoList에 remove 함수 추가
hae2ni Sep 17, 2024
f76189b
🎨 style: store 이름 변경
hae2ni Sep 17, 2024
2f33529
🐛 fix: eslinct.js 에러 제거
hae2ni Sep 17, 2024
d919842
📦 pack: react-prop type 추가
hae2ni Sep 17, 2024
7b442f6
🔥 remove: remove unused code
hae2ni Sep 17, 2024
d127647
⚡️ improve: props type 추가
hae2ni Sep 17, 2024
05f91cd
🔥 remove: remove dead code
hae2ni Sep 17, 2024
f4954a1
✨ feat: zustand persist 추가
hae2ni Sep 18, 2024
fbb758b
📦 pack: zustand 업데이트
hae2ni Sep 18, 2024
97750e7
🚚 reame: 오타 수정
hae2ni Sep 18, 2024
6cab823
✨ feat: localStorage에 저장
hae2ni Sep 18, 2024
dbb5f69
📝 etc: 주석
hae2ni Sep 18, 2024
f12e4ca
✨ feat: 완료 체크
hae2ni Sep 18, 2024
076ab1b
🚚 move: 컴포넌트 분리
hae2ni Sep 18, 2024
e6e669f
🔥 remove: 쓸모없는 import 삭제
hae2ni Sep 18, 2024
c39a90c
🎨 etc: 컴포넌트 분리
hae2ni Sep 18, 2024
1d1a25f
🎨 etc: data.js 파일 정리+ 변수 이동
hae2ni Sep 19, 2024
9b217dd
✨ feat: useDayContext custom hook 추가
hae2ni Sep 19, 2024
63d861d
✨ feat: useTodoContext custom hook 추가
hae2ni Sep 19, 2024
5478c2d
✨ feat: custom hook 으로 변경
hae2ni Sep 19, 2024
40dc19d
🎨 style: custom hook props로 변경 (zustand -> custom hook)
hae2ni Sep 19, 2024
7ebc8f2
✨ feat: localStorage 저장
hae2ni Sep 19, 2024
8496d3a
⚡️ etc: styled component props $ c추가
hae2ni Sep 19, 2024
3a02be7
⚡️ etc: useState-> useRef
hae2ni Sep 19, 2024
9c4628a
📝
hae2ni Sep 23, 2024
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
31 changes: 31 additions & 0 deletions week2-ceos/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
root: true,
env: { browser: true, es2020: true, node: true },
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "prettier"],
extends: [
"eslint:recommended",
"eslint-config-prettier",
"airbnb",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
rules: {
"linebreak-style": 0,
"import/prefer-default-export": 0,
"prettier/prettier": 0,
"import/extensions": 0,
"import/no-unresolved": 0,
"import/no-extraneous-dependencies": 0, // 테스트 또는 개발환경을 구성하는 파일에서는 devDependency 사용을 허용
"react/prop-types": "off",
"react/jsx-filename-extension": [2, { extensions: [".js", ".jsx", ".ts", ".tsx"] }],
"jsx-a11y/no-noninteractive-element-interactions": 0,
"eol-last": ["error", "always"], // line의 가장 마지막 줄에는 개행 넣기"
"simple-import-sort/imports": "error", // import 정렬
"no-multi-spaces": "error", // 스페이스 여러개 금지
},
};
24 changes: 24 additions & 0 deletions week2-ceos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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?
8 changes: 8 additions & 0 deletions week2-ceos/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"tabWidth": 2,
"printWidth": 120,
"trailingComma": "all",
"bracketSameLine": true,
"endOfLine": "auto"
}
4 changes: 4 additions & 0 deletions week2-ceos/.stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-clean-order"],
"customSyntax": "postcss-styled-syntax"
}
8 changes: 8 additions & 0 deletions week2-ceos/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 week2-ceos/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',
Copy link

Choose a reason for hiding this comment

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

제가 보기에는 이 프로젝트에서 react/jsx-no-target-blank 규칙을 끌 필요는 없을 것 같은데, 원래 사용하시던 규칙들을 가져오신건가요?!

Copy link
Author

Choose a reason for hiding this comment

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

네네! 원래 사용하던 거 가져왔습니다!

'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
Comment on lines +32 to +35
Copy link

Choose a reason for hiding this comment

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

저도 react-refresh라는 eslint 규칙이 있다는 걸 배웠습니다..! 그런데 이쪽도 이번 프로젝트에서는 설정할 필요 없는 것 같아요!

추가로, 지금처럼 상수들을 export할 때 jsx 파일이 아니라 color.js같이 js 파일에서 export하신다면 문제가 발생하지 않으므로 삭제하셔도 될 것 같아요!!

Copy link
Author

Choose a reason for hiding this comment

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

네! 감사합니다 😄

},
},
]
14 changes: 14 additions & 0 deletions week2-ceos/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="ko">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<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>WEB TODO</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
43 changes: 43 additions & 0 deletions week2-ceos/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
Copy link

Choose a reason for hiding this comment

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

추가로 Vite를 이용해서 프로젝트를 잘 세팅해주신 것 같아요!!👍👍

그런데 혹시 따로 Vite를 사용하신 이유가 있을까요?

또, 프로젝트 안에 따로 week2-ceos 폴더를 따로 만들고 프로젝트를 세팅하셨는데 root 폴더에 바로 세팅하지 않으신 이유가 있을까용?! 지금대로면 root에서 npm start를 하면 빈 페이지가 실행되고, 원하는 페이지를 열려면 week2-ceos로 이동해서 npm run dev 로 실행시켜야 할 것 같은데, 처음 프로젝트를 보는 사람이면 실행법을 헷갈릴 수 있다고 생각했습니다! 만약 week2-ceos 파일들만 사용하면 root에 있는 src 등의 파일들은 다 지워도 될 것 같아요 ;)

Copy link
Author

Choose a reason for hiding this comment

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

아 일단 vite 를 사용한 이유는,
일단 yarn + vite 를 쓰는게 습관이 된 이유도 있고, cra가 vite보다 상대적으로 느려서요!
사실 이번 과제와 같이 작은 플젝은 별로 상관은 없지만, 그래도 이왕이면 빠르고 최신거?를 사용하자!는 마음으로 진행했습니다!

그리구 원래 과제를 할 때 저만의 폴더를 만들고 시작하는게 맘이 편하더라구요,,ㅎㅎ

"name": "week2-ceos",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint .",
"preview": "vite preview",
"lint:css": "stylelint './src/**/*.{ts,tsx,js,jsx}'",
"lint:css:fix": "stylelint './src/**/*.{ts,tsx,js,jsx}' --fix"
},
"dependencies": {
"date-fns": "^3.6.0",
"path": "^0.12.7",
"prettier": "^3.3.3",
"react": "^18.3.1",
"react-calendar": "^5.0.0",
"react-dom": "^18.3.1",
"styled-components": "^6.1.13",
"styled-reset": "^4.5.2",
"url": "^0.11.4",
"zustand": "^5.0.0-rc.2"
},
"devDependencies": {
"@eslint/js": "^9.9.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^9.10.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.9",
"globals": "^15.9.0",
"postcss-styled-syntax": "^0.6.4",
"prop-types": "^15.8.1",
"stylelint": "^16.9.0",
"stylelint-config-clean-order": "^6.1.0",
"stylelint-config-standard": "^36.0.1",
"vite": "^5.4.1"
}
}
1 change: 1 addition & 0 deletions week2-ceos/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions week2-ceos/src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { ThemeProvider } from "styled-components";
import theme from "./styles/theme";
import { GlobalStyle } from "./styles/globalStyle";
import MainPage from "./pages/MainPage";

function App() {
return (
<ThemeProvider theme={theme}>
<MainPage />
<GlobalStyle />
Copy link

Choose a reason for hiding this comment

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

globla style을 잘 지정해주신 점 너무 좋아요👍👍

</ThemeProvider>
);
}

export default App;
30 changes: 30 additions & 0 deletions week2-ceos/src/components/Date/DayItem.jsx
Copy link

Choose a reason for hiding this comment

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

스타일을 유동적으로 바꿀 수 있게 설정한 것이 디자인 구조를 구성하는 데 있어 더 편리할 것 같습니다. 다양한 방법 배워갑니다!

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* eslint-disable react/prop-types */
import styled from "styled-components";
import { rowFlex } from "@styles/commonStyle";
import { format, isToday } from "date-fns";

export default function DayItem({ currentDay, handleClickDay }) {
const isTodayBoolean = isToday(currentDay);
const formattedDay = format(currentDay, "dd");

return (
<DayWrapper onClick={handleClickDay} $isTodayBoolean={isTodayBoolean}>
{formattedDay}
</DayWrapper>
);
}

const DayWrapper = styled.span`
${rowFlex}
Copy link

Choose a reason for hiding this comment

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

rowFlex를 따로 만들어 두는 방법은 생각 못했는데, 정말 좋은 것 같아요!

width: 2rem;
height: 2rem;

color: ${({ $isTodayBoolean, theme }) => {
return $isTodayBoolean && theme.colors.white;
}};

background-color: ${({ $isTodayBoolean, theme }) => {
return $isTodayBoolean && theme.colors.main_blue;
}};
border-radius: 10px;
`;
36 changes: 36 additions & 0 deletions week2-ceos/src/components/Date/DayofWeek.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import styled from "styled-components";
import { rowFlex } from "@styles/commonStyle";

const newDate = new Date();
const todayWeekDay = newDate.getDay();

//요일 부분
export default function DayofWeek() {
const DAY_OF_WEEK = ["일", "월", "화", "수", "목", "금", "토"];

const weeksList = DAY_OF_WEEK.map((week, index) => (
<DayWrapper $week={index} key={week}>
Copy link

Choose a reason for hiding this comment

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

요일에 따라서 색상을 다르게 넣어주신 부분이 좋네요!

개인적으로는 $week={index}보다는 $week={week}처럼 넘겨준 후, 아래에서 $week === "일"처럼 비교하는 방식을 선호해요. 코드를 읽다 보면 0이라는 숫자가 무엇을 뜻하는지 헷갈릴 수 있어서요! 물론 문자열 비교는 정수 비교보다 느리고, 오타가 날 가능성도 무시할 수 없다는 단점도 있죠..!

{week}
</DayWrapper>
));
return <WeekWrapper>{weeksList}</WeekWrapper>;
}

const WeekWrapper = styled.section`
${rowFlex}
justify-content: space-between;
`;

const DayWrapper = styled.span`
color: ${({ $week, theme }) => {
if ($week === 0) {
return theme.colors.sunday_red;
} else if ($week === todayWeekDay) {
return theme.colors.black;
} else {
return theme.colors.gray1;
}
}};

${({ theme, $week }) => ($week === todayWeekDay ? theme.fonts.Body1 : theme.fonts.Body2)};
`;
34 changes: 34 additions & 0 deletions week2-ceos/src/components/Date/Days.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* eslint-disable react/prop-types */
import { addDays, format } from "date-fns";
import styled from "styled-components";
import { rowFlex } from "@styles/commonStyle";
import DayItem from "./DayItem";
import { ko } from "date-fns/locale";

//날짜들 부분
export default function Days(props) {
const { weekStart, setClickedDay } = props;
let days = [];

// 현재 주의 날짜들을 생성
for (let i = 0; i < 7; i++) {
const currentDay = addDays(weekStart, i);

function handleClickDay() {
const formattedClickedDate = format(currentDay, "MM월 dd일 EEEE", { locale: ko });
setClickedDay(formattedClickedDate);
}

days.push(<DayItem handleClickDay={handleClickDay} key={currentDay} currentDay={currentDay} />);
}
return (
<>
<WeekWrapper>{[...days]}</WeekWrapper>
Copy link

Choose a reason for hiding this comment

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

궁금한 점이 있는데, 여기에서 직접 {days}가 아니라 {[...days]}처럼 사용하신 이유가 있을까요?

</>
);
}

const WeekWrapper = styled.div`
${rowFlex}
justify-content: space-between;
`;
22 changes: 22 additions & 0 deletions week2-ceos/src/components/Header/Header.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable react/prop-types */
import styled from "styled-components";
import { rowFlex } from "@styles/commonStyle";

export default function Header(props) {
const { headerDay, increaseWeek, decreaseWeek } = props;

return (
<HeaderWrapper>
<button onClick={decreaseWeek}>⬅️</button>
{headerDay}
<button onClick={increaseWeek}>➡️</button>
</HeaderWrapper>
);
}

const HeaderWrapper = styled.header`
${rowFlex}
padding: 5rem;
${({ theme }) => theme.fonts.Headline1};
color: ${({ theme }) => theme.colors.black};
`;
21 changes: 21 additions & 0 deletions week2-ceos/src/components/Modal/ColorsBox.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-disable react/prop-types */
import styled from "styled-components";
import { rowFlex } from "@styles/commonStyle";

export default function ColorsBox(props) {
const { color, onClick, boxColor } = props;

return (
<Box onClick={onClick} $boxColor={color}>
{boxColor === color && "🤍"}
</Box>
);
}

const Box = styled.button`
${rowFlex}
width: 5rem;
height: 4rem;
background-color: ${({ $boxColor }) => $boxColor};
border-radius: 10px;
`;
Loading