Skip to content

Commit 7609fe3

Browse files
restyle trends-in-sales section sales graph
1 parent 10ffe38 commit 7609fe3

File tree

6 files changed

+43
-99
lines changed

6 files changed

+43
-99
lines changed

src/components/admin/AdminReportCard.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ const ChartComponent = ({ title = "All Orders", number = 500, persontage = "10%"
165165
<span className='text-[#027A48]'><ArrowUp /></span>
166166
<span className='text-[#027A48] text-[14px] font-[500]'>{persontage}</span>
167167
</div>
168-
<span className=' text-[#4C4D4D] text-center w-auto text-[14px] font-[500]'>Vs last quater</span>
168+
<span className=' text-[#4C4D4D] text-center w-auto text-[14px] font-[500]'>vs last quater</span>
169169
</div>
170170
</div>
171171
<div className='grid items-end'>

src/components/admin/shop/sales/SalesGraph.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import data from './data';
66
export const SalesGraph = () => {
77
return (
88
<ResponsiveContainer width="100%" height={300}>
9+
{/* <XAxis dataKey={"name"} className='mt-4' /> */}
910
<AreaChart
1011
data={data}
1112
margin={{
@@ -21,11 +22,18 @@ export const SalesGraph = () => {
2122
<stop offset="95%" stopColor="#82ca9d" stopOpacity={0}/>
2223
</linearGradient>
2324
</defs>
24-
<XAxis dataKey="name" stroke="white" />
25+
<XAxis dataKey={"name"} />
2526
<YAxis stroke="white" />
2627
<CartesianGrid strokeDasharray="3 3" />
2728
<Tooltip />
28-
<Area type="monotone" dataKey="pv" stroke="#28B463 " fillOpacity={1} fill="url(#colorPv)" />
29+
<Area
30+
type="monotone"
31+
dataKey="uv"
32+
fillOpacity={1}
33+
fill="url(#colorPv)"
34+
strokeWidth={2}
35+
stroke="#00664E"
36+
/>
2937
</AreaChart>
3038
</ResponsiveContainer>
3139
);

src/components/admin/shop/sales/SalesPreviewTable.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
});
2323

2424
return (
25-
<Table>
25+
<Table className='text-gray-500'>
2626
<TableHeader className="bg-grey-light uppercase">
2727
{table.getHeaderGroups().map((headerGroup) => (
2828
<TableRow key={headerGroup.id}>

src/components/admin/shop/sales/data.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
const data = [
22
{
33
name: 'Jan',
4-
pv: 4300,
4+
uv: 4300,
55
amt: 2400,
66
},
77
{
88
name: 'Feb',
9-
pv: 5600,
9+
uv: 5600,
1010
amt: 2210,
1111
},
1212
{
1313
name: 'Apr',
14-
pv: 5408,
14+
uv: 5408,
1515
amt: 2290,
1616
},
1717
{
1818
name: 'May',
19-
pv: 6420,
19+
uv: 6420,
2020
amt: 2000,
2121
},
2222
{
2323
name: 'Jun',
24-
pv: 7500,
24+
uv: 7500,
2525
amt: 2181,
2626
},
2727
{
2828
name: 'Jul',
29-
pv: 6300,
29+
uv: 6300,
3030
amt: 2500,
3131
},
3232
{
3333
name: 'Aug',
34-
pv: 8600,
34+
uv: 8600,
3535
amt: 2100,
3636
},
3737
{
3838
name: 'Sep',
39-
pv: 8300,
39+
uv: 8300,
4040
amt: 2100,
4141
},
4242
{
4343
name: 'Oct',
44-
pv: 10200,
44+
uv: 10200,
4545
amt: 2100,
4646
},
4747
{
4848
name: 'Nov',
49-
pv: 9500,
49+
uv: 9500,
5050
amt: 2100,
5151
},
5252
{
5353
name: 'Dev',
54-
pv: 12200,
54+
uv: 12200,
5555
amt: 2100,
5656
},
5757
];

src/pages/admin/shop/sales/ShopSales.jsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,29 @@ import columns from "@/components/admin/shop/sales/SalesPreviewColumn";
33
import { Link } from "react-router-dom";
44
import data from "./data";
55
import ShopSalesTrends from "./ShopSalesTrends";
6+
import { ChartComponent } from "@/components/admin/AdminReportCard";
67

78
function ShopSales() {
89

910
return (
1011
<>
1112
<div className="container my-10">
1213
<section>
13-
<h1 className="text-2xl font-light">Sales</h1>
14+
<h1 className="text-2xl font-light mb-8">Sales Report</h1>
1415
<div className="border rounded-xl p-4">
15-
<p className="text-sm font-light mb-4">Dashboard</p>
16-
<ShopSalesTrends />
16+
<p className="md:text-xl text-sm font-semibold mb-4">Trends In Sales</p>
17+
<div className="grid sm:grid-cols-1 md:grid-cols-3 lg:grid-cols-4 space-x-6">
18+
<ChartComponent title = "All Sales" number={4000} />
19+
<ChartComponent title = "Sales This Week" number={500} />
20+
<ChartComponent title = "Sales This Month" number={750} />
21+
<ChartComponent title = "Sales This Year" number={1000} />
22+
</div>
23+
24+
<ShopSalesTrends className='mt-16' />
1725
</div>
1826
</section>
1927

20-
<section className="container my-10">
28+
<section className=" my-10">
2129
<div className="border rounded-xl">
2230
<div className="flex justify-between items-center w-full py-4 px-3 border-b">
2331
<h3 className="font-semibold">Shop</h3>
@@ -29,7 +37,7 @@ function ShopSales() {
2937
</Link>
3038
</div>
3139

32-
<SalesPreviewTable columns={columns} data={data} />
40+
<SalesPreviewTable columns={columns} data={data} className='text-gray-500'/>
3341
</div>
3442
</section>
3543

src/pages/admin/shop/sales/data.js

Lines changed: 7 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,11 @@
11
const data = [
2-
{
3-
id: "itm-101",
4-
name: "SYT Beanie",
5-
totalItems: 400,
6-
sold: 350,
7-
// unitCost: 350,
8-
remaining: "50",
9-
},
10-
{
11-
id: "itm-102",
12-
name: "SYT Hoodie",
13-
totalItems: 100,
14-
sold: 5,
15-
// unitCost: 1000,
16-
remaining: "45",
17-
},
18-
{
19-
id: "itm-103",
20-
name: "SYT Mug",
21-
totalItems: 20,
22-
sold: 100,
23-
// unitCost: 100,
24-
remaining: "100",
25-
},
26-
{
27-
id: "itm-104",
28-
name: "SYT Tee",
29-
ltems: 50,
30-
// itemSold: 350,
31-
remaining: "50",
32-
},
33-
{
34-
id: "itm-105",
35-
name: "SYT Beanie",
36-
totalItems: 400,
37-
sold: 350,
38-
// unitCost: 350,
39-
remaining: "50",
40-
},
41-
{
42-
id: "itm-106",
43-
name: "SYT Hoodie",
44-
totalItems: 100,
45-
sold: 5,
46-
// unitCost: 1000,
47-
remaining: "45",
48-
},
49-
{
50-
id: "itm-107",
51-
name: "SYT Mug",
52-
totalItems: 20,
53-
sold: 100,
54-
// unitCost: 100,
55-
remaining: "100",
56-
},
57-
{
58-
id: "itm-108",
59-
name: "SYT Tee",
60-
ltems: 50,
61-
// itemSold: 350,
62-
remaining: "50",
63-
},
64-
{
65-
id: "itm-101",
66-
name: "SYT Beanie",
67-
totalItems: 400,
68-
sold: 350,
69-
// unitCost: 350,
70-
remaining: "50",
71-
},
72-
{
73-
id: "itm-102",
74-
name: "SYT Hoodie",
75-
totalItems: 100,
76-
sold: 5,
77-
// unitCost: 1000,
78-
remaining: "45",
79-
},
80-
];
2+
{ id: "ITM-101", name: 'SYT Beanie', totalItems: 400, noOfId: "No. of items: 350", unitCost: "Unit Cost: KES 350", totalSales: 1225000, itemsRemaining: 50 },
3+
{ id: "ITM-102", name: 'SYT Hoodie', totalItems: 50, noOfId: "No. of items: 5", unitCost: "Unit Cost: KES 1000", totalSales: 5000, itemsRemaining: 40 },
4+
{ id: "ITM-103", name: 'SYT Beanie', totalItems: 400, noOfId: "No. of items: 350", unitCost: "Unit Cost: KES 350", totalSales: 1225000, itemsRemaining: 500 },
5+
{ id: "ITM-104", name: 'SYT Beanie', totalItems: 400, noOfId: "No. of items: 350", unitCost: "Unit Cost: KES 350", totalSales: 1225000, itemsRemaining: 30 },
6+
{ id: "ITM-105", name: 'SYT Beanie', totalItems: 400, noOfId: "No. of items: 350", unitCost: "Unit Cost: KES 350", totalSales: 1225000, itemsRemaining: 20 },
7+
{ id: "ITM-106", name: 'SYT Beanie', totalItems: 400, noOfId: "No. of items: 350", unitCost: "Unit Cost: KES 350", totalSales: 1225000, itemsRemaining: 50 },
8+
];
819

8210

8311
export default data;

0 commit comments

Comments
 (0)