Auto-capitalize photo input titles
This commit is contained in:
parent
fd85d504e8
commit
d2a26dcf36
@ -17,6 +17,7 @@ export default function FieldSetWithStatus({
|
|||||||
loading,
|
loading,
|
||||||
required,
|
required,
|
||||||
readOnly,
|
readOnly,
|
||||||
|
capitalize,
|
||||||
type = 'text',
|
type = 'text',
|
||||||
inputRef,
|
inputRef,
|
||||||
}: {
|
}: {
|
||||||
@ -31,6 +32,7 @@ export default function FieldSetWithStatus({
|
|||||||
loading?: boolean
|
loading?: boolean
|
||||||
required?: boolean
|
required?: boolean
|
||||||
readOnly?: boolean
|
readOnly?: boolean
|
||||||
|
capitalize?: boolean
|
||||||
type?: 'text' | 'email' | 'password' | 'checkbox'
|
type?: 'text' | 'email' | 'password' | 'checkbox'
|
||||||
inputRef?: LegacyRef<HTMLInputElement>
|
inputRef?: LegacyRef<HTMLInputElement>
|
||||||
}) {
|
}) {
|
||||||
@ -92,7 +94,7 @@ export default function FieldSetWithStatus({
|
|||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
readOnly={readOnly || pending}
|
readOnly={readOnly || pending}
|
||||||
className={cc(type === 'text' && 'w-full')}
|
className={cc(type === 'text' && 'w-full')}
|
||||||
autoCapitalize="off"
|
autoCapitalize={!capitalize ? 'off' : undefined}
|
||||||
/>}
|
/>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -143,6 +143,7 @@ export default function PhotoForm({
|
|||||||
options,
|
options,
|
||||||
optionsDefaultLabel,
|
optionsDefaultLabel,
|
||||||
readOnly,
|
readOnly,
|
||||||
|
capitalize,
|
||||||
hideIfEmpty,
|
hideIfEmpty,
|
||||||
hideBasedOnCamera,
|
hideBasedOnCamera,
|
||||||
loadingMessage,
|
loadingMessage,
|
||||||
@ -163,6 +164,7 @@ export default function PhotoForm({
|
|||||||
selectOptionsDefaultLabel={optionsDefaultLabel}
|
selectOptionsDefaultLabel={optionsDefaultLabel}
|
||||||
required={required}
|
required={required}
|
||||||
readOnly={readOnly}
|
readOnly={readOnly}
|
||||||
|
capitalize={capitalize}
|
||||||
placeholder={loadingMessage && !formData[key]
|
placeholder={loadingMessage && !formData[key]
|
||||||
? loadingMessage
|
? loadingMessage
|
||||||
: undefined}
|
: undefined}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ type FormMeta = {
|
|||||||
note?: string
|
note?: string
|
||||||
required?: boolean
|
required?: boolean
|
||||||
readOnly?: boolean
|
readOnly?: boolean
|
||||||
|
capitalize?: boolean
|
||||||
hideIfEmpty?: boolean
|
hideIfEmpty?: boolean
|
||||||
hideTemporarily?: boolean
|
hideTemporarily?: boolean
|
||||||
hideBasedOnCamera?: (make?: string, mode?: string) => boolean
|
hideBasedOnCamera?: (make?: string, mode?: string) => boolean
|
||||||
@ -32,7 +33,7 @@ type FormMeta = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const FORM_METADATA: Record<keyof PhotoFormData, FormMeta> = {
|
const FORM_METADATA: Record<keyof PhotoFormData, FormMeta> = {
|
||||||
title: { label: 'title' },
|
title: { label: 'title', capitalize: true },
|
||||||
tags: { label: 'tags', note: 'comma-separated values' },
|
tags: { label: 'tags', note: 'comma-separated values' },
|
||||||
id: { label: 'id', readOnly: true, hideIfEmpty: true },
|
id: { label: 'id', readOnly: true, hideIfEmpty: true },
|
||||||
blurData: {
|
blurData: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user