-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ISSUE-45] feat: 회원가입 페이지 input field 제외 UI 추가 완료 (#31)
- Loading branch information
1 parent
aabcc58
commit feec618
Showing
2 changed files
with
116 additions
and
13 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
'use client'; | ||
|
||
import { FaLock, FaUserAlt } from 'react-icons/fa'; | ||
import styled from 'styled-components'; | ||
|
||
import { COLORS, TEXT_COLORS } from '../../../../constants/colors'; | ||
import { FONTS } from '../../../../constants/font'; | ||
|
||
const SignUpInput = ({ | ||
name, | ||
value, | ||
type = 'text', | ||
placeholder = '', | ||
onChange, | ||
passwordVisible, | ||
togglePasswordVisibility, | ||
}) => { | ||
return ( | ||
<InputWrapper> | ||
<IconWrapper>{type === 'id' ? <FaUserAlt /> : <FaLock />}</IconWrapper> | ||
<Divider /> {/* 세로 줄 추가 */} | ||
<StyledInput | ||
type={type === 'password' && !passwordVisible ? 'password' : 'text'} | ||
name={name} | ||
value={value} | ||
placeholder={placeholder} | ||
onChange={onChange} | ||
/> | ||
{type === 'password' && ( | ||
<ShowButton onClick={togglePasswordVisibility}>{passwordVisible ? 'Hide' : 'Show'}</ShowButton> | ||
)} | ||
</InputWrapper> | ||
); | ||
}; | ||
|
||
export default SignUpInput; | ||
|
||
const InputWrapper = styled.div` | ||
width: 100%; | ||
height: 3rem; | ||
display: flex; | ||
align-items: center; | ||
background-color: ${COLORS.softMint}; | ||
border-radius: 0.5rem; | ||
padding: 0.75rem; | ||
position: relative; | ||
`; | ||
|
||
const StyledInput = styled.input` | ||
flex-grow: 1; | ||
background-color: ${COLORS.softMint}; | ||
border: none; | ||
font-family: ${FONTS.PRETENDARD[400]}; | ||
font-size: 1rem; | ||
color: ${TEXT_COLORS.default}; | ||
&::placeholder { | ||
color: ${TEXT_COLORS.placeholder}; | ||
} | ||
&:focus { | ||
outline: none; | ||
border: none; | ||
} | ||
`; | ||
|
||
const IconWrapper = styled.div` | ||
padding-right: 0.5rem; | ||
color: ${COLORS.primary}; | ||
`; | ||
|
||
const Divider = styled.div` | ||
width: 0.0625rem; /* 1px */ | ||
height: 100%; | ||
background-color: ${COLORS.mint}; /* 옅은 세로줄 색상 */ | ||
margin-right: 0.5rem; /* 세로 줄과 입력 필드 사이의 간격 */ | ||
`; | ||
|
||
const ShowButton = styled.button` | ||
background: none; | ||
border: none; | ||
color: ${COLORS.primary}; | ||
cursor: pointer; | ||
padding: 0 0.5rem; | ||
font-size: 0.875rem; | ||
position: absolute; | ||
right: 10px; | ||
&:focus { | ||
outline: none; | ||
} | ||
`; |
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