Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

Commit

Permalink
feat(plugins/toolbar): rename netzo.netzolabs() plugin to `netzo.to…
Browse files Browse the repository at this point in the history
…olbar()`
  • Loading branch information
miguelrk committed Jun 5, 2024
1 parent 3a41e28 commit e4ba5f2
Show file tree
Hide file tree
Showing 9 changed files with 462 additions and 375 deletions.
53 changes: 2 additions & 51 deletions lib/components/blocks/nav.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { signal } from "@preact/signals";
import type { ComponentChildren, JSX } from "preact";
import type { NetzoState } from "../../mod.ts";
import { DialogIssuesCreate } from "../../plugins/netzolabs/islands/dialog-issues-create.tsx";
import { Avatar, AvatarFallback, AvatarImage } from "../avatar.tsx";
import { Button, buttonVariants } from "../button.tsx";
import { buttonVariants } from "../button.tsx";
import {
DropdownMenu,
DropdownMenuContent,
Expand All @@ -26,7 +25,6 @@ type NavRootProps = JSX.IntrinsicElements["nav"] & {
};

export function NavRoot({ className, ...props }: NavRootProps) {
const { denoJson } = props.state?.netzolabs ?? {};
const darkMode = useDarkMode();

const logoSrc = darkMode.value
Expand All @@ -36,31 +34,11 @@ export function NavRoot({ className, ...props }: NavRootProps) {
const NavFooter = () => (
<footer className="w-full flex items-center justify-between p-3 b-t-1">
<a href="https://netzo.io/" target="_blank" className="mx-auto">
<img src={logoSrc} alt="Built with Netzo" className="h-[32px]" />
<img src={logoSrc} alt="Built with Netzo" title="Built with Netzo" className="h-[32px]" />
</a>
</footer>
);

const NavProjectVersion = () => {
if (!denoJson) return null;
// NOTE: uses style instead of className+unocss to avoid style flashing
return (
<>
<NavSeparator />
<div
title={denoJson.description}
style={{
textAlign: "center",
fontSize: "10px",
color: "hsl(var(--muted-foreground))",
}}
>
{denoJson.name}@{denoJson.version}
</div>
</>
);
};

return (
<>
{/* MOBILE */}
Expand Down Expand Up @@ -95,7 +73,6 @@ export function NavRoot({ className, ...props }: NavRootProps) {
>
{props.children}
<NavFooter />
<NavProjectVersion />
</nav>
</SheetContent>
</Sheet>
Expand All @@ -110,7 +87,6 @@ export function NavRoot({ className, ...props }: NavRootProps) {
>
{props.children}
<NavFooter />
<NavProjectVersion />
</nav>
</>
);
Expand Down Expand Up @@ -302,28 +278,3 @@ export function NavItemUser(
</DropdownMenu>
);
}

export function NavItemFeedback(props: {
icon?: string;
text: string;
locale: "en" | "es";
state: NetzoState;
}) {
return (
<DialogIssuesCreate locale={props.locale} state={props.state}>
<Button
variant="ghost"
className={cn(
"rounded-none",
"flex w-full justify-start h-[40px]",
"hover:cursor-pointer hover:bg-muted", // hover
)}
>
{props.icon && (props.icon.startsWith("http")
? <img {...props} src={props.icon} className="w-4 h-4 mr-3" />
: <div {...props} className={cn("w-4 h-4 mr-3", props.icon)} />)}
{props.text}
</Button>
</DialogIssuesCreate>
);
}
136 changes: 0 additions & 136 deletions lib/components/blocks/netzo-toolbar.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions lib/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { CronState } from "./plugins/cron/plugin.ts";
import type { DatabaseState } from "./plugins/database/plugin.ts";
import type { DatastoreState } from "./plugins/datastore/plugin.ts";
import type { EnvironmentsState } from "./plugins/environments/plugin.ts";
import type { NetzolabsState } from "./plugins/netzolabs/plugin.ts";
import type { StorageState } from "./plugins/storage/plugin.ts";
import type { ToolbarState } from "./plugins/toolbar/plugin.ts";
import { proxyConsole } from "./plugins/utils.ts";

// deno-lint-ignore no-global-assign
Expand All @@ -27,8 +27,8 @@ export type NetzoState = {
environments?: EnvironmentsState;
loader?: LoaderState;
mdx?: MdxState;
netzolabs?: NetzolabsState;
storage?: StorageState;
toolbar?: ToolbarState;
// unocss?: UnocssState;
[k: string]: unknown;
};
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export * from "./datastore/plugin.ts";
export * from "./environments/plugin.ts";
export * from "./loader/plugin.ts";
export * from "./mdx/plugin.ts";
export * from "./netzolabs/plugin.ts";
export * from "./storage/plugin.ts";
export * from "./toolbar/plugin.ts";
export * from "./unocss/plugin.ts";
Loading

0 comments on commit e4ba5f2

Please sign in to comment.