Skip to content

Commit 00b7602

Browse files
authored
Update image 'edit' form title, as form isn't actually editable (#2312)
Update image 'edit' form title, as it isn't editable
1 parent 3a2e3e1 commit 00b7602

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/forms/image-edit.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { PropertiesTable } from '~/ui/lib/PropertiesTable'
2626
import { ResourceLabel } from '~/ui/lib/SideModal'
2727
import { Truncate } from '~/ui/lib/Truncate'
2828
import { pb } from '~/util/path-builder'
29+
import { capitalize } from '~/util/str'
2930
import { bytesToGiB } from '~/util/units'
3031

3132
EditProjectImageSideModalForm.loader = async ({ params }: LoaderFunctionArgs) => {
@@ -69,12 +70,14 @@ export function EditImageSideModalForm({
6970
}) {
7071
const navigate = useNavigate()
7172
const form = useForm({ defaultValues: image })
73+
const resourceName = type === 'Project' ? 'project image' : 'silo image'
7274

7375
return (
7476
<SideModalForm
77+
title={capitalize(resourceName)}
7578
form={form}
7679
formType="edit"
77-
resourceName={type === 'Project' ? 'project image' : 'silo image'}
80+
resourceName={resourceName}
7881
onDismiss={() => navigate(dismissLink)}
7982
subtitle={
8083
<ResourceLabel>
@@ -100,7 +103,6 @@ export function EditImageSideModalForm({
100103
<DateTime date={image.timeModified} />
101104
</PropertiesTable.Row>
102105
</PropertiesTable>
103-
104106
<NameField name="name" control={form.control} disabled />
105107
<DescriptionField name="description" control={form.control} required disabled />
106108
<TextField name="os" label="OS" control={form.control} required disabled />

0 commit comments

Comments
 (0)