Skip to content

Commit 532580a

Browse files
committed
fix: show copy button in inputs
1 parent e410867 commit 532580a

File tree

2 files changed

+39
-22
lines changed

2 files changed

+39
-22
lines changed

frontend/src/components/copy-area.tsx

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -185,25 +185,34 @@ export function DiscreteInput({
185185
const finalShow = showState || !!show;
186186
return (
187187
<div className="relative">
188-
<ClickToCopy value={value}>
189-
<Input
190-
type={finalShow ? "text" : "password"}
191-
readOnly
192-
value={finalShow ? value : "very-secure-password"}
193-
className={cn("font-mono cursor-pointer", !show && "pr-8")}
194-
/>
195-
</ClickToCopy>
196-
{!show ? (
197-
<Button
198-
variant="ghost"
199-
size="icon-sm"
200-
className="absolute right-1 top-1/2 -translate-y-1/2 opacity-50"
201-
type="button"
202-
onClick={() => setShowState(!showState)}
203-
>
204-
<Icon icon={showState ? faEye : faEyeSlash} />
205-
</Button>
206-
) : null}
188+
<Input
189+
type={finalShow ? "text" : "password"}
190+
readOnly
191+
value={finalShow ? value : "very-secure-password"}
192+
className={cn("font-mono", !show ? "pr-16" : "pr-8")}
193+
/>
194+
<div className="absolute right-1 top-1/2 -translate-y-1/2 opacity-50 flex gap-1">
195+
<ClickToCopy value={value}>
196+
<Button variant="ghost" size="icon-sm" type="button">
197+
<Icon icon={faCopy} />
198+
</Button>
199+
</ClickToCopy>
200+
{!show ? (
201+
<WithTooltip
202+
content={finalShow ? "Hide" : "Show"}
203+
trigger={
204+
<Button
205+
variant="ghost"
206+
size="icon-sm"
207+
type="button"
208+
onClick={() => setShowState(!showState)}
209+
>
210+
<Icon icon={showState ? faEye : faEyeSlash} />
211+
</Button>
212+
}
213+
/>
214+
) : null}
215+
</div>
207216
</div>
208217
);
209218
}

frontend/src/routes/_context/_cloud/orgs.$organization/projects.$project/ns.$namespace/connect.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
import { faQuestionCircle, faRailway, faVercel, Icon } from "@rivet-gg/icons";
1+
import {
2+
faPlus,
3+
faQuestionCircle,
4+
faRailway,
5+
faVercel,
6+
Icon,
7+
} from "@rivet-gg/icons";
28
import { useInfiniteQuery } from "@tanstack/react-query";
39
import {
410
createFileRoute,
511
notFound,
612
Link as RouterLink,
7-
useNavigate,
813
} from "@tanstack/react-router";
914
import { match } from "ts-pattern";
1015
import { HelpDropdown } from "@/app/help-dropdown";
@@ -156,7 +161,10 @@ function Providers() {
156161
size="lg"
157162
className="min-w-32"
158163
variant="outline"
159-
></Button>
164+
startIcon={<Icon icon={faPlus} />}
165+
>
166+
Add Provider
167+
</Button>
160168
</DropdownMenuTrigger>
161169
<DropdownMenuContent>
162170
<DropdownMenuItem

0 commit comments

Comments
 (0)