Skip to content
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

Dashboard tweak #5

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shop/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz
Expand Down
2 changes: 1 addition & 1 deletion shop/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion shop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint": "^8.56.0",
"eslint-config-next": "14.0.4",
"postcss": "^8",
"tailwindcss": "^3.3.0",
Expand Down
34 changes: 17 additions & 17 deletions shop/src/app/dashboard/components/date-range-picker.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
"use client"
'use client'

import * as React from "react"
import { CalendarIcon } from "@radix-ui/react-icons"
import { addDays, format } from "date-fns"
import { DateRange } from "react-day-picker"
import * as React from 'react'
import { CalendarIcon } from '@radix-ui/react-icons'
import { addDays, format } from 'date-fns'
import { DateRange } from 'react-day-picker'

import { cn } from "@/lib/utils"
import { PrimaryButton as Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import { cn } from '@/lib/utils'
import { PrimaryButton as Button } from '@/components/ui/button'
import { Calendar } from '@/components/ui/calendar'
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover"
} from '@/components/ui/popover'

export function CalendarDateRangePicker({
className,
Expand All @@ -23,26 +23,26 @@ export function CalendarDateRangePicker({
})

return (
<div className={cn("grid gap-2", className)}>
<div className={cn('grid gap-2', className)}>
<Popover>
<PopoverTrigger asChild>
<Button
id="date"
variant={"outline"}
variant={'outline'}
className={cn(
"w-[260px] justify-start text-left font-normal",
!date && "text-muted-foreground"
'w-[260px] justify-start text-left font-normal',
!date && 'text-muted-foreground',
)}
>
<CalendarIcon className="mr-2 h-4 w-4" />
{date?.from ? (
date.to ? (
<>
{format(date.from, "LLL dd, y")} -{" "}
{format(date.to, "LLL dd, y")}
{format(date.from, 'LLL dd, y')} -{' '}
{format(date.to, 'LLL dd, y')}
</>
) : (
format(date.from, "LLL dd, y")
format(date.from, 'LLL dd, y')
)
) : (
<span>Pick a date</span>
Expand All @@ -62,4 +62,4 @@ export function CalendarDateRangePicker({
</Popover>
</div>
)
}
}
8 changes: 4 additions & 4 deletions shop/src/app/dashboard/components/main-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import Link from "next/link"
import Link from 'next/link'

import { cn } from "@/lib/utils"
import { cn } from '@/lib/utils'

export function MainNav({
className,
...props
}: React.HTMLAttributes<HTMLElement>) {
return (
<nav
className={cn("flex items-center space-x-4 lg:space-x-6", className)}
className={cn('flex items-center space-x-4 lg:space-x-6', className)}
{...props}
>
<Link
Expand Down Expand Up @@ -37,4 +37,4 @@ export function MainNav({
</Link>
</nav>
)
}
}
30 changes: 15 additions & 15 deletions shop/src/app/dashboard/components/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
"use client"
'use client'

import { Bar, BarChart, ResponsiveContainer, XAxis, YAxis } from "recharts"
import { Bar, BarChart, ResponsiveContainer, XAxis, YAxis } from 'recharts'

const data = [
{
name: "Jan",
name: 'Jan',
total: Math.floor(Math.random() * 5000) + 1000,
},
{
name: "Feb",
name: 'Feb',
total: Math.floor(Math.random() * 5000) + 1000,
},
{
name: "Mar",
name: 'Mar',
total: Math.floor(Math.random() * 5000) + 1000,
},
{
name: "Apr",
name: 'Apr',
total: Math.floor(Math.random() * 5000) + 1000,
},
{
name: "May",
name: 'May',
total: Math.floor(Math.random() * 5000) + 1000,
},
{
name: "Jun",
name: 'Jun',
total: Math.floor(Math.random() * 5000) + 1000,
},
{
name: "Jul",
name: 'Jul',
total: Math.floor(Math.random() * 5000) + 1000,
},
{
name: "Aug",
name: 'Aug',
total: Math.floor(Math.random() * 5000) + 1000,
},
{
name: "Sep",
name: 'Sep',
total: Math.floor(Math.random() * 5000) + 1000,
},
{
name: "Oct",
name: 'Oct',
total: Math.floor(Math.random() * 5000) + 1000,
},
{
name: "Nov",
name: 'Nov',
total: Math.floor(Math.random() * 5000) + 1000,
},
{
name: "Dec",
name: 'Dec',
total: Math.floor(Math.random() * 5000) + 1000,
},
]
Expand Down Expand Up @@ -80,4 +80,4 @@ export function Overview() {
</BarChart>
</ResponsiveContainer>
)
}
}
126 changes: 61 additions & 65 deletions shop/src/app/dashboard/components/recent-sales.tsx
Original file line number Diff line number Diff line change
@@ -1,71 +1,67 @@
import {
Avatar,
AvatarFallback,
AvatarImage,
} from "@/components/ui/avatar"

export function RecentSales() {
return (
<div className="space-y-8">
<div className="flex items-center">
<Avatar className="h-9 w-9">
<AvatarImage src="/avatars/01.png" alt="Avatar" />
<AvatarFallback>OM</AvatarFallback>
</Avatar>
<div className="ml-4 space-y-1">
<p className="text-sm font-medium leading-none">Olivia Martin</p>
<p className="text-sm text-muted-foreground">
olivia.martin@email.com
</p>
</div>
<div className="ml-auto font-medium">+$1,999.00</div>
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'

export function RecentSales() {
return (
<div className="space-y-8">
<div className="flex items-center">
<Avatar className="h-9 w-9">
<AvatarImage src="/avatars/01.png" alt="Avatar" />
<AvatarFallback>OM</AvatarFallback>
</Avatar>
<div className="ml-4 space-y-1">
<p className="text-sm font-medium leading-none">Olivia Martin</p>
<p className="text-sm text-muted-foreground">
olivia.martin@email.com
</p>
</div>
<div className="flex items-center">
<Avatar className="flex h-9 w-9 items-center justify-center space-y-0 border">
<AvatarImage src="/avatars/02.png" alt="Avatar" />
<AvatarFallback>JL</AvatarFallback>
</Avatar>
<div className="ml-4 space-y-1">
<p className="text-sm font-medium leading-none">Jackson Lee</p>
<p className="text-sm text-muted-foreground">jackson.lee@email.com</p>
</div>
<div className="ml-auto font-medium">+$39.00</div>
<div className="ml-auto font-medium">+$1,999.00</div>
</div>
<div className="flex items-center">
<Avatar className="flex h-9 w-9 items-center justify-center space-y-0 border">
<AvatarImage src="/avatars/02.png" alt="Avatar" />
<AvatarFallback>JL</AvatarFallback>
</Avatar>
<div className="ml-4 space-y-1">
<p className="text-sm font-medium leading-none">Jackson Lee</p>
<p className="text-sm text-muted-foreground">jackson.lee@email.com</p>
</div>
<div className="flex items-center">
<Avatar className="h-9 w-9">
<AvatarImage src="/avatars/03.png" alt="Avatar" />
<AvatarFallback>IN</AvatarFallback>
</Avatar>
<div className="ml-4 space-y-1">
<p className="text-sm font-medium leading-none">Isabella Nguyen</p>
<p className="text-sm text-muted-foreground">
isabella.nguyen@email.com
</p>
</div>
<div className="ml-auto font-medium">+$299.00</div>
<div className="ml-auto font-medium">+$39.00</div>
</div>
<div className="flex items-center">
<Avatar className="h-9 w-9">
<AvatarImage src="/avatars/03.png" alt="Avatar" />
<AvatarFallback>IN</AvatarFallback>
</Avatar>
<div className="ml-4 space-y-1">
<p className="text-sm font-medium leading-none">Isabella Nguyen</p>
<p className="text-sm text-muted-foreground">
isabella.nguyen@email.com
</p>
</div>
<div className="flex items-center">
<Avatar className="h-9 w-9">
<AvatarImage src="/avatars/04.png" alt="Avatar" />
<AvatarFallback>WK</AvatarFallback>
</Avatar>
<div className="ml-4 space-y-1">
<p className="text-sm font-medium leading-none">William Kim</p>
<p className="text-sm text-muted-foreground">will@email.com</p>
</div>
<div className="ml-auto font-medium">+$99.00</div>
<div className="ml-auto font-medium">+$299.00</div>
</div>
<div className="flex items-center">
<Avatar className="h-9 w-9">
<AvatarImage src="/avatars/04.png" alt="Avatar" />
<AvatarFallback>WK</AvatarFallback>
</Avatar>
<div className="ml-4 space-y-1">
<p className="text-sm font-medium leading-none">William Kim</p>
<p className="text-sm text-muted-foreground">will@email.com</p>
</div>
<div className="flex items-center">
<Avatar className="h-9 w-9">
<AvatarImage src="/avatars/05.png" alt="Avatar" />
<AvatarFallback>SD</AvatarFallback>
</Avatar>
<div className="ml-4 space-y-1">
<p className="text-sm font-medium leading-none">Sofia Davis</p>
<p className="text-sm text-muted-foreground">sofia.davis@email.com</p>
</div>
<div className="ml-auto font-medium">+$39.00</div>
<div className="ml-auto font-medium">+$99.00</div>
</div>
<div className="flex items-center">
<Avatar className="h-9 w-9">
<AvatarImage src="/avatars/05.png" alt="Avatar" />
<AvatarFallback>SD</AvatarFallback>
</Avatar>
<div className="ml-4 space-y-1">
<p className="text-sm font-medium leading-none">Sofia Davis</p>
<p className="text-sm text-muted-foreground">sofia.davis@email.com</p>
</div>
<div className="ml-auto font-medium">+$39.00</div>
</div>
)
}
</div>
)
}
4 changes: 2 additions & 2 deletions shop/src/app/dashboard/components/search.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Input } from "@/components/ui/input"
import { Input } from '@/components/ui/input'

export function Search() {
return (
Expand All @@ -10,4 +10,4 @@ export function Search() {
/>
</div>
)
}
}
Loading