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

[Feature/BAR-6] WriteInput 작성 #8

Merged
merged 38 commits into from
Jan 10, 2024
Merged

[Feature/BAR-6] WriteInput 작성 #8

merged 38 commits into from
Jan 10, 2024

Conversation

wonjin-dev
Copy link
Member

@wonjin-dev wonjin-dev commented Dec 15, 2023

Summary

구현 내용 및 작업한 내역을 요약해서 적어주세요

  • TextArea Component 작성

To Reviewer

  • TextArea를 줄이는 로직에 관하여 의견이 궁금합니다.
  • 공통 Input PR을 작업하려고 했지만, 피그마를 보다보니 TextArea와 Input 두 가지 타입으로 보는게 맞다고 판단해서 제어 컴포넌트로 TextArea를 우선 작업하였습니다.
    • Input 작업시에 공통되는 부분을 리팩터링 예정입니다.

How To Test

PR의 기능을 확인하는 방법을 상세하게 적어주세요

브랜치 체크 아웃 이후 메인 페이지에서 확인

@wonjin-dev wonjin-dev self-assigned this Dec 15, 2023
@wonjin-dev wonjin-dev marked this pull request as ready for review January 5, 2024 14:02
pages/index.tsx Show resolved Hide resolved
plopfile.mjs Outdated Show resolved Hide resolved
src/hooks/useInput.ts Show resolved Hide resolved
@YAPP-Github YAPP-Github deleted a comment from github-actions bot Jan 5, 2024
@YAPP-Github YAPP-Github deleted a comment from github-actions bot Jan 5, 2024
@YAPP-Github YAPP-Github deleted a comment from github-actions bot Jan 5, 2024
@YAPP-Github YAPP-Github deleted a comment from github-actions bot Jan 5, 2024
@YAPP-Github YAPP-Github deleted a comment from github-actions bot Jan 5, 2024
@wonjin-dev wonjin-dev changed the title [Feature/BAR-6] Input 작성 [Feature/BAR-6] WriteInput 작성 Jan 6, 2024
@wonjin-dev wonjin-dev requested a review from dmswl98 January 7, 2024 13:47
@wonjin-dev wonjin-dev changed the title [Feature/BAR-6] WriteInput 작성 [Feature/BAR-6] WriteInput 작성 Jan 7, 2024
Copy link
Member

@dmswl98 dmswl98 left a comment

Choose a reason for hiding this comment

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

사소한 컨벤션 코멘트 남겨두었습니다! 수고하셨습니당

Comment on lines +1 to +2
import type { ChangeEvent } from 'react';
import { useState } from 'react';
Copy link
Member

Choose a reason for hiding this comment

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

@dongkyun-dev
이후에 같은 경로에서 import될 때 type을 inline으로 작성할 지 아니면 위처럼 분리해 작성할지
한 가지 방식으로 강제하는 rule을 추가하면 좋을 것 같습니다!

현재는 두가지 방식 다 작성 가능하도록 되어있더라고요.

Suggested change
import type { ChangeEvent } from 'react';
import { useState } from 'react';
import { useState, type ChangeEvent } from 'react';

Copy link
Contributor

Choose a reason for hiding this comment

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

@wonjin-dev @dmswl98
좋아요 혹시 선호하시는 방식 있으신가요?

Copy link
Member

Choose a reason for hiding this comment

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

@dongkyun-dev 저는 현재 코드에서 많이 사용된 방식으로 하면 좋을 것 같아요.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dmswl98
저는 개인적으로 분리하지 않고 하나의 라인에서 작성하는게 좋긴 한데....! 관련해서 린트룰을 찾아볼까요?

Copy link
Member

@dmswl98 dmswl98 Jan 9, 2024

Choose a reason for hiding this comment

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

@dongkyun-dev 그럼 이렇게 작성하시면 됩니다!!

'@typescript-eslint/consistent-type-imports': [
   'error',
   { fixStyle: 'inline-type-imports' },
],

Copy link
Contributor

Choose a reason for hiding this comment

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

@dmswl98
오오 혹시 반영해서 PR 작성해주실 수 있나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

린트 룰 추가하고 반영할때 일괄 fix 가시죵

src/components/Input/WriteInput/index.tsx Outdated Show resolved Hide resolved
Comment on lines 44 to 50
base: [
{
display: 'flex',
alignItems: 'flex-end',
paddingLeft: '20px',
},
],
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
base: [
{
display: 'flex',
alignItems: 'flex-end',
paddingLeft: '20px',
},
],
base: {
display: 'flex',
alignItems: 'flex-end',
paddingLeft: '20px',
},

이렇게 작성해주셔도 됩니다!

};

export const Icon: IconFactory = {
export const iconFactory = {
Copy link
Member

Choose a reason for hiding this comment

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

상수는 모두 UPPER_CASE로 작성해주시면 감사하겠습니당

Copy link
Member Author

Choose a reason for hiding this comment

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

요건 하드 코딩이 필요한 상수가 아니여서 변수로 사용하는 부분이어서 이렇게 처리하였습니다 !

@dmswl98 dmswl98 added the feature label Jan 8, 2024
Copy link
Contributor

@miro-ring miro-ring left a comment

Choose a reason for hiding this comment

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

고생하셧습니다!
간단히 수정되면 좋을 부분만 커멘트 남겨두엇습니다 ㅎㅎ

import WriteInput from '@/src/components/Input/WriteInput';
import { useInput } from '@/src/hooks/useInput';

const HomePage: NextPage = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

NextPage와 같은 타입 명시가 필요한가요?

Copy link
Member Author

Choose a reason for hiding this comment

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

자동으로 추론하지 못하기 때문에 필요합니당 !

maxLength = MAIN_INPUT_MAX_LENGTH,
}: WriteInputProps) => {
const { id, value } = inputProps;
const inputRef = useRef<HTMLTextAreaElement | null>(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

| null은 제거되어도 좋을 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

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

초기 값을 위해 필요한 부분입니다.

}

export const useInput = ({ id, defaultValue = '' }: UseInputArgs) => {
const [value, setValue] = useState<string>(defaultValue);
Copy link
Contributor

Choose a reason for hiding this comment

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

<string> 제네릭도 없어도 좋을 것 같습니다!

@wonjin-dev wonjin-dev merged commit 1d695c7 into main Jan 10, 2024
@wonjin-dev wonjin-dev deleted the feature/BAR-6 branch January 10, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants