Skip to content

Commit 7f25da5

Browse files
committed
Toggle password visiblility of the env var inputs
1 parent 048d34f commit 7f25da5

File tree

2 files changed

+14
-3
lines changed
  • apps/webapp/app
    • components/primitives
    • routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.environment-variables.new

2 files changed

+14
-3
lines changed

apps/webapp/app/components/primitives/Dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const DialogContent = React.forwardRef<
4343
<DialogPrimitive.Content
4444
ref={ref}
4545
className={cn(
46-
"fixed z-50 grid w-full gap-4 rounded-b-lg border bg-background-dimmed px-4 pb-6 pt-3.5 shadow-lg animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0",
46+
"fixed z-50 grid w-full gap-4 rounded-b-lg border bg-background-dimmed px-4 pb-4 pt-3.5 shadow-lg animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0",
4747
className
4848
)}
4949
{...props}

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.environment-variables.new/route.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { FormError } from "~/components/primitives/FormError";
1616
import { Input } from "~/components/primitives/Input";
1717
import { InputGroup } from "~/components/primitives/InputGroup";
1818
import { Label } from "~/components/primitives/Label";
19+
import { Switch } from "~/components/primitives/Switch";
1920
import { prisma } from "~/db.server";
2021
import { useOrganization } from "~/hooks/useOrganizations";
2122
import { useProject } from "~/hooks/useProject";
@@ -134,6 +135,8 @@ export default function Page() {
134135
shouldRevalidate: "onSubmit",
135136
});
136137

138+
const [revealAll, setRevealAll] = useState(false);
139+
137140
useEffect(() => {
138141
setIsOpen(true);
139142
}, []);
@@ -169,7 +172,15 @@ export default function Page() {
169172
/>
170173
</InputGroup>
171174
<InputGroup fullWidth>
172-
<Label>Values</Label>
175+
<div className="flex items-center justify-between">
176+
<Label>Values</Label>
177+
<Switch
178+
variant="small"
179+
label="Reveal values"
180+
checked={revealAll}
181+
onCheckedChange={(e) => setRevealAll(e.valueOf())}
182+
/>
183+
</div>
173184
<div className="grid grid-cols-[auto_1fr] gap-x-2 gap-y-2">
174185
{environments.map((environment, index) => {
175186
return (
@@ -186,7 +197,7 @@ export default function Page() {
186197
<EnvironmentLabel environment={environment} className="h-5 px-2" />
187198
</label>
188199
<Input
189-
type="password"
200+
type={revealAll ? "text" : "password"}
190201
name={`values[${index}].value`}
191202
placeholder="Not set"
192203
/>

0 commit comments

Comments
 (0)