Skip to content

Commit 2295450

Browse files
feat: add useradmin external link on route actions (commaai#280)
resolves: commaai/connect#260 --------- Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
1 parent 4276b48 commit 2295450

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/RouteActions.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ const RouteActions: VoidComponent<RouteActionsProps> = (props) => {
4141
const [isPublic, setIsPublic] = createSignal<boolean | undefined>(undefined)
4242
const [isPreserved, setIsPreserved] = createSignal<boolean | undefined>(undefined)
4343

44+
const useradminUrl = () => `https://useradmin.comma.ai/?onebox=${currentRouteId()}`
45+
4446
createEffect(() => {
4547
const route = routeResource()
4648
const preservedRoutes = preservedRoutesResource()
@@ -103,7 +105,12 @@ const RouteActions: VoidComponent<RouteActionsProps> = (props) => {
103105
return (
104106
<div class="flex flex-col rounded-b-md gap-4 mx-5 mb-4">
105107
<div class="font-mono text-body-sm text-zinc-500">
106-
<h3 class="mb-2 text-on-surface-variant">Route ID:</h3>
108+
<div class="flex justify-between">
109+
<h3 class="mb-2 text-on-surface-variant">Route ID:</h3>
110+
<a href={useradminUrl()} class="text-blue-400 hover:text-blue-500 duration-200" target="_blank" rel="noopener noreferrer">
111+
View in useradmin
112+
</a>
113+
</div>
107114
<button
108115
onClick={() => void copyCurrentRouteId()}
109116
class="flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-surface-container-high bg-surface-container-lowest p-3 hover:bg-surface-container-low"

0 commit comments

Comments
 (0)