Skip to content

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ ์ฝ”๋“œ๋ฆฌ๋ทฐ PR ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ#77

Open
ssumanlife wants to merge 185 commits into
codeReviewfrom
main
Open

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ ์ฝ”๋“œ๋ฆฌ๋ทฐ PR ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ#77
ssumanlife wants to merge 185 commits into
codeReviewfrom
main

Conversation

@ssumanlife
Copy link
Copy Markdown
Collaborator

@ssumanlife ssumanlife commented Aug 9, 2024

์ฝ”๋“œ๋ฆฌ๋ทฐ์šฉ PR์ž…๋‹ˆ๋‹ค!

James and others added 30 commits July 25, 2024 09:49
๋ฉ”์ธ๊ณผ ๊ฐœ๋ฐœ ๋ธŒ๋žœ์น˜ ๋™๊ธฐํ™”
[Feature] ์ž„์‹œ ๋ผ์šฐํŒ… ๊ธฐ๋Šฅ ๊ตฌํ˜„ ๋ฐ ํ—ค๋” ์Šคํƒ€์ผ๋ง
[Feature] Emotion์œผ๋กœ ๊ธ€๋กœ๋ฒŒ ์Šคํƒ€์ผ ์„ค์ •
[feature] ๋ฒ„ํŠผ, ๋ชจ๋‹ฌ์ฐฝ ์ปดํฌ๋„ŒํŠธ ์ž‘์„ฑ
[Feature] ์‚ฌ์žฅ๋‹˜ ๊ธ‰์—ฌ๋‚ด์—ญ ํŽ˜์ด์ง€ ํผ๋ธ”๋ฆฌ์‹ฑ ์™„๋ฃŒ
[fix] ์บ˜๋ฆฐ๋”, ์ง์› ํ™ˆ ๋””๋ฐ์ด์ปดํฌ๋„ŒํŠธ ์œ„์น˜ css ์ˆ˜์ •
Copy link
Copy Markdown

@iamidlek iamidlek left a comment

Choose a reason for hiding this comment

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

๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค.
์‹ค์ œ ๋ฐฐํฌ๋œ ์‚ฌ์ดํŠธ๋Š” ์žˆ์œผ๋‚˜ ๋กœ๊ทธ์ธ ์˜ˆ์‹œ ๊ฐ’์ด ์—†์–ด ํ™•์ธ์ด ์–ด๋ ต์Šต๋‹ˆ๋‹ค
ํ˜น์€ ๋กœ์ปฌ์—์„œ ํ™•์ธ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ๊ณต์œ ์ฃผ์‹œ๋ฉด
๋ฆฌ๋ทฐํ•  ๋•Œ ๋” ์ž์„ธํžˆ ๋ณผ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
๋ฐ˜๋ณต๋œ ๋ถ€๋ถ„์€ ์ฝ”๋ฉ˜ํŠธ ์ƒ๋žตํ•˜์˜€์Šต๋‹ˆ๋‹ค.

ํด๋” ๊ฒฝ๋กœ ๋Œ€์†Œ๋ฌธ์ž ๋ฌธ์ œ๋กœ ์ฝ”๋“œ ๋ฆฌ๋ทฐ์— ์–ด๋ ค์›€์ด ๋งŽ์ด ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.
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 ๋“ฑ์ด ๊ณผํ•˜๊ฒŒ ๋งŽ์ด ์ž‘์„ฑ๋œ ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Comment thread package.json
"@fullcalendar/react": "^6.1.15",
"@mui/material": "^5.16.6",
"@reduxjs/toolkit": "^2.2.7",
"@types/react-router-dom": "^5.3.3",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

devDependencies์— ์žˆ์–ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Comment thread package.json Outdated
"shortid": "^2.2.16",
"style-loader": "^4.0.0",
"uuid": "^10.0.0",
"vite": "^5.3.4"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

๋™์ผํ•˜๊ฒŒ devDependencies์— ์žˆ์–ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
๊ฐœ๋ฐœ์— ํ•„์š”ํ•œ ๊ฒƒ๊ณผ ์‹ค์ œ ๋ฐฐํฌ์— ํ•„์š”ํ•œ ๋‚ด์šฉ์ด ๊ตฌ๋ถ„๋˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Comment thread .babelrc
Comment on lines +1 to +4
{
"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"],
"plugins": ["@emotion"]
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ํ•„์š”ํ•œ ์„ค์ •์ธ์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค.

Comment thread src/store.tsx Outdated
Comment on lines +1 to +18
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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tsx ํ™•์žฅ์ž๊ฐ€ ์•„๋‹ˆ๋ฉฐ ts ํŒŒ์ผ์ด ์žˆ์œผ๋ฏ€๋กœ ์ง€์›Œ์ ธ์•ผํ•  ํŒŒ์ผ์ผ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

store.tsx ์‚ญ์ œํ•˜๊ณ  tsx๊ฐ€ ์•„๋‹Œ ํŒŒ์ผ๋“ค์€ ๋‹ค์‹œ tsํŒŒ์ผ๋กœ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค!

Comment thread src/main.tsx
import { RouterProvider, createBrowserRouter } from 'react-router-dom';
import store from './store.tsx';
import App from './App.tsx';
import Error from './Pages/Error.tsx';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

pagesํด๋”๋Š” ์†Œ๋ฌธ์ž์ธ๋ฐ import ๊ฒฝ๋กœ๋Š” ๋Œ€๋ฌธ์ž๋กœ ๋˜์–ด์žˆ์–ด
window์—์„œ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

Comment on lines +8 to +29
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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

์ค‘์ฒฉ๋œ map ๋‚ด์—์„œ ์—ฌ๋Ÿฌ ์š”์ฒญ์„ ๋‚ ๋ฆด ์ˆ˜ ๋ฐ–์— ์—†๋Š” ๊ตฌ์กฐ์ธ๊ฐ€์š”?

import { css } from '@emotion/react';
import Select from '../Select';

const customSelectStyles = css`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

์ด๋ชจ์…˜ css ๋‚ด์šฉ์ด ํŒŒ์ผ๋งˆ๋‹ค
์ปดํฌ๋„ŒํŠธ ์ƒ์œ„, ๋‚ด๋ถ€, ํ•˜์œ„์— ๊ฐ๊ฐ ์ ํ˜€์žˆ์–ด
๋งž์ถฐ์ฃผ์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

// ์ด ์ง€๊ธ‰์•ก
const sumPay = (payData.baseSalary + payData.weeklyHolidayAllowance + payData.additionalAllowance)
.toFixed(0)
.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

์–ด๋–ค ์ฒ˜๋ฆฌ์ธ์ง€ ๋ณ€์ˆ˜๋ช…์œผ๋กœ ๊ด€๋ฆฌ๋˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

๋ณ€์ˆ˜๋ช… ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค!!

Comment on lines +69 to +70
.toFixed(0)
.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

์ฒ˜๋ฆฌ๊ฐ€ ๋ฐ˜๋ณต๋˜๊ณ  ์žˆ์–ด ํ•จ์ˆ˜๋กœ ๋นผ๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

๋ฐ˜๋ณต๋˜๋Š” ์ฒ˜๋ฆฌ๋Š” ํ•จ์ˆ˜๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค!

// ๊ทธ ์™ธ ๋‚˜๋จธ์ง€ pay
const payArr = [];
for (let i = 0; i < Object.values(payData).length; i++) {
payArr.push(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

for of ํ˜น์€ for in ์‚ฌ์šฉ์„ ์ถ”์ฒœ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

map์„ ์‚ฌ์šฉํ•˜์—ฌ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค!

ssumanlife and others added 27 commits August 13, 2024 14:44
[Refactor] ์ฝ”๋“œ์ˆ˜์ • ๋ฐ tsํŒŒ์ผ๋กœ ๋ณต๊ตฌ
[Refector] ๊ธ‰์—ฌ์ˆ˜์ •์‹œ ์ˆ˜์ •๋˜์ง€์•Š์œผ๋ฉด ๋ฒ„ํŠผ์ด ์œ ์ง€๋˜๋„๋ก ์ˆ˜์ •
[Refactor] ์ง์›๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง€ ๋ฆฌํŒฉํ† ๋ง
[Refactor] ์ผ์ •๊ด€๋ฆฌํŽ˜์ด์ง€ ๋ฆฌํŽ™ํ† ๋ง
[๋ฆฌํŒฉํ† ๋ง] ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง
[Refactor] ์ค‘๋ณต ํด๋” ์‚ญ์ œ
dev ๋ธŒ๋žœ์น˜๋ฅผ main ๋ธŒ๋žœ์น˜๋กœ ๋จธ์ง€
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants