-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
249 additions
and
82 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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
interface MemberRequest { | ||
nickname: string; | ||
survey: string; | ||
profileImageUrl: string; | ||
password: string; | ||
ageType: string; | ||
genderType: string; | ||
} | ||
|
||
interface SelectOption { | ||
id: string; | ||
value: string; | ||
} |
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
89 changes: 66 additions & 23 deletions
89
src/components/Auth/SignupInfo/AuthDropDown/AuthDropDownOption.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 |
---|---|---|
@@ -1,28 +1,71 @@ | ||
import { DownIcon } from '@components/common/icons/Icons'; | ||
import { CheckIcon, DownIcon } from '@components/common/icons/Icons'; | ||
import * as Select from '@radix-ui/react-select'; | ||
import React, { ReactNode, Ref } from 'react'; | ||
|
||
interface Props { | ||
children: string; | ||
clickHandler?: VoidFunction; | ||
showDownIcon?: boolean; | ||
// interface Props { | ||
// children: string; | ||
// clickHandler?: VoidFunction; | ||
// showDownIcon?: boolean; | ||
// } | ||
|
||
// const AuthDropDownOption = ({ | ||
// children, | ||
// clickHandler, | ||
// showDownIcon = false, | ||
// }: Props) => { | ||
// return ( | ||
// <button | ||
// onClick={clickHandler} | ||
// className="relative h-12 w-full border-b border-solid border-gray3 hover:bg-gray1"> | ||
// {children} | ||
// {showDownIcon && ( | ||
// <div className="absolute right-2 top-4"> | ||
// <DownIcon size={20} color="#888888" /> | ||
// </div> | ||
// )} | ||
// </button> | ||
// ); | ||
// }; | ||
|
||
// export default AuthDropDownOption; | ||
|
||
// const AuthDropDownOption = ({ children }: Props) => { | ||
// return ( | ||
// <Select.Item> | ||
// <Select.ItemText>{children}</Select.ItemText> | ||
// <Select.ItemIndicator className="absolute left-0 inline-flex w-[25px] items-center justify-center"> | ||
// {/* <CheckIcon /> */} | ||
// </Select.ItemIndicator> | ||
// </Select.Item> | ||
// ); | ||
// }; | ||
|
||
// export default AuthDropDownOption; | ||
|
||
interface SelectItemProps { | ||
value: string; | ||
children: ReactNode; | ||
className?: string; | ||
disabled?: boolean; | ||
} | ||
|
||
const AuthDropDownOption = ({ | ||
children, | ||
clickHandler, | ||
showDownIcon = false, | ||
}: Props) => { | ||
return ( | ||
<button | ||
onClick={clickHandler} | ||
className="relative h-12 w-full border-b border-solid border-gray3 hover:bg-gray1"> | ||
{children} | ||
{showDownIcon && ( | ||
<div className="absolute right-2 top-4"> | ||
<DownIcon size={20} color="#888888" /> | ||
</div> | ||
)} | ||
</button> | ||
); | ||
}; | ||
const AuthDropDownOption = React.forwardRef( | ||
( | ||
{ children, className, ...props }: SelectItemProps, | ||
forwardedRef: Ref<HTMLDivElement>, | ||
) => { | ||
return ( | ||
<Select.Item | ||
className="body5 relative flex h-12 w-full select-none items-center border-b border-solid border-gray3 pl-[25px] pr-[35px] text-gray6 hover:bg-gray1" | ||
{...props} | ||
ref={forwardedRef}> | ||
<Select.ItemText>{children}</Select.ItemText> | ||
<Select.ItemIndicator className="absolute left-0 inline-flex w-[25px] items-center justify-center"> | ||
<CheckIcon /> | ||
</Select.ItemIndicator> | ||
</Select.Item> | ||
); | ||
}, | ||
); | ||
|
||
export default AuthDropDownOption; |
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
Oops, something went wrong.