Skip to content

Commit

Permalink
task view
Browse files Browse the repository at this point in the history
version-patch
  • Loading branch information
trueberryless committed Jul 6, 2024
1 parent 0e7d25c commit fe573a5
Show file tree
Hide file tree
Showing 27 changed files with 2,038 additions and 157 deletions.
682 changes: 548 additions & 134 deletions src/app/test_data.json

Large diffs are not rendered by default.

50 changes: 48 additions & 2 deletions src/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { useUser } from "./UserContext";
export default function Navbar() {
const { user, setUser } = useUser();
const router = useRouter();
const [isSheetOpen, setIsSheetOpen] = useState(false);

useEffect(() => {
const data = loadData();
Expand Down Expand Up @@ -58,13 +59,23 @@ export default function Navbar() {
<Link
href="/projects"
className={`${
router.pathname.includes("projects")
router.pathname.includes("project")
? "text-foreground"
: "text-muted-foreground"
} transition-colors hover:text-foreground`}
>
Projects
</Link>
<Link
href="/tasks"
className={`${
router.pathname.includes("task")
? "text-foreground"
: "text-muted-foreground"
} transition-colors hover:text-foreground`}
>
Tasks
</Link>
<Link
href="/settings"
className={`${
Expand All @@ -76,7 +87,7 @@ export default function Navbar() {
Settings
</Link>
</nav>
<Sheet>
<Sheet open={isSheetOpen} onOpenChange={setIsSheetOpen}>
<SheetTrigger asChild>
<Button variant="outline" size="icon" className="shrink-0 md:hidden">
<Menu className="h-5 w-5" />
Expand All @@ -88,6 +99,11 @@ export default function Navbar() {
<Link
href="/"
className="flex items-center gap-2 text-lg font-semibold md:text-base"
onClick={() =>
setTimeout(() => {
setIsSheetOpen(false);
}, 200)
}
>
<Timer className="h-6 w-6" />
<span className="sr-only">True Tracker</span>
Expand All @@ -99,6 +115,11 @@ export default function Navbar() {
? "text-foreground"
: "text-muted-foreground"
} transition-colors hover:text-foreground`}
onClick={() =>
setTimeout(() => {
setIsSheetOpen(false);
}, 200)
}
>
Dashboard
</Link>
Expand All @@ -109,16 +130,41 @@ export default function Navbar() {
? "text-foreground"
: "text-muted-foreground"
} transition-colors hover:text-foreground`}
onClick={() =>
setTimeout(() => {
setIsSheetOpen(false);
}, 200)
}
>
Projects
</Link>
<Link
href="/tasks"
className={`${
router.pathname.includes("task")
? "text-foreground"
: "text-muted-foreground"
} transition-colors hover:text-foreground`}
onClick={() =>
setTimeout(() => {
setIsSheetOpen(false);
}, 200)
}
>
Tasks
</Link>
<Link
href="/settings"
className={`${
router.pathname.includes("settings")
? "text-foreground"
: "text-muted-foreground"
} transition-colors hover:text-foreground`}
onClick={() =>
setTimeout(() => {
setIsSheetOpen(false);
}, 200)
}
>
Settings
</Link>
Expand Down
30 changes: 24 additions & 6 deletions src/components/projects/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import { Project } from "@/models";
import { ColumnDef } from "@tanstack/react-table";
import { DataTableColumnHeader } from "../ui/data-table-column-header";
import { DataTableColumnHeader } from "./data-table-column-header";
import { priorities, statuses } from "@/models/project";
import { Badge } from "../ui/badge";
import { format } from "date-fns";
import { DataTableRowActions } from "../ui/data-table-row-actions";
import { DataTableRowActions } from "./data-table-row-actions";

export const columnsXl: ColumnDef<Project>[] = [
{
Expand Down Expand Up @@ -143,7 +143,13 @@ export const columnsXl: ColumnDef<Project>[] = [
},
{
id: "actions",
cell: ({ row }) => <DataTableRowActions row={row} />,
cell: ({ row }) => (
<div className="flex justify-end">
<div className="flex justify-end">
<DataTableRowActions row={row} />
</div>
</div>
),
},
];

Expand Down Expand Up @@ -246,7 +252,11 @@ export const columnsLg: ColumnDef<Project>[] = [
},
{
id: "actions",
cell: ({ row }) => <DataTableRowActions row={row} />,
cell: ({ row }) => (
<div className="flex justify-end">
<DataTableRowActions row={row} />
</div>
),
},
];

Expand Down Expand Up @@ -333,7 +343,11 @@ export const columnsMd: ColumnDef<Project>[] = [
},
{
id: "actions",
cell: ({ row }) => <DataTableRowActions row={row} />,
cell: ({ row }) => (
<div className="flex justify-end">
<DataTableRowActions row={row} />
</div>
),
},
];

Expand Down Expand Up @@ -402,7 +416,11 @@ export const columnsSm: ColumnDef<Project>[] = [
},
{
id: "actions",
cell: ({ row }) => <DataTableRowActions row={row} />,
cell: ({ row }) => (
<div className="flex justify-end">
<DataTableRowActions row={row} />
</div>
),
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { Button } from "./button";
import { Button } from "../ui/button";

interface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {
column: Column<TData, TValue>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { CheckIcon, CirclePlusIcon } from "lucide-react";
import { Column } from "@tanstack/react-table";

import { cn } from "@/lib/utils";
import { Button } from "./button";
import { Separator } from "./separator";
import { Badge } from "./badge";
import { Popover, PopoverContent, PopoverTrigger } from "./popover";
import { Button } from "../ui/button";
import { Separator } from "../ui/separator";
import { Badge } from "../ui/badge";
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
import {
Command,
CommandEmpty,
Expand All @@ -15,7 +15,7 @@ import {
CommandItem,
CommandList,
CommandSeparator,
} from "./command";
} from "../ui/command";

interface DataTableFacetedFilterProps<TData, TValue> {
column?: Column<TData, TValue>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
ArrowRightToLineIcon,
} from "lucide-react";
import { Table } from "@tanstack/react-table";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./select";
import { Button } from "./button";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select";
import { Button } from "../ui/button";

interface DataTablePaginationProps<TData> {
table: Table<TData>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export function DataTableRowActions({ row }: DataTableRowActionsProps<Project>)
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-[160px]">
<Link href={`/project/${projectId}`}>
<Link href={`/projects/${projectId}`}>
<DropdownMenuItem>View</DropdownMenuItem>
</Link>
<Link href={`/project/${projectId}/edit`}>
<Link href={`/projects/${projectId}/edit`}>
<DropdownMenuItem>Edit</DropdownMenuItem>
</Link>
</DropdownMenuContent>
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit fe573a5

Please sign in to comment.