feat: version link to gh release in sidebar (#203)
This commit is contained in:
parent
8cdd06ec49
commit
ea9d867cd2
1 changed files with 13 additions and 5 deletions
|
|
@ -46,10 +46,15 @@ const items = [
|
||||||
|
|
||||||
export function AppSidebar() {
|
export function AppSidebar() {
|
||||||
const { state } = useSidebar();
|
const { state } = useSidebar();
|
||||||
|
const displayVersion = APP_VERSION.startsWith("v") || APP_VERSION === "dev" ? APP_VERSION : `v${APP_VERSION}`;
|
||||||
|
const releaseUrl =
|
||||||
|
APP_VERSION === "dev"
|
||||||
|
? "https://github.com/nicotsx/zerobyte"
|
||||||
|
: `https://github.com/nicotsx/zerobyte/releases/tag/${displayVersion}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Sidebar variant="inset" collapsible="icon" className="p-0">
|
<Sidebar variant="inset" collapsible="icon" className="p-0">
|
||||||
<SidebarHeader className="bg-card-header border-b border-border/50 hidden md:flex h-[65px] flex-row items-center p-4">
|
<SidebarHeader className="bg-card-header border-b border-border/50 hidden md:flex h-16.25 flex-row items-center p-4">
|
||||||
<Link to="/volumes" className="flex items-center gap-3 font-semibold pl-2">
|
<Link to="/volumes" className="flex items-center gap-3 font-semibold pl-2">
|
||||||
<img src="/images/zerobyte.png" alt="Zerobyte Logo" className={cn("h-8 w-8 shrink-0 object-contain -ml-2")} />
|
<img src="/images/zerobyte.png" alt="Zerobyte Logo" className={cn("h-8 w-8 shrink-0 object-contain -ml-2")} />
|
||||||
<span
|
<span
|
||||||
|
|
@ -93,13 +98,16 @@ export function AppSidebar() {
|
||||||
</SidebarGroup>
|
</SidebarGroup>
|
||||||
</SidebarContent>
|
</SidebarContent>
|
||||||
<SidebarFooter className="p-4 border-r border-t border-border/50">
|
<SidebarFooter className="p-4 border-r border-t border-border/50">
|
||||||
<div
|
<a
|
||||||
className={cn("text-xs text-muted-foreground transition-all duration-200", {
|
href={releaseUrl}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className={cn("text-xs text-muted-foreground transition-all duration-200 hover:text-foreground", {
|
||||||
"opacity-0 w-0 overflow-hidden": state === "collapsed",
|
"opacity-0 w-0 overflow-hidden": state === "collapsed",
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{APP_VERSION}
|
{displayVersion}
|
||||||
</div>
|
</a>
|
||||||
</SidebarFooter>
|
</SidebarFooter>
|
||||||
</Sidebar>
|
</Sidebar>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue