-
Notifications
You must be signed in to change notification settings - Fork 0
feat(dashboard): add the toolbar, five status columns, and task cards #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e60622f
feat(dashboard): add the toolbar, five status columns, and task cards
Alejandroq12 50c1bf8
chore: require a 7-day release age for npm installs
Alejandroq12 81062d8
docs: reflect current state of the project
Alejandroq12 df6d649
refactor(ui): apply review findings, truthful tabs, named icons, doma…
Alejandroq12 84c24d4
chore(security): enforce npm version
Alejandroq12 bf15ba4
fix(engines): align the Node floor with the npm requirement
Alejandroq12 1a65012
docs(readme): correct the min-release-age version claim
Alejandroq12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 +1,2 @@ | ||
| engine-strict=true | ||
| min-release-age=7 | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,46 @@ | ||
| export interface IconProps { | ||
| className?: string | ||
| } | ||
|
|
||
| export function GridIcon(props: IconProps) { | ||
| return ( | ||
| <svg viewBox="0 0 24 24" fill="none" aria-hidden="true" {...props}> | ||
| <path | ||
| d="M3 3H11V11H3V3ZM3 13H11V21H3V13ZM13 3H21V11H13V3ZM13 13H21V21H13V13ZM15 5V9H19V5H15ZM15 15V19H19V15H15ZM5 5V9H9V5H5ZM5 15V19H9V15H5Z" | ||
| fill="currentColor" | ||
| /> | ||
| </svg> | ||
| ) | ||
| } | ||
|
|
||
| export function ListIcon(props: IconProps) { | ||
| return ( | ||
| <svg viewBox="0 0 24 24" fill="none" aria-hidden="true" {...props}> | ||
| <path d="M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z" fill="currentColor" /> | ||
| </svg> | ||
| ) | ||
| } | ||
|
|
||
| export function SearchIcon(props: IconProps) { | ||
| return ( | ||
| <svg viewBox="0 0 24 24" fill="none" aria-hidden="true" {...props}> | ||
| <path | ||
| transform="translate(2 2)" | ||
| d="M16.031 14.617L20.314 18.899L18.899 20.314L14.617 16.031C13.0237 17.3082 11.042 18.0029 9 18C4.032 18 0 13.968 0 9C0 4.032 4.032 0 9 0C13.968 0 18 4.032 18 9C18.0029 11.042 17.3082 13.0237 16.031 14.617ZM14.025 13.875C15.2941 12.5699 16.0029 10.8204 16 9C16 5.132 12.867 2 9 2C5.132 2 2 5.132 2 9C2 12.867 5.132 16 9 16C10.8204 16.0029 12.5699 15.2941 13.875 14.025L14.025 13.875Z" | ||
| fill="currentColor" | ||
| /> | ||
| </svg> | ||
| ) | ||
| } | ||
|
|
||
| export function BellIcon(props: IconProps) { | ||
| return ( | ||
| <svg viewBox="0 0 24 24" fill="none" aria-hidden="true" {...props}> | ||
| <path | ||
| transform="translate(2 2)" | ||
| d="M18 15H20V17H0V15H2V8C2 5.87827 2.84285 3.84344 4.34315 2.34315C5.84344 0.842855 7.87827 0 10 0C12.1217 0 14.1566 0.842855 15.6569 2.34315C17.1571 3.84344 18 5.87827 18 8V15ZM16 15V8C16 6.4087 15.3679 4.88258 14.2426 3.75736C13.1174 2.63214 11.5913 2 10 2C8.4087 2 6.88258 2.63214 5.75736 3.75736C4.63214 4.88258 4 6.4087 4 8V15H16ZM7 19H13V21H7V19Z" | ||
| fill="currentColor" | ||
| /> | ||
| </svg> | ||
| ) | ||
| } |
This file contains hidden or 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,3 +1,13 @@ | ||
| import { Toolbar } from '@/features/tasks/Toolbar' | ||
| import { TaskBoard } from '@/features/tasks/TaskBoard' | ||
| import { sampleColumns } from '@/features/tasks/sample-tasks' | ||
|
|
||
| export function Dashboard() { | ||
| return <h1>Dashboard</h1> | ||
| return ( | ||
| <div className="flex h-full flex-col gap-5 lg:gap-4"> | ||
| <h1 className="sr-only">Dashboard</h1> | ||
| <Toolbar /> | ||
| <TaskBoard columns={sampleColumns} /> | ||
| </div> | ||
| ) | ||
| } |
This file contains hidden or 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,3 +1,13 @@ | ||
| import { Toolbar } from '@/features/tasks/Toolbar' | ||
| import { TaskBoard } from '@/features/tasks/TaskBoard' | ||
| import { sampleColumns } from '@/features/tasks/sample-tasks' | ||
|
|
||
| export function MyTask() { | ||
| return <h1>My Task</h1> | ||
| return ( | ||
| <div className="flex h-full flex-col gap-5 lg:gap-4"> | ||
| <h1 className="sr-only">My Task</h1> | ||
| <Toolbar /> | ||
| <TaskBoard columns={sampleColumns} /> | ||
| </div> | ||
| ) | ||
| } |
This file contains hidden or 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,27 @@ | ||
| import { TaskCard } from '@/features/tasks/TaskCard' | ||
| import type { BoardColumn } from '@/features/tasks/types' | ||
|
|
||
| export function TaskBoard({ columns }: { columns: BoardColumn[] }) { | ||
| return ( | ||
| <div className="flex min-h-0 flex-1 gap-4 overflow-x-auto lg:gap-8"> | ||
| {columns.map(({ title, tasks }) => ( | ||
| <section | ||
| key={title} | ||
| aria-label={title} | ||
| className="flex w-85 shrink-0 flex-col gap-4 lg:w-87" | ||
| > | ||
| <h2 className="text-body-l font-semibold text-neutral-1"> | ||
| {title} ({String(tasks.length).padStart(2, '0')}) | ||
| </h2> | ||
| <ul className="flex min-h-0 flex-col gap-4 overflow-y-auto"> | ||
| {tasks.map((task) => ( | ||
| <li key={task.id}> | ||
| <TaskCard task={task} /> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| </section> | ||
| ))} | ||
| </div> | ||
| ) | ||
| } |
This file contains hidden or 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,58 @@ | ||
| import avatarUrl from '@/assets/avatar.png' | ||
| import { AlarmIcon, AttachIcon, ChatIcon, DotsIcon, ForkIcon } from '@/features/tasks/icons' | ||
| import type { Task, TagTone } from '@/features/tasks/types' | ||
|
|
||
| const tagToneClasses: Record<TagTone, string> = { | ||
| secondary: 'bg-secondary-4/10 text-secondary-4', | ||
| tertiary: 'bg-tertiary-4/10 text-tertiary-4', | ||
| } | ||
|
|
||
| export function TaskCard({ task }: { task: Task }) { | ||
| return ( | ||
| <article className="flex flex-col gap-4 rounded-lg bg-neutral-4 p-4"> | ||
| <div className="flex h-8 items-center gap-2"> | ||
| <h3 className="min-w-0 flex-1 truncate text-body-l font-semibold text-neutral-1"> | ||
| {task.name} | ||
| </h3> | ||
| <span role="img" aria-label="Task options" className="shrink-0"> | ||
| <DotsIcon className="size-6 text-neutral-1" /> | ||
| </span> | ||
| </div> | ||
| <div className="flex items-center justify-between"> | ||
| <span className="text-body-m font-semibold text-neutral-1">{task.points} Pts</span> | ||
| <span | ||
| className={`flex items-center gap-2 rounded px-4 py-1 text-body-m font-semibold ${ | ||
| task.overdue ? 'bg-primary-4/10 text-primary-4' : 'bg-neutral-2/10 text-neutral-1' | ||
| }`} | ||
| > | ||
| <AlarmIcon className="size-6" /> | ||
| {task.dueLabel} | ||
| </span> | ||
| </div> | ||
| <div className="flex flex-wrap gap-2"> | ||
| {task.tags.map(({ label, tone }) => ( | ||
| <span | ||
| key={label} | ||
| className={`rounded px-4 py-1 text-body-m font-semibold whitespace-nowrap ${tagToneClasses[tone]}`} | ||
| > | ||
| {label} | ||
| </span> | ||
| ))} | ||
| </div> | ||
| <div className="flex items-center justify-between"> | ||
| <img className="size-8 rounded-full" src={avatarUrl} alt="Assignee" /> | ||
| <div className="flex items-center gap-4 text-neutral-1"> | ||
| <AttachIcon className="size-4" /> | ||
| <span className="flex items-center gap-1 text-body-m"> | ||
| {task.forks} | ||
| <ForkIcon className="size-4" /> | ||
| </span> | ||
| <span className="flex items-center gap-1 text-body-m"> | ||
| {task.comments} | ||
| <ChatIcon className="size-4" /> | ||
| </span> | ||
| </div> | ||
| </div> | ||
| </article> | ||
| ) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.