Skip to content

Commit 75f218a

Browse files
drew-harrisskeptrunedev
authored andcommitted
feat: add copy id button
1 parent d7c84de commit 75f218a

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

frontends/dashboard/src/components/CopyButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export const CopyButton = (props: CopyButtonProps) => {
1616
}}
1717
>
1818
<Show when={copied()}>
19-
<FiCheck />
19+
<FiCheck size={props.size ?? 16} />
2020
</Show>
2121
<Show when={!copied()}>
22-
<FiClipboard class="text-gray-500" />
22+
<FiClipboard size={props.size ?? 16} class="text-gray-500" />
2323
</Show>
2424
</button>
2525
);
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { useContext } from "solid-js";
22
import { UserContext } from "../contexts/UserContext";
3+
import { CopyButton } from "./CopyButton";
34

45
export const OrgName = () => {
56
const userContext = useContext(UserContext);
67

78
return (
8-
<h3 class="text-xl font-semibold text-neutral-600">
9+
<h3 class="flex items-baseline gap-2 text-xl font-semibold text-neutral-600">
910
{userContext.selectedOrg().name}
11+
<CopyButton size={14} text={userContext.selectedOrg().id} />
1012
</h3>
1113
);
1214
};

frontends/dashboard/src/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { OrganizationHomepage } from "./pages/orgs/OrganizationHomepage.tsx";
1919
import { OrgUserPage } from "./pages/orgs/OrgUserPage.tsx";
2020
import { OrgBillingPage } from "./pages/orgs/OrgBillingPage.tsx";
2121
import { OrgSettings } from "./pages/orgs/OrgSettings.tsx";
22+
import { HomeRedirect } from "./pages/HomeRedirect.tsx";
2223

2324
if (!DEV) {
2425
Sentry.init({
@@ -50,10 +51,11 @@ const routes: RouteDefinition[] = [
5051
{
5152
path: "/",
5253
component: NavbarLayout,
53-
load: (args) => {
54-
args.params;
55-
},
5654
children: [
55+
{
56+
path: "/",
57+
component: HomeRedirect,
58+
},
5759
{
5860
path: "/org",
5961
component: OrganizationLayout,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { useNavigate } from "@solidjs/router";
2+
import { onMount } from "solid-js";
3+
4+
export const HomeRedirect = () => {
5+
const navigate = useNavigate();
6+
7+
onMount(() => {
8+
navigate("/org");
9+
});
10+
11+
return <></>;
12+
};

0 commit comments

Comments
 (0)