Skip to content

Commit 7155e15

Browse files
authored
converted action buttons to sticky footer action buttons (#11293)
1 parent 9630386 commit 7155e15

File tree

4 files changed

+34
-29
lines changed

4 files changed

+34
-29
lines changed

ui/litellm-dashboard/src/components/key_edit_view.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState, useEffect } from "react";
2-
import { Form, Input, Select } from "antd";
3-
import { Button, TextInput } from "@tremor/react";
2+
import { Form, Input, Select, Button as AntdButton } from "antd";
3+
import { Button as TremorButton, TextInput } from "@tremor/react";
44
import { KeyResponse } from "./key_team_helpers/key_list";
55
import { fetchTeamModels } from "../components/create_key_button";
66
import { modelAvailableCall } from "./networking";
@@ -203,13 +203,15 @@ export function KeyEditView({
203203
<Input />
204204
</Form.Item>
205205

206-
<div className="flex justify-end gap-2 mt-6">
207-
<Button variant="light" onClick={onCancel}>
208-
Cancel
209-
</Button>
210-
<Button>
211-
Save Changes
212-
</Button>
206+
<div className="sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]">
207+
<div className="flex justify-end items-center gap-2">
208+
<AntdButton onClick={onCancel}>
209+
Cancel
210+
</AntdButton>
211+
<TremorButton type="submit">
212+
Save Changes
213+
</TremorButton>
214+
</div>
213215
</div>
214216
</Form>
215217
);

ui/litellm-dashboard/src/components/key_info_view.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export default function KeyInfoView({ keyId, onClose, keyData, accessToken, user
134134
};
135135

136136
return (
137-
<div className="p-4">
137+
<div className="w-full h-screen p-4">
138138
<div className="flex justify-between items-center mb-6">
139139
<div>
140140
<Button
@@ -273,7 +273,7 @@ export default function KeyInfoView({ keyId, onClose, keyData, accessToken, user
273273

274274
{/* Settings Panel */}
275275
<TabPanel>
276-
<Card>
276+
<Card className="overflow-y-auto max-h-[65vh]">
277277
<div className="flex justify-between items-center mb-4">
278278
<Title>Key Settings</Title>
279279
{!isEditing && userRole && rolesWithWriteAccess.includes(userRole) && (

ui/litellm-dashboard/src/components/organization/organization_view.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ const OrganizationInfoView: React.FC<OrganizationInfoProps> = ({
338338

339339
{/* Settings Panel */}
340340
<TabPanel>
341-
<Card>
341+
<Card className="overflow-y-auto max-h-[65vh]">
342342
<div className="flex justify-between items-center mb-4">
343343
<Title>Organization Settings</Title>
344344
{(canEditOrg && !isEditing) && (
@@ -423,13 +423,15 @@ const OrganizationInfoView: React.FC<OrganizationInfoProps> = ({
423423
<Input.TextArea rows={4} />
424424
</Form.Item>
425425

426-
<div className="flex justify-end gap-2 mt-6">
427-
<Button onClick={() => setIsEditing(false)}>
428-
Cancel
429-
</Button>
430-
<TremorButton type="submit">
431-
Save Changes
432-
</TremorButton>
426+
<div className="sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]">
427+
<div className="flex justify-end items-center gap-2">
428+
<Button onClick={() => setIsEditing(false)}>
429+
Cancel
430+
</Button>
431+
<TremorButton type="submit">
432+
Save Changes
433+
</TremorButton>
434+
</div>
433435
</div>
434436
</Form>
435437
) : (

ui/litellm-dashboard/src/components/team/team_info.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
358358

359359
{/* Settings Panel */}
360360
<TabPanel>
361-
<Card>
361+
<Card className="overflow-y-auto max-h-[65vh]">
362362
<div className="flex justify-between items-center mb-4">
363363
<Title>Team Settings</Title>
364364
{(canEditTeam && !isEditing) && (
@@ -474,15 +474,16 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
474474
<Form.Item label="Metadata" name="metadata">
475475
<Input.TextArea rows={10} />
476476
</Form.Item>
477-
478-
479-
<div className="flex justify-end gap-2 mt-6">
480-
<Button onClick={() => setIsEditing(false)}>
481-
Cancel
482-
</Button>
483-
<TremorButton>
484-
Save Changes
485-
</TremorButton>
477+
478+
<div className="sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]">
479+
<div className="flex justify-end items-center gap-2">
480+
<Button htmlType="button" onClick={() => setIsEditing(false)}>
481+
Cancel
482+
</Button>
483+
<TremorButton type="submit">
484+
Save Changes
485+
</TremorButton>
486+
</div>
486487
</div>
487488
</Form>
488489
) : (

0 commit comments

Comments
 (0)