-
Notifications
You must be signed in to change notification settings - Fork 0
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
7 changed files
with
213 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,30 +1,39 @@ | ||
import { Plus } from '@phosphor-icons/react' | ||
import { Plus, Trash } from '@phosphor-icons/react' | ||
import { useRouter } from 'next/router' | ||
|
||
interface TaskListHeaderProps { | ||
showAddButton?: boolean | ||
listTitle: string | ||
titleRoute?: string | ||
} | ||
|
||
export function TaskListHeader({ | ||
listTitle, | ||
showAddButton = false, | ||
}: TaskListHeaderProps) { | ||
const router = useRouter() | ||
|
||
return ( | ||
<div className="flex w-full items-center justify-between"> | ||
<span className="text-xl font-medium text-text">{listTitle}</span> | ||
{showAddButton && ( | ||
<button | ||
type="button" | ||
onClick={() => { | ||
router.push('/add-task') | ||
}} | ||
className="flex min-w-button items-center justify-center gap-1.5 rounded-md bg-white px-3 py-2.5 text-center text-xs font-medium text-text shadow-sm " | ||
> | ||
<Plus size={19} className="text-text" weight="bold" /> add | ||
</button> | ||
)} | ||
<div className="flex flex-row gap-2"> | ||
{showAddButton && ( | ||
<> | ||
<button | ||
type="button" | ||
onClick={() => { | ||
router.push('/add-task') | ||
}} | ||
className="flex min-w-button items-center justify-center gap-1.5 rounded-md bg-white px-3 py-2.5 text-center text-xs font-medium text-text shadow-sm " | ||
> | ||
<Plus size={19} className="text-text" weight="bold" /> add | ||
</button> | ||
<button className="rounded-md bg-red px-3 py-2.5 shadow-sm hover:brightness-90"> | ||
<Trash className="text-white " /> | ||
</button> | ||
</> | ||
)} | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export const taskBgColorArray = [ | ||
'bg-card01', | ||
'bg-card02', | ||
'bg-card03', | ||
'bg-card04', | ||
'bg-card05', | ||
'bg-card06', | ||
'bg-card07', | ||
'bg-card08', | ||
'bg-card09', | ||
] |
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,53 @@ | ||
import React from 'react' | ||
import * as RadioGroup from '@radix-ui/react-radio-group' | ||
|
||
const ColorRadioGroup = React.forwardRef< | ||
React.ElementRef<typeof RadioGroup.Root>, | ||
React.ComponentPropsWithoutRef<typeof RadioGroup.Root> | ||
>(({ children, ...props }, ref) => ( | ||
<RadioGroup.Root | ||
className="flex flex-row flex-wrap gap-3 " | ||
defaultValue="default" | ||
aria-label="View density" | ||
ref={ref} | ||
{...props} | ||
> | ||
{children} | ||
</RadioGroup.Root> | ||
)) | ||
|
||
ColorRadioGroup.displayName = 'ColorRadioGroup' | ||
|
||
const ColorRadioItem = React.forwardRef< | ||
React.ElementRef<typeof RadioGroup.Item>, | ||
React.ComponentPropsWithoutRef<typeof RadioGroup.Item> | ||
>(({ children, ...props }, ref) => ( | ||
<RadioGroup.Item | ||
className={` | ||
h-11 | ||
w-11 | ||
rounded-full | ||
border-2 border-white bg-white shadow-sm`} | ||
{...props} | ||
ref={ref} | ||
> | ||
<RadioGroup.Indicator | ||
className=" | ||
absolute | ||
h-11 | ||
w-11 translate-x-[-50%] | ||
translate-y-[-50%] | ||
rounded-full | ||
border-2 | ||
border-solid | ||
border-green-400 | ||
bg-white | ||
" | ||
/> | ||
{children} | ||
</RadioGroup.Item> | ||
)) | ||
|
||
ColorRadioItem.displayName = 'ColorRadioItem' | ||
|
||
export { ColorRadioGroup, ColorRadioItem } |
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