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์ฃผ์ฐจ ๊ณผ์ œ ] ๐Ÿฃ ์นด๋“œ๊ฒŒ์ž„ TypeScript ์ „ํ™˜ ๐Ÿฃ #21

Merged
merged 31 commits into from
Aug 1, 2023

Conversation

Chanwoo-Jeong
Copy link
Member

โœจ ๊ตฌํ˜„ ๊ธฐ๋Šฅ ๋ช…์„ธ

1๏ธโƒฃ jsx โ†’ tsx ๋กœ ๋ชจ๋‘ ๋ณ€ํ™˜ํ•ด์ฃผ์„ธ์š”! โœ”๏ธ
2๏ธโƒฃ recoil๋กœ ์นด๋“œ ๊ฒŒ์ž„์—์„œ ํ•„์š”ํ•œ ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•ด์ฃผ์„ธ์š”! โœ”๏ธ


๐ŸŒผ PR Point

1๏ธโƒฃ ๋ชจ๋“  ํ”„๋กญ ๋“œ๋ฆด๋ง์„ ์ œ๊ฑฐํ•˜์˜€์Šต๋‹ˆ๋‹ค.
image

2๏ธโƒฃ Recoil ๋กœ ์ „์—ญ์ƒํƒœ๊ด€๋ฆฌ๋ฅผ ์ง„ํ–‰ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
image

3๏ธโƒฃ Atom ์—๋„ interface ๋ฅผ ์ง€์ •ํ•ด์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค.
image

4๏ธโƒฃ interface Card ๋ฅผ ์ง€์ •ํ•ด์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค.
image

5๏ธโƒฃ ์นด๋“œ ๋งค์นญ interface ๋ฅผ ์ง€์ •ํ•ด์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค.
image


๐Ÿฅบ ์†Œ์š” ์‹œ๊ฐ„, ์–ด๋ ค์› ๋˜ ์ 

  • 5h
  • ์ฒ˜์Œ ts ๋กœ ์ „ํ™˜ํ• ๋•Œ ์ดˆ๊ธฐ์…‹ํŒ…์ด ์ฒ˜์Œํ•ด๋ณด๋Š”๊ฑฐ๋ผ ์‚ด์ง ์–ด๋ ค์› ์Šต๋‹ˆ๋‹ค.

๐ŸŒˆ ๊ตฌํ˜„ ๊ฒฐ๊ณผ๋ฌผ

image

Chanwoo-Jeong and others added 30 commits May 8, 2023 23:21
Copy link

@lydiacho lydiacho left a comment

Choose a reason for hiding this comment

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

๋„ˆ๋ฌด๋„ˆ๋ฌด ์ˆ˜๊ณ  ๋งŽ์•˜๋‹ค~~~ ๋ฆฌ์ฝ”์ผ ์•ผ๋ฌด์ง€๊ฒŒ ์ผ๋„ค!! ํƒ€์Šค ํƒ€์ž…์ง€์ •๋„ ์ตœ๋Œ€ํ•œ ์ด๊ณณ์ €๊ณณ์— ๊ผผ๊ผผํžˆ ํ•ด์ฃผ๋ ค๊ณ  ๋…ธ๋ ฅํ•ด๋ณด์žฅ ํ™”์ด๋ง~~

modalOpenAtom,
} from "../atoms/atom";

const ModalWrapper = styled.div`
Copy link

Choose a reason for hiding this comment

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

styled components ์‚ฌ์šฉํ•  ๋•Œ๋„ ์šฐ๋ฆฌ๊ฐ€ ์ฒ˜์Œ์— ๋ชฉํ‘œํ–ˆ๋˜ '์‹œ๋งจํ‹ฑ ํƒœ๊ทธ' ์žŠ์ง€๋ง์ž!!

Comment on lines +33 to +39
margin-top: 2rem;
padding: 1rem;
border: none;
background-color: palevioletred;
color: white;
font-weight: 600;
cursor: pointer;
Copy link

Choose a reason for hiding this comment

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

์šฐ๋ฆฌ ๊ณง ์›น์žผํ•˜๋‹ˆ๊นŒ ๋Œ€๋ถ€๋ถ„์˜ ์›จ๋น„๋“ค์ด ์ฑ„ํƒํ•˜๋Š” ์ปจ๋ฒค์…˜์ธ css ์ˆœ์„œ ์ง€ํ‚ค๊ธฐ & ๊ฐœํ–‰์œผ๋กœ ๋ถ„๋ฅ˜ํ•ด์ฃผ๊ธฐ๋ฅผ ๋Š˜์ƒ ์—ฐ์Šตํ•ด๋‘๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™๋‹ด. ์ƒํ™œํ™”ํ•ฉ์‹œ๋‹ค!

const Confetti = styled.div`
position: absolute;
top: -1rem;
left: ${() => Math.random() * 1000}rem;
Copy link

Choose a reason for hiding this comment

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

์˜ผใ…‹ใ…‹ใ…‹ ์ด๋Ÿฐ์‹์œผ๋กœ ๋ฟŒ๋ ค์ฃผ๋Š”๊ตฌ๋‚˜

Comment on lines +73 to +75
const setDifficultyFn = useSetRecoilState(difficultyAtom);
const setMatchingCardsArr = useSetRecoilState(matchingCardsAtom);
const setMatchedCardsArr = useSetRecoilState(matchedCardsAtom);
Copy link

Choose a reason for hiding this comment

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

์š”๊ธฐ Recoil ์„ธํ„ฐ๋“ค๋„ ํƒ€์ž…์ง€์ • ํ•ด์ฃผ์ž!! useSetRecoilState<ํƒ€์ž…>(~) ์ด๋Ÿฌ์ผ€

Comment on lines +83 to +84
/** ๋ชจ๋‹ฌ ์—ด๊ณ  ๋‹ซ๋Š” useState */
const setIsModalOpen = useSetRecoilState(modalOpenAtom);
Copy link

Choose a reason for hiding this comment

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

useRecoilState ์• ๋“ค๋ผ๋ฆฌ ํ•จ์ˆ˜ ์ƒ๋‹จ์— ๋ญ‰์ณ๋‘๋ฉด ์ข‹์„๊ฑฐ๊ฐ€ํƒ€!

Comment on lines +32 to +34
const reRandomCardList = setRandomCardList(
setRandomCardList(setRandomCardList(setRandomCardList(gamePokemonList)))
);
Copy link

Choose a reason for hiding this comment

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

ํ—‰ใ…‹ใ…‹ใ…‹ใ…‹ setRandomCardList ํ•จ์ˆ˜ ๋‚ด์—์„œ๋„ ๋žœ๋ค์„ ๋‘๋ฒˆ์ด๋‚˜ ํ•ด์ฃผ๋˜๋ฐ ๋„ค๋ฒˆ์ด๋‚˜ ์‹คํ–‰ํ•ด์ค˜์•ผํ•˜๋Š” ์ด์œ ๊ฐ€ ์ž‡์„๊นŒ?? ๋ถˆํ•„์š”ํ•œ ํ•จ์ˆ˜ ์‹คํ–‰์„ ์Œ“์•„๋ฒ„๋ฆฌ์ง„ ์•Š์„์ง€?-?

@@ -0,0 +1,76 @@
export const POKEMON_LIST = [
Copy link

Choose a reason for hiding this comment

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

์ธํ„ฐํŽ˜์ด์Šค๋กœ ์š” ๋ฐฐ์—ด๋ฐ์ดํ„ฐ ํƒ€์ž…๋„ ์ง€์ •ํ•ด์ฃผ๋ฉด ์ข‹์„๊ฑฐ๊ฐ€ํƒ€!

@@ -0,0 +1,42 @@
import { atom } from "recoil";

export const darkModeAtom = atom({
Copy link

Choose a reason for hiding this comment

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

์–˜๋„ค๋„ ํƒ€์ž…์ง€์ •ํ•ด์ฃผ์ž!

Suggested change
export const darkModeAtom = atom({
export const darkModeAtom = atom<boolean>({

currentDifficulty: string;
}

interface DifficultyButtonProps extends DifficultyBtnWrapperProps {
Copy link

Choose a reason for hiding this comment

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

์˜ค extends๊นŒ์ง€ ์‚ฌ์šฉ ใ…‹ใ…‹ใ…‹ใ…‹ ์„ธ๋ฏธ๋‚˜์—์„œ ๋ฐฐ์šด๊ฑฐ ์•ผ๋ฌด์ง€๊ฒŒ ํ™œ์šฉํ–ˆ๋Š”๋ฐ??

Comment on lines +227 to +230
</div>
</div>
</div>
</div>
Copy link

Choose a reason for hiding this comment

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

div ๊ฐˆ๊ธฐ๊ธฐ ๋ฉˆ์ถฐ์–ด์–ดใ…“ใ…“์–ด์–ด์–ด์–ด์—‰

Copy link

@seojisoosoo seojisoosoo left a comment

Choose a reason for hiding this comment

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

์—ญ์‹œ ๋ฏฟ์—ˆ๋‹ค๊ตฌ ์ฐจ๋ˆ„~ ์ด์ œ... ํ•˜์‚ฐํ•˜์‹œ์ง€์š” ์„ ์ƒ๋‹˜!

import { RecoilRoot, useRecoilValue } from "recoil";
import { darkModeAtom } from "./atoms/atom";

const GlobalStyle = createGlobalStyle`

Choose a reason for hiding this comment

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

๊ธ€๋กœ๋ฒŒ ์Šคํƒ€์ผ์€ ๋”ฐ๋กœ styleํด๋”๋ฅผ ๋งŒ๋“ค์–ด์„œ ๋„ฃ์–ด์ฃผ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์šฉ~!


overflow: scroll;
overflow-x: hidden;
background-color: ${(props) => props.theme.bgColor};

Choose a reason for hiding this comment

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

Suggested change
background-color: ${(props) => props.theme.bgColor};
background-color: ${({theme}) =>theme.bgColor};

์ด๋ ‡๊ฒŒ๋„ ์“ธ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™๋„ค์šฉ

Comment on lines +58 to +65
{howManyCorrect} /{" "}
{
{
Easy: "5",
Normal: "7",
Hard: "9",
}[currentDifficulty]
}

Choose a reason for hiding this comment

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

์šฐ์™•! ์ด๊ฑฐ๋Š” ๋ญ์—์šฉ??

}

interface DifficultyButtonProps extends DifficultyBtnWrapperProps {
children: React.ReactNode;

Choose a reason for hiding this comment

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

์˜ค ์น ๋“œ๋Ÿฐ์€ ํƒ€์ž…์ด ์ด๋ ‡๊ฒŒ ์“ฐ์ด๋Š”๊ตฐํ•˜!! ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค~

`;

interface CardProps {
Primarykey: number;

Choose a reason for hiding this comment

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

์ด ๋ณ€์ˆ˜๋Š” ์™œ ๋Œ€๋ฌธ์ž๋กœ ์‹œ์ž‘ํ•ด์šฉ???

@Chanwoo-Jeong Chanwoo-Jeong merged commit c536b43 into main Aug 1, 2023
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.

3 participants