Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 44 additions & 44 deletions src/renderer/components/shared/settings/SettingsModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
Dialog,
DialogContent,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
Expand Down Expand Up @@ -67,65 +66,66 @@ export const SettingsModal = () => {
<FiSettings className="ml-2 text-xl" />
</DialogTrigger>

<DialogContent className="flex h-[80vh] max-w-4xl flex-col p-0 lg:max-w-5xl">
<div className="flex h-full flex-col">
<DialogContent className="flex h-[80vh] max-w-4xl flex-col overflow-hidden p-0 lg:max-w-5xl">
<Tabs defaultValue="variables" className="flex min-h-0 flex-1 flex-col">
{/* Header - Fixed */}
<div className="shrink-0 px-4 pt-4">
<div className="shrink-0 bg-[#1F1F1F] px-6 pt-4 pb-3">
<DialogHeader>
<DialogTitle className="font-bold">Collection Settings</DialogTitle>
<DialogTitle className="px-1 text-xl leading-tight font-bold">
Collection Settings
</DialogTitle>
</DialogHeader>
<TabsList className="mt-4 gap-1 bg-transparent p-1">
<TabsTrigger
value="variables"
className="text-text-secondary rounded-full border border-transparent px-5 py-[10px] text-[15px] transition-colors hover:text-[#2F6F83] data-[state=active]:bg-[#193641] data-[state=active]:text-[#2F6F83]"
>
Variables
</TabsTrigger>

<TabsTrigger
value="environments"
className="text-text-secondary rounded-full border border-transparent px-5 py-[10px] text-[15px] transition-colors hover:text-[#2F6F83] data-[state=active]:bg-[#193641] data-[state=active]:text-[#2F6F83]"
>
Environments
</TabsTrigger>
</TabsList>
</div>

{/* Tabs - Takes remaining space */}
<Tabs defaultValue="variables" className="flex min-h-0 flex-1 flex-col">
<div className="shrink-0 px-4 py-4">
<TabsList className="bg-background">
<TabsTrigger value="variables" className="font-light!">
Variables
</TabsTrigger>
<TabsTrigger value="environments" className="font-light!">
Environments
</TabsTrigger>
</TabsList>
</div>

<TabsContent value="variables" className="m-0 min-h-0 flex-1 p-0">
<div className="h-full overflow-y-auto p-4">
<VariableEditor
variables={editorVariables}
onValidChange={setValid}
onVariablesChange={setEditorVariables}
/>
</div>
</TabsContent>
<TabsContent value="variables" className="m-0 min-h-0 flex-1 border-0 p-0">
<div className="h-full overflow-y-auto bg-[#111111] px-6 py-4">
<VariableEditor
variables={editorVariables}
onValidChange={setValid}
onVariablesChange={setEditorVariables}
/>
</div>
</TabsContent>

<TabsContent value="environments" className="m-0 min-h-0 flex-1 p-0">
<TabsContent value="environments" className="m-0 min-h-0 flex-1 border-0 p-0">
<div className="h-full overflow-y-auto bg-[#111111] px-6 py-4">
<EnvironmentEditor
environments={editorEnvironments}
selectedEnvironment={editorSelectedEnvironment}
onEnvironmentsChange={setEditorEnvironments}
onEnvironmentSelect={setEditorSelectedEnvironment}
onValidChange={setEnvironmentValid}
/>
</TabsContent>
</Tabs>

{/* Footer - Fixed */}
<DialogFooter className="shrink-0 p-4">
<div className="flex gap-2">
<Button onClick={() => setOpen(false)} variant="outline">
<span className="leading-4 font-bold">Cancel</span>
</Button>
<Button
onClick={save}
disabled={!isOverallValid}
variant={isOverallValid ? 'default' : 'defaultDisable'}
>
<span className="leading-4 font-bold">Save</span>
</Button>
</div>
</DialogFooter>
</div>
</TabsContent>
<div className="flex shrink-0 justify-end bg-[#111111] px-6 py-4">
<Button
onClick={save}
disabled={!isOverallValid}
variant={isOverallValid ? 'default' : 'defaultDisable'}
className="px-5 py-[13px]"
>
Save
</Button>
</div>
</Tabs>
</DialogContent>
</Dialog>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const VariableEditor = memo<VariableEditorProps>(
<input
type="text"
value={variable.key}
className={cn('w-full bg-transparent outline-hidden', {
className={cn('text-text-secondary w-full bg-transparent outline-hidden', {
'text-danger': invalidVariableKeys.has(variable.key),
})}
placeholder="Enter variable key"
Expand All @@ -116,9 +116,12 @@ export const VariableEditor = memo<VariableEditorProps>(
<SecretInput
secret={variable.secret}
value={variable.value}
className={cn('w-full border-none bg-transparent outline-hidden', {
'text-danger': invalidVariableKeys.has(variable.key),
})}
className={cn(
'text-text-secondary w-full border-none bg-transparent outline-hidden',
{
'text-danger': invalidVariableKeys.has(variable.key),
}
)}
placeholder="Enter variable value"
onChange={(e) => update(index, { value: e.target.value })}
/>
Expand All @@ -127,13 +130,14 @@ export const VariableEditor = memo<VariableEditorProps>(
<input
type="text"
value={variable.description}
className="w-full bg-transparent outline-hidden"
className="text-text-secondary w-full bg-transparent outline-hidden"
placeholder="Enter variable description"
onChange={(e) => update(index, { description: e.target.value })}
/>
</TableCell>
<TableCell className="text-center">
<Checkbox
className="data-[state=checked]:border-text-secondary data-[state=checked]:bg-text-secondary cursor-pointer"
checked={variable.secret}
onCheckedChange={(checked) => update(index, { secret: Boolean(checked) })}
/>
Expand All @@ -142,7 +146,7 @@ export const VariableEditor = memo<VariableEditorProps>(
<Button
variant="ghost"
size="icon"
className="hover:text-accent-primary active:text-accent-secondary w-5 hover:bg-transparent"
className="text-text-secondary hover:text-foreground w-5 hover:bg-transparent"
onClick={() => remove(index)}
>
<Trash2 />
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/components/ui/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { cn } from '@/lib/utils';

const Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(
({ className, ...props }, ref) => (
<div className={`relative rounded-(--radius) border`}>
<div className="relative border">
<table ref={ref} className={cn('w-full caption-bottom text-sm', className)} {...props} />
</div>
)
Expand Down Expand Up @@ -60,7 +60,7 @@ const TableHead = React.forwardRef<
<th
ref={ref}
className={cn(
'border-border text-muted-foreground h-12 px-4 text-left align-middle font-medium not-last:border-r [&:has([role=checkbox])]:pr-0',
'border-border text-muted-foreground h-12 px-4 text-left align-middle font-semibold not-last:border-r [&:has([role=checkbox])]:pr-0',
className
)}
{...props}
Expand All @@ -75,7 +75,7 @@ const TableCell = React.forwardRef<
<td
ref={ref}
className={cn(
'overflow-wrap break-word border-border p-4 align-middle break-all not-last:border-r',
'overflow-wrap break-word border-border text-text-secondary p-4 align-middle break-all not-last:border-r',
className
)}
{...props}
Expand Down