diff --git a/src/components/Modal/index.tsx b/src/components/Modal/index.tsx
index 33db0bc..f2969ee 100644
--- a/src/components/Modal/index.tsx
+++ b/src/components/Modal/index.tsx
@@ -32,7 +32,7 @@ const ModalOverlay = ({
return (
void
+}
+
+const SelectOption = ({ text, selected, onSelect }: SelectOptionProps) => {
+ return (
+
onSelect(text)}
+ className="ml-1.5 grid grid-cols-[13px_minmax(0,1fr)] items-center justify-items-start gap-1 border-b-[0.5px] border-b-gray-200 py-1.5 text-sm active:bg-gray-100"
+ >
+ {selected ? :
}
+ {text}
+
+ )
+}
+
+interface SelectProps {
+ value: string
+ options: string[]
+ onSelect: (value: string) => void
+}
+
+const Select = ({ value, options, onSelect }: SelectProps) => {
+ const [isOpen, setIsOpen] = useState(false)
+
+ const onSelectItem = (selectedValue: string) => {
+ onSelect(selectedValue)
+ setIsOpen(false)
+ }
+
+ return (
+
+
setIsOpen((prev) => !prev)}
+ >
+ {value}
+ {isOpen ? : }
+
+ {isOpen && (
+
+ {options.map((option) => (
+
+ ))}
+
+ )}
+
+ )
+}
+
+export default Select
diff --git a/src/components/TextArea/index.tsx b/src/components/TextArea/index.tsx
new file mode 100644
index 0000000..617bd6d
--- /dev/null
+++ b/src/components/TextArea/index.tsx
@@ -0,0 +1,54 @@
+'use client'
+
+import { ChangeEvent, useRef } from 'react'
+import { twMerge } from 'tailwind-merge'
+
+interface TextInputProps {
+ value: string
+ setValue: (value: string) => void
+ hasError: boolean
+ description: string
+ errorMessage: string
+ placeholder: string
+}
+
+const TextInput = ({
+ value,
+ setValue,
+ hasError,
+ description,
+ errorMessage,
+ placeholder,
+}: TextInputProps) => {
+ const borderClass = twMerge(
+ 'flex items-center mb-2 border-b ',
+ hasError ? 'border-negative' : 'border-gray-950',
+ )
+ const textareaRef = useRef
(null)
+
+ return (
+
+
+
+
+ {hasError ? errorMessage : description}
+
+
+ )
+}
+
+export default TextInput
diff --git a/src/lib/api/index.ts b/src/lib/api/index.ts
index 9f6a8cc..d272d7c 100644
--- a/src/lib/api/index.ts
+++ b/src/lib/api/index.ts
@@ -2,3 +2,4 @@ export * from './board'
export * from './file'
export * from './polaroid'
export * from './auth'
+export * from './user'
diff --git a/src/lib/api/user.ts b/src/lib/api/user.ts
index 7af2c1c..a64176e 100644
--- a/src/lib/api/user.ts
+++ b/src/lib/api/user.ts
@@ -1,7 +1,14 @@
-import { put } from './base'
+import { put } from '@/lib/api/base'
+import { WithdrawUserPayload } from '@/types'
-export const changeNickname = async (nickName: string): Promise => {
- await put('/api/v1/user/nickname', {
+export const withdraw = async (body: WithdrawUserPayload) => {
+ return put('/api/v1/user/withdraw', {
+ body: JSON.stringify(body),
+ })
+}
+
+export const changeNickname = async (nickName: string) => {
+ return put('/api/v1/user/nickname', {
body: JSON.stringify({ nickName }),
})
}
diff --git a/src/types/index.ts b/src/types/index.ts
index 0a38bec..3ae1f14 100644
--- a/src/types/index.ts
+++ b/src/types/index.ts
@@ -2,3 +2,4 @@ export * from './board'
export * from './polaroid'
export * from './file'
export * from './auth'
+export * from './user'
diff --git a/src/types/user.ts b/src/types/user.ts
new file mode 100644
index 0000000..4fec770
--- /dev/null
+++ b/src/types/user.ts
@@ -0,0 +1,4 @@
+export type WithdrawUserPayload = {
+ type: string
+ reason: string
+}