-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f87f97
commit de5bab2
Showing
13 changed files
with
656 additions
and
109 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains 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 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 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 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,122 @@ | ||
import * as React from "react"; | ||
import { MinusIcon, PlusIcon, InfoCircledIcon } from "@radix-ui/react-icons"; | ||
import { Button } from "@/components/ui/button"; | ||
import { | ||
Drawer, | ||
DrawerClose, | ||
DrawerContent, | ||
DrawerDescription, | ||
DrawerFooter, | ||
DrawerHeader, | ||
DrawerTitle, | ||
DrawerTrigger, | ||
} from "@/components/ui/drawer"; | ||
import { About } from "./about"; | ||
|
||
const data = [ | ||
{ | ||
goal: 400, | ||
}, | ||
{ | ||
goal: 300, | ||
}, | ||
{ | ||
goal: 200, | ||
}, | ||
{ | ||
goal: 300, | ||
}, | ||
{ | ||
goal: 200, | ||
}, | ||
{ | ||
goal: 278, | ||
}, | ||
{ | ||
goal: 189, | ||
}, | ||
{ | ||
goal: 239, | ||
}, | ||
{ | ||
goal: 300, | ||
}, | ||
{ | ||
goal: 200, | ||
}, | ||
{ | ||
goal: 278, | ||
}, | ||
{ | ||
goal: 189, | ||
}, | ||
{ | ||
goal: 349, | ||
}, | ||
]; | ||
|
||
export function AboutDrawer() { | ||
const [goal, setGoal] = React.useState(350); | ||
|
||
function onClick(adjustment: number) { | ||
setGoal(Math.max(200, Math.min(400, goal + adjustment))); | ||
} | ||
|
||
return ( | ||
<Drawer> | ||
<DrawerTrigger asChild> | ||
<Button variant="outline"> | ||
<InfoCircledIcon className="mr-2" /> Info | ||
</Button> | ||
</DrawerTrigger> | ||
<DrawerContent> | ||
<div className="mx-auto w-full max-w-sm"> | ||
<DrawerHeader> | ||
<DrawerTitle>App Info</DrawerTitle> | ||
<DrawerDescription>Clean your project files.</DrawerDescription> | ||
</DrawerHeader> | ||
<About className="mt-2" /> | ||
{/* <div className="p-4 pb-0"> | ||
<div className="flex items-center justify-center space-x-2"> | ||
<Button | ||
variant="outline" | ||
size="icon" | ||
className="h-8 w-8 shrink-0 rounded-full" | ||
onClick={() => onClick(-10)} | ||
disabled={goal <= 200} | ||
> | ||
<MinusIcon className="h-4 w-4" /> | ||
<span className="sr-only">Decrease</span> | ||
</Button> | ||
<div className="flex-1 text-center"> | ||
<div className="text-7xl font-bold tracking-tighter"> | ||
{goal} | ||
</div> | ||
<div className="text-[0.70rem] uppercase text-muted-foreground"> | ||
Calories/day | ||
</div> | ||
</div> | ||
<Button | ||
variant="outline" | ||
size="icon" | ||
className="h-8 w-8 shrink-0 rounded-full" | ||
onClick={() => onClick(10)} | ||
disabled={goal >= 400} | ||
> | ||
<PlusIcon className="h-4 w-4" /> | ||
<span className="sr-only">Increase</span> | ||
</Button> | ||
</div> | ||
<div className="mt-3 h-[120px]"></div> | ||
</div> */} | ||
<DrawerFooter> | ||
{/* <Button>Submit</Button> | ||
<DrawerClose asChild> | ||
<Button variant="outline">Cancel</Button> | ||
</DrawerClose> */} | ||
</DrawerFooter> | ||
</div> | ||
</DrawerContent> | ||
</Drawer> | ||
); | ||
} |
This file contains 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,39 @@ | ||
import { Button } from "@/components/ui/button"; | ||
import { Input } from "@/components/ui/input"; | ||
import { Label } from "@/components/ui/label"; | ||
import { | ||
Sheet, | ||
SheetClose, | ||
SheetContent, | ||
SheetDescription, | ||
SheetFooter, | ||
SheetHeader, | ||
SheetTitle, | ||
SheetTrigger, | ||
} from "@/components/ui/sheet"; | ||
import { InfoCircledIcon } from "@radix-ui/react-icons"; | ||
import { About } from "./about"; | ||
|
||
export function AboutSheet({ className }: { className?: string }) { | ||
return ( | ||
<Sheet> | ||
<SheetTrigger asChild> | ||
<Button variant="outline"> | ||
<InfoCircledIcon className="mr-2" /> info | ||
</Button> | ||
</SheetTrigger> | ||
<SheetContent> | ||
<SheetHeader> | ||
<SheetTitle>App Info</SheetTitle> | ||
<SheetDescription>Clean your projects with ease</SheetDescription> | ||
</SheetHeader> | ||
<About className={className ?? ""} /> | ||
{/* <SheetFooter> | ||
<SheetClose asChild> | ||
<Button type="submit">Save changes</Button> | ||
</SheetClose> | ||
</SheetFooter> */} | ||
</SheetContent> | ||
</Sheet> | ||
); | ||
} |
This file contains 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,62 @@ | ||
import { getVersion } from "@tauri-apps/api/app"; | ||
import { useState } from "react"; | ||
import { Button } from "./ui/button"; | ||
import { open } from "@tauri-apps/api/shell"; | ||
|
||
function BtnLink({ | ||
href, | ||
children, | ||
}: { | ||
href: string; | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<Button | ||
variant="link" | ||
onClick={() => { | ||
open(href); | ||
}} | ||
> | ||
{children} | ||
</Button> | ||
); | ||
} | ||
|
||
export function About({ className }: { className?: string }) { | ||
const [version, setVersion] = useState<string | null>(null); | ||
getVersion().then((v) => setVersion(v)); | ||
|
||
return ( | ||
<div className={`flex flex-col space-y-3 mt-4 ${className}`}> | ||
<p> | ||
<strong className="font-bold">App Name:{" "}</strong>DevClean-UI | ||
</p> | ||
<p> | ||
<strong className="font-bold">App Version:{" "}</strong> | ||
{version} | ||
</p> | ||
<p> | ||
<strong>Source Code: </strong> | ||
<BtnLink href="https://github.com/HuakunShen/devclean.git"> | ||
https://github.com/HuakunShen/devclean.git | ||
</BtnLink> | ||
</p> | ||
<p> | ||
<BtnLink href="https://github.com/HuakunShen/devclean/releases/latest"> | ||
Latest Release | ||
</BtnLink> | ||
</p> | ||
<p> | ||
Auto Updater is configured. Every time a new release is published your | ||
app will ask you whether you want to update to the latest release. Auto | ||
update is in just one click. | ||
</p> | ||
<p> | ||
<strong>Author: </strong> | ||
<BtnLink href="https://github.com/HuakunShen"> | ||
https://github.com/HuakunShen | ||
</BtnLink> | ||
</p> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.