Skip to content

Commit b1b5d17

Browse files
committed
style: improve remote confix ux
1 parent e763d1a commit b1b5d17

File tree

6 files changed

+148
-72
lines changed

6 files changed

+148
-72
lines changed

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"react-hook-form": "^7.44.3",
116116
"react-hot-toast": "^2.4.0",
117117
"react-icons": "^4.11.0",
118+
"react-textarea-autosize": "^8.5.9",
118119
"react-use-wizard": "^2.2.3",
119120
"recharts": "^2.12.7",
120121
"sharp": "^0.33.4",

apps/web/src/components/AddFeatureFlagModal.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { RadioSelect } from "./RadioSelect";
1414
import { Toggle } from "./Toggle";
1515
import { Input } from "./ui/input";
1616
import { Label } from "./ui/label";
17+
import TextareaAutosize from "react-textarea-autosize";
1718

1819
type Props = {
1920
onClose: () => void;
@@ -124,13 +125,13 @@ export function ChangeFlagForm({
124125
/>
125126
)}
126127
{state.type === "STRING" && (
127-
<Input
128-
type="text"
128+
<TextareaAutosize
129129
value={state.value}
130130
onChange={(e) => onChange({ value: e.target.value })}
131131
placeholder={
132132
isRemoteConfig ? "My Remote Config" : "My Feature Flag"
133133
}
134+
className="w-full resize-none rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring overflow-hidden"
134135
/>
135136
)}
136137
{state.type === "NUMBER" && (

apps/web/src/components/Dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const Dropdown = ({ triggerIcon: Icon, children, className }: Props) => {
4141
type ItemProps = {
4242
children: React.ReactNode;
4343
shortcut?: string;
44-
} & DropdownMenu.MenuItemProps;
44+
} & DropdownMenu.DropdownMenuItemProps;
4545

4646
export const Item = ({
4747
children,

apps/web/src/components/FeatureFlag.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ export const FeatureFlag = ({
191191
}
192192
const keys = Object.keys(parsed);
193193
if (keys.length === 0) return "{ }";
194-
return `{ ${keys[0]}: ..., ${keys.length > 1 ? `+${keys.length - 1} more` : ""} }`;
194+
return `{ ${keys[0]}: ..., ${
195+
keys.length > 1 ? `+${keys.length - 1} more` : ""
196+
} }`;
195197
}
196198
return value;
197199
} catch {
@@ -257,13 +259,13 @@ export const FeatureFlag = ({
257259
className="justify-between w-full group"
258260
onClick={() => setIsUpdateModalOpen(true)}
259261
>
260-
<div className="flex items-center gap-2">
262+
<div className="flex items-center gap-2 overflow-hidden">
261263
<span className={cn("text-sm", envStyle.text)}>
262264
Current value:
263265
</span>
264266
<code
265267
className={cn(
266-
"px-2 py-1 rounded font-mono",
268+
"px-2 py-1 rounded font-mono max-w-[150px] truncate",
267269
envStyle.bg,
268270
envStyle.text
269271
)}
@@ -282,7 +284,7 @@ export const FeatureFlag = ({
282284
className="justify-between w-full group"
283285
onClick={() => setIsUpdateModalOpen(true)}
284286
>
285-
<div className="flex items-center gap-2">
287+
<div className="flex items-center gap-2 overflow-hidden">
286288
<span className={cn("text-sm", envStyle.text)}>
287289
Current value:
288290
</span>
@@ -307,7 +309,7 @@ export const FeatureFlag = ({
307309
className="items-center justify-between w-full group"
308310
onClick={() => setIsUpdateModalOpen(true)}
309311
>
310-
<div className="flex items-center gap-2">
312+
<div className="flex items-center gap-2 overflow-hidden">
311313
<span className={cn("text-sm", envStyle.text)}>
312314
Current value:
313315
</span>

apps/web/src/components/Modal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ export const Modal = ({
5050
<DialogContent className={cn(size === "full" && "sm:max-w-[980px]")}>
5151
<DialogTitle> {title} </DialogTitle>
5252
<DialogDescription>{subtitle}</DialogDescription>
53-
<div className="my-6 text-pink-50">{children}</div>
53+
<div className="my-6 text-pink-50 max-h-[60vh] overflow-y-auto">
54+
{children}
55+
</div>
5456

5557
<DialogFooter>
5658
<Button variant="secondary" onClick={onClose}>

0 commit comments

Comments
 (0)