Skip to content

Commit

Permalink
Merge pull request #88 from DDD-Community/feature/80
Browse files Browse the repository at this point in the history
[Feature/80] 내 보드 목록 페이지 구현
  • Loading branch information
junseublim authored Aug 19, 2024
2 parents 2abb3c1 + c04409f commit a956ceb
Show file tree
Hide file tree
Showing 24 changed files with 567 additions and 99 deletions.
10 changes: 10 additions & 0 deletions public/icons/arrow_right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/icons/ellipsis.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions public/icons/empty_board.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/icons/pagination_left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/icons/pagination_left_disabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/icons/pagination_right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/icons/pagination_right_disabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 7 additions & 14 deletions src/app/(board)/board/create/components/BoardNameForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

import Button from '@/components/Button'
import TextInput from '@/components/TextInput'
import { postBoard } from '@/lib'
import { useRouter } from 'next/navigation'
import { ReactNode, useState } from 'react'

const MAX_BOARD_NAME_LENGTH = 15

const BoardNameForm = ({ children }: { children: ReactNode }) => {
interface BoardNameFormProps {
children: ReactNode
createBoard: (title: string) => void
}

const BoardNameForm = ({ children, createBoard }: BoardNameFormProps) => {
const [title, setTitle] = useState('')
const [hasError, setHasError] = useState(false)
const isEmpty = title.length === 0
const router = useRouter()

const onInput = (value: string) => {
setTitle(value)
Expand All @@ -23,15 +25,6 @@ const BoardNameForm = ({ children }: { children: ReactNode }) => {
}
}

const createBoard = async () => {
const boardId = await postBoard({
title,
userId: null,
})

router.push(`/board/${boardId}`)
}

return (
<>
<div>
Expand All @@ -52,7 +45,7 @@ const BoardNameForm = ({ children }: { children: ReactNode }) => {
size="lg"
className="mb-12"
disabled={hasError || isEmpty}
onClick={createBoard}
onClick={() => createBoard(title)}
>
완료
</Button>
Expand Down
Loading

0 comments on commit a956ceb

Please sign in to comment.