๐ฅ๐ฅ๐ฅ ์ฝ๋๋ฆฌ๋ทฐ PR ๐ฅ๐ฅ๐ฅ#77
๐ฅ๐ฅ๐ฅ ์ฝ๋๋ฆฌ๋ทฐ PR ๐ฅ๐ฅ๐ฅ#77ssumanlife wants to merge 185 commits intocodeReviewfrom
Conversation
๋ฉ์ธ๊ณผ ๊ฐ๋ฐ ๋ธ๋์น ๋๊ธฐํ
[Feature] ์์ ๋ผ์ฐํ ๊ธฐ๋ฅ ๊ตฌํ ๋ฐ ํค๋ ์คํ์ผ๋ง
[Feature] Emotion์ผ๋ก ๊ธ๋ก๋ฒ ์คํ์ผ ์ค์
Feat/firebese db test 9
[feature] ๋ฒํผ, ๋ชจ๋ฌ์ฐฝ ์ปดํฌ๋ํธ ์์ฑ
[Feature] ์ฌ์ฅ๋ ๊ธ์ฌ๋ด์ญ ํ์ด์ง ํผ๋ธ๋ฆฌ์ฑ ์๋ฃ
[fix] ์บ๋ฆฐ๋, ์ง์ ํ ๋๋ฐ์ด์ปดํฌ๋ํธ ์์น css ์์
iamidlek
left a comment
There was a problem hiding this comment.
๊ณ ์ํ์
จ์ต๋๋ค.
์ค์ ๋ฐฐํฌ๋ ์ฌ์ดํธ๋ ์์ผ๋ ๋ก๊ทธ์ธ ์์ ๊ฐ์ด ์์ด ํ์ธ์ด ์ด๋ ต์ต๋๋ค
ํน์ ๋ก์ปฌ์์ ํ์ธ ํ ์ ์๊ฒ ํ๊ฒฝ ๋ณ์๋ฅผ ๊ณต์ ์ฃผ์๋ฉด
๋ฆฌ๋ทฐํ ๋ ๋ ์์ธํ ๋ณผ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค.
๋ฐ๋ณต๋ ๋ถ๋ถ์ ์ฝ๋ฉํธ ์๋ตํ์์ต๋๋ค.
ํด๋ ๊ฒฝ๋ก ๋์๋ฌธ์ ๋ฌธ์ ๋ก ์ฝ๋ ๋ฆฌ๋ทฐ์ ์ด๋ ค์์ด ๋ง์ด ์์์ต๋๋ค.
https://k1005.github.io/2021/07/31/naming-rules/#google_vignette
git commit ๋ฉ์ธ์ง๋ ์ผ๋ถ ์ปจ๋ฒค์ ์ด ์ ์ง์ผ์ง์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
๋ถํ์ํ ํ์ผ์ด PR์ ํฌํจ๋์ด์์ต๋๋ค. store.tsx
์ปจ๋ฒค์ ์์ด ๊ฐ์์ ์ฝ๋ ์คํ์ผ๋ก ์์ฑ๋์์ต๋๋ค.
๊ธฐ๋ณธ ํ๊ฒฝ ์ค์ ์ด (eslint ๋ฑ) ์ ๋๋ก ๋์ํ์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
import App from './App.tsx'; ์ ๊ฐ์ด .tsx ๊ฐ ์๋ต๋๋ฉด import ๋์ง ์๋ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
์บ๋ฆฐ๋ ๋ฑ ๋งค์ฐ ๋ณต์กํ๊ฒ ์์ฑ๋ ์ปดํฌ๋ํธ๋
๋ถํ์ํ ์ํ๋ useEffect ๋ฑ์ด ๊ณผํ๊ฒ ๋ง์ด ์์ฑ๋ ๊ฒฝ์ฐ๊ฐ ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
| "@fullcalendar/react": "^6.1.15", | ||
| "@mui/material": "^5.16.6", | ||
| "@reduxjs/toolkit": "^2.2.7", | ||
| "@types/react-router-dom": "^5.3.3", |
There was a problem hiding this comment.
devDependencies์ ์์ด์ผ ํ ๊ฒ ๊ฐ์ต๋๋ค.
package.json
Outdated
| "shortid": "^2.2.16", | ||
| "style-loader": "^4.0.0", | ||
| "uuid": "^10.0.0", | ||
| "vite": "^5.3.4" |
There was a problem hiding this comment.
๋์ผํ๊ฒ devDependencies์ ์์ด์ผ ํ ๊ฒ ๊ฐ์ต๋๋ค.
๊ฐ๋ฐ์ ํ์ํ ๊ฒ๊ณผ ์ค์ ๋ฐฐํฌ์ ํ์ํ ๋ด์ฉ์ด ๊ตฌ๋ถ๋๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
| { | ||
| "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"], | ||
| "plugins": ["@emotion"] | ||
| } |
There was a problem hiding this comment.
ํ์ํ ์ค์ ์ธ์ง ๊ถ๊ธํฉ๋๋ค.
src/store.tsx
Outdated
| import { configureStore, ThunkAction, Action } from '@reduxjs/toolkit'; | ||
| import modalSlice from './Reducers/ModalSlice.ts'; | ||
| import employeeSalarySlice from './Reducers/EmployeeSalarySlice.tsx'; | ||
| import calendarSlice from './Reducers/CalendarEventSlice.ts'; | ||
|
|
||
| const store = configureStore({ | ||
| reducer: { | ||
| modal: modalSlice, | ||
| employeeSalary: employeeSalarySlice, | ||
| calendar: calendarSlice, | ||
| }, | ||
| }); | ||
|
|
||
| export type RootState = ReturnType<typeof store.getState>; | ||
| export type AppDispatch = typeof store.dispatch; | ||
| export type AppThunk<ReturnType = void> = ThunkAction<ReturnType, RootState, unknown, Action<string>>; | ||
|
|
||
| export default store; |
There was a problem hiding this comment.
tsx ํ์ฅ์๊ฐ ์๋๋ฉฐ ts ํ์ผ์ด ์์ผ๋ฏ๋ก ์ง์์ ธ์ผํ ํ์ผ์ผ๊ฒ ๊ฐ์ต๋๋ค.
There was a problem hiding this comment.
store.tsx ์ญ์ ํ๊ณ tsx๊ฐ ์๋ ํ์ผ๋ค์ ๋ค์ tsํ์ผ๋ก ์์ ํ์ต๋๋ค!
| import { RouterProvider, createBrowserRouter } from 'react-router-dom'; | ||
| import store from './store.tsx'; | ||
| import App from './App.tsx'; | ||
| import Error from './Pages/Error.tsx'; |
There was a problem hiding this comment.
pagesํด๋๋ ์๋ฌธ์์ธ๋ฐ import ๊ฒฝ๋ก๋ ๋๋ฌธ์๋ก ๋์ด์์ด
window์์ ์๋ฌ๊ฐ ๋ฐ์ํฉ๋๋ค.
| const memberPromises = membersSnapshot.docs.map(async (memberDoc) => { | ||
| const collectionSnapshot = await getDocs(collection(db, `members/${memberDoc.id}/payrollCorApp`)); | ||
|
|
||
| const payDataPromises = collectionSnapshot.docs.map(async (payDataDoc) => { | ||
| const payDataId = payDataDoc.id; | ||
| const payData = payDataDoc.data(); | ||
|
|
||
| if (payData.name === name && payData.month === month && payData.correctionDetails === correctionDetails) { | ||
| await setDoc(doc(db, `members/${memberDoc.id}/payrollCorApp`, payDataId), { | ||
| name: payData.name, | ||
| month: payData.month, | ||
| correctionState: state, | ||
| correctionDetails: payData.correctionDetails, | ||
| reasonForApplication: payData.reasonForApplication, | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| await Promise.all(payDataPromises); | ||
| }); | ||
|
|
||
| await Promise.all(memberPromises); |
There was a problem hiding this comment.
์ค์ฒฉ๋ map ๋ด์์ ์ฌ๋ฌ ์์ฒญ์ ๋ ๋ฆด ์ ๋ฐ์ ์๋ ๊ตฌ์กฐ์ธ๊ฐ์?
| import { css } from '@emotion/react'; | ||
| import Select from '../Select'; | ||
|
|
||
| const customSelectStyles = css` |
There was a problem hiding this comment.
์ด๋ชจ์
css ๋ด์ฉ์ด ํ์ผ๋ง๋ค
์ปดํฌ๋ํธ ์์, ๋ด๋ถ, ํ์์ ๊ฐ๊ฐ ์ ํ์์ด
๋ง์ถฐ์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
| // ์ด ์ง๊ธ์ก | ||
| const sumPay = (payData.baseSalary + payData.weeklyHolidayAllowance + payData.additionalAllowance) | ||
| .toFixed(0) | ||
| .replace(/\B(?=(\d{3})+(?!\d))/g, ','); |
There was a problem hiding this comment.
์ด๋ค ์ฒ๋ฆฌ์ธ์ง ๋ณ์๋ช ์ผ๋ก ๊ด๋ฆฌ๋๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
There was a problem hiding this comment.
๋ณ์๋ช ์์ ํ์ต๋๋ค!!
| .toFixed(0) | ||
| .replace(/\B(?=(\d{3})+(?!\d))/g, ','); |
There was a problem hiding this comment.
์ฒ๋ฆฌ๊ฐ ๋ฐ๋ณต๋๊ณ ์์ด ํจ์๋ก ๋นผ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
There was a problem hiding this comment.
๋ฐ๋ณต๋๋ ์ฒ๋ฆฌ๋ ํจ์๋ก ๋ณ๊ฒฝํ์ต๋๋ค!
| // ๊ทธ ์ธ ๋๋จธ์ง pay | ||
| const payArr = []; | ||
| for (let i = 0; i < Object.values(payData).length; i++) { | ||
| payArr.push( |
There was a problem hiding this comment.
for of ํน์ for in ์ฌ์ฉ์ ์ถ์ฒ๋๋ฆฝ๋๋ค.
There was a problem hiding this comment.
map์ ์ฌ์ฉํ์ฌ ์์ ํ์ต๋๋ค!
[Refactor] ์ฝ๋์์ ๋ฐ tsํ์ผ๋ก ๋ณต๊ตฌ
[Refector] ๊ธ์ฌ์์ ์ ์์ ๋์ง์์ผ๋ฉด ๋ฒํผ์ด ์ ์ง๋๋๋ก ์์
โฆinto fix/employee-87
[Refactor] ์ง์๋ฆฌ์คํธ ํ์ด์ง ๋ฆฌํฉํ ๋ง
[Refactor] ์ผ์ ๊ด๋ฆฌํ์ด์ง ๋ฆฌํํ ๋ง
โฆinto refactor/code-refactoring-89
[๋ฆฌํฉํ ๋ง] ์ฝ๋ ๋ฆฌํฉํ ๋ง
[Refactor] ์ค๋ณต ํด๋ ์ญ์
dev ๋ธ๋์น๋ฅผ main ๋ธ๋์น๋ก ๋จธ์ง
์ฝ๋๋ฆฌ๋ทฐ์ฉ PR์ ๋๋ค!