Skip to content

Commit

Permalink
UI Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
VijeshVS committed May 25, 2024
1 parent e338d63 commit 1f3f227
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
25 changes: 21 additions & 4 deletions app/app/(dashboard)/links/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ export default function Page(params : any) {
google: 20,
direc: 210,
"dub.co": 60
},
os:{
windows10:100,
windows11:48,
macOS:50
},
browser:{
chrome:45,
firefox:50,
safari:70
}
};

Expand Down Expand Up @@ -181,7 +191,7 @@ export default function Page(params : any) {
</div>
<div className="flex justify-center md:justify-start">

<div className="flex">
<div className="flex md:flex-row flex-col">
<div className="mt-8 shadow-md p-6 rounded-xl w-fit border-[0.5px]">
<Label className="font-bold ml-3 text-lg">Devices</Label>
<div className="mt-4 md:w-[300px] md:h-[300px] w-[250px] h-[250px]">
Expand All @@ -190,14 +200,21 @@ export default function Page(params : any) {
</div>

<div className="mt-8 shadow-md p-6 rounded-xl w-fit border-[0.5px] md:ml-8 ml-0">
<Label className="font-bold ml-3 text-lg">Referer</Label>
<Label className="font-bold ml-3 text-lg">OS</Label>
<div className="mt-4 md:w-[300px] md:h-[300px] w-[250px] h-[250px]">
<PieChart devices={Object.keys(link.os ?? {})} data={Object.values(link.os ?? {})}/>
</div>
</div>

<div className="mt-8 shadow-md p-6 rounded-xl w-fit border-[0.5px] md:ml-8 ml-0">
<Label className="font-bold ml-3 text-lg">Browser</Label>
<div className="mt-4 md:w-[300px] md:h-[300px] w-[250px] h-[250px]">
<PieChart devices={Object.keys(link.refs ?? {})} data={Object.values(link.refs ?? {})}/>
<PieChart devices={Object.keys(link.browser ?? {})} data={Object.values(link.browser ?? {})}/>
</div>
</div>
</div>

</div>
</div>
</div>
);
}
2 changes: 1 addition & 1 deletion app/app/(dashboard)/links/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function Page() {
const from:any = date?.from;
const to:any = date?.to;
const filterLinks = linkList?.filter((link:any)=>{
return link.created_at >=from && link.created_at <= to
return (!from || link.created_at >=from) && (!to || link.created_at <= to)
})
setFilteredLinks(filterLinks)
setLoading(false)
Expand Down
4 changes: 3 additions & 1 deletion interfaces/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export interface LinkType {
weeklyChange?: number;
locations?: locationsDetails[];
devices?: Record<string, number>;
refs?: Record<string, number>
refs?: Record<string, number>,
os?:Record<string, number>,
browser?:Record<string, number>,
}


Expand Down

0 comments on commit 1f3f227

Please sign in to comment.