-
Notifications
You must be signed in to change notification settings - Fork 8
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
[FE] 인풋 컴포넌트 디자인 수정 및 로그인 페이지 디자인 수정 #417
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f080eb1
chore: ios 기기에서 버튼 텍스트 색상이 파란색으로 보였던 문제 해결
hwinkr ae22916
chore: BottomFixedButton 높이 수정
hwinkr 0a1d4e6
feat: floating 스타일, 타입 추가
hwinkr 87084c9
feat: FloatingInput 구현
hwinkr 94ee0cb
feat: 어떤 입력 Field 인지 나타내는 Title 컴포넌트 생성
hwinkr f6dd55c
refactor: FloatingInput을 사용해서 약속을 생성하는 것으로 변경
hwinkr d7d0c13
chore: DESCRIPTION, ERROR_MESSAGE를 구분
hwinkr 8e8beb7
feat: 스크롤을 막는 컴포넌트 구현
hwinkr e92fa4a
refactor: 약속 참여자 로그인 페이지 로직, 스타일 수정
hwinkr 4f5acae
refactor: 도메인 정책 변경으로 인한, 1년 뒤의 약속을 생성하려고 하는 경우 토스트 메시지로 알려주는 로직 추가
hwinkr 80d1286
design: css 컨벤션을 맞추기 위해 rem으로 수정
hwinkr 490ddeb
refactor: FloatingLabelInput으로 컴포넌트명 수정, 불필요햔 isFocused 상태 제거
hwinkr 4b21dc5
chore: 컴포넌트명 변경 사항 반영, 버튼 텍스트 상수화 파일명 수정
hwinkr af03a30
chore: 직관적인 함수명을 사용하는 것으로 수정
hwinkr 9e56798
chore: IOS 기기에서 드롭다운 텍스트가 파란색으로 보이는 문제 해결
hwinkr 8777484
chore: css 선언 순서 수정
hwinkr 317546c
refactor: 달(Month)를 이동시키는 함수 추상화
hwinkr 47dae2c
test: 1년 범위를 벗어난 경우 토스트 UI를 활용해서 피드백을 전달하는 책임 테스트 추가
hwinkr eba1fca
chore: 테스트 환경에서 절대경로를 인식해야 하는 폴더 추가, svg를 자바스크립트 모듈로 바라볼 수 있도록 설정 추가
hwinkr 0329517
design: 바텀고정버튼 높이 수정 변경 반영
hwinkr 3308c01
chore: 불필요한 예외 처리 로직 제거
hwinkr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
frontend/src/components/FloatingInput/FloatingLabelInput.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import FloatingLabelInput from '.'; | ||
|
||
const meta = { | ||
title: 'Components/Inputs/FloatingLabelInput', | ||
component: FloatingLabelInput, | ||
argTypes: { | ||
label: { control: 'text' }, | ||
isError: { control: 'boolean' }, | ||
}, | ||
} satisfies Meta<typeof FloatingLabelInput>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
label: '낙타해리빙봉', | ||
placeholder: '송재석최현웅김윤경', | ||
isError: false, | ||
}, | ||
}; |
42 changes: 42 additions & 0 deletions
42
frontend/src/components/FloatingInput/FloatingLabelInput.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { css } from '@emotion/react'; | ||
|
||
import theme from '@styles/theme'; | ||
|
||
export const s_floatingLabelContainer = (isError: boolean) => css` | ||
position: relative; | ||
display: inline-block; | ||
width: 100%; | ||
color: ${isError ? '#EB1E1E' : '#71717a'}; | ||
|
||
&:focus-within label { | ||
color: ${isError ? '#EB1E1E' : theme.colors.pink.medium}; | ||
} | ||
`; | ||
|
||
export const s_floatingLabelInput = (isError: boolean) => css` | ||
appearance: none; | ||
box-shadow: ${isError ? `0 0 0 0.1rem #EB1E1E` : `0 0 0 0.1rem #71717a`}; | ||
transition: box-shadow 0.3s; | ||
|
||
&::placeholder { | ||
color: #71717a; | ||
} | ||
|
||
&:focus { | ||
box-shadow: ${isError | ||
? `0 0 0 0.1rem #EB1E1E` | ||
: `0 0 0 0.1rem ${theme.colors.pink.mediumLight}`}; | ||
} | ||
`; | ||
|
||
export const s_floatingLabel = () => css` | ||
position: absolute; | ||
top: 0.4rem; | ||
left: 1em; | ||
|
||
${theme.typography.captionMedium}; | ||
|
||
background: transparent; | ||
|
||
transition: color 0.3s; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type { InputProps } from '@components/_common/Input'; | ||
import Input from '@components/_common/Input'; | ||
|
||
import { | ||
s_floatingLabel, | ||
s_floatingLabelContainer, | ||
s_floatingLabelInput, | ||
} from './FloatingLabelInput.styles'; | ||
|
||
interface FloatingLabelInputProps extends InputProps { | ||
label: string; | ||
isError: boolean; | ||
} | ||
export default function FloatingLabelInput({ | ||
label, | ||
placeholder, | ||
isError, | ||
...props | ||
}: FloatingLabelInputProps) { | ||
return ( | ||
<div css={s_floatingLabelContainer(isError)}> | ||
<label css={s_floatingLabel} htmlFor={label}> | ||
{label} | ||
</label> | ||
<Input | ||
variant="floating" | ||
css={s_floatingLabelInput(isError)} | ||
placeholder={placeholder} | ||
id={label} | ||
{...props} | ||
/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { PropsWithChildren } from 'react'; | ||
import { useEffect, useRef } from 'react'; | ||
|
||
export default function ScrollBlock({ children }: PropsWithChildren) { | ||
const contentRef = useRef<HTMLDivElement>(null); | ||
|
||
useEffect(() => { | ||
const preventTouchMove = (e: TouchEvent) => { | ||
e.preventDefault(); | ||
}; | ||
|
||
// 터치 이벤트를 사용해서 스크롤을 할 경우, 해당 스크롤을 막는다는 것을 브라우저에게 명시적으로 알려주기 위해서 passive 속성 추가(@해리) | ||
document.addEventListener('touchmove', preventTouchMove, { passive: false }); | ||
|
||
return () => { | ||
document.removeEventListener('touchmove', preventTouchMove); | ||
}; | ||
}, []); | ||
|
||
return <div ref={contentRef}>{children}</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,10 @@ export const s_bottomFixedStyles = css` | |
|
||
/* 버튼 컴포넌트의 full variants를 사용하려고 했으나 6rem보다 height값이 작아 직접 높이를 정의했어요(@해리) | ||
full 버튼에 이미 의존하고 있는 컴포넌트들이 많아서 높이를 full 스타일을 변경할 수는 없었습니다. | ||
|
||
버튼의 높이가 너무 높다는 피드백을 반영하기 위해서 높이 수정 5.2rem(@해리) | ||
*/ | ||
height: 6rem; | ||
height: 5.2rem; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 제가 이전 PR에서 Funnel 마지막 단계인 날짜 선택 부분에서 BottomFixedButton에 가려지는 문제때문에 임시 div 요소를 추가했는데 해당 높이가 6rem으로 설정되어 있습니다. 한번 보고 같이 해결하면 좋을 듯 싶어요! 노션 링크의 🚀 약속 생성 시, BottomFixedButton에 가려지는 문제 확인 부분 확인하면 됩니다! |
||
box-shadow: 0 -4px 4px rgb(0 0 0 / 25%); | ||
`; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import { css } from '@emotion/react'; | ||
|
||
import theme from '@styles/theme'; | ||
|
||
export const s_dropdown = css` | ||
width: fit-content; | ||
height: 2.8rem; | ||
padding: 0.4rem; | ||
|
||
color: ${theme.colors.black}; | ||
|
||
border-radius: 0.4rem; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const MEETING_BUTTON_TEXTS = { | ||
create: '약속 생성하기', | ||
next: '다음', | ||
register: '등록하러 가기', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const TOAST_MESSAGES = { | ||
OUT_OF_ONE_YEAR_RANGE: '최대 1년뒤의 약속만 생성할 수 있어요', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { PropsWithChildren } from 'react'; | ||
|
||
import ToastProvider from '@contexts/ToastProvider'; | ||
|
||
// 필요한 _Provider 들은 유동적으로 추가해서 테스트 환경에서 사용할 수 있어요(@해리) | ||
export default function Providers({ children }: PropsWithChildren) { | ||
return <ToastProvider>{children}</ToastProvider>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { RenderOptions } from '@testing-library/react'; | ||
import { renderHook } from '@testing-library/react'; | ||
|
||
import Providers from './Providers'; | ||
|
||
export default function render<T>(callback: () => T, options?: Omit<RenderOptions, 'wrapper'>) { | ||
return renderHook(callback, { | ||
wrapper: Providers, | ||
...options, | ||
}); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Q]
어째서 0.04rem이 아니라 0.02rem일까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hw0603 페드로와 함께 달력 UI에 대해서 QA를 진행했었는데요..! 0.02rem이 사각형과 삼각형 사이의 간격을 최소화할 수 있는 위치인 것 같아서 이렇게 수정하게 되었습니다!