Adjust film form text
This commit is contained in:
parent
7bf2c45145
commit
3a8af98235
@ -9,12 +9,14 @@ import TagInput from './TagInput';
|
|||||||
import { FiChevronDown } from 'react-icons/fi';
|
import { FiChevronDown } from 'react-icons/fi';
|
||||||
import { parameterize } from '@/utility/string';
|
import { parameterize } from '@/utility/string';
|
||||||
import Checkbox from './Checkbox';
|
import Checkbox from './Checkbox';
|
||||||
|
import ResponsiveText from './primitives/ResponsiveText';
|
||||||
|
|
||||||
export default function FieldSetWithStatus({
|
export default function FieldSetWithStatus({
|
||||||
id: _id,
|
id: _id,
|
||||||
label,
|
label,
|
||||||
icon,
|
icon,
|
||||||
note,
|
note,
|
||||||
|
noteShort,
|
||||||
error,
|
error,
|
||||||
value,
|
value,
|
||||||
isModified,
|
isModified,
|
||||||
@ -40,6 +42,7 @@ export default function FieldSetWithStatus({
|
|||||||
label: string
|
label: string
|
||||||
icon?: ReactNode
|
icon?: ReactNode
|
||||||
note?: string
|
note?: string
|
||||||
|
noteShort?: string
|
||||||
error?: string
|
error?: string
|
||||||
value: string
|
value: string
|
||||||
isModified?: boolean
|
isModified?: boolean
|
||||||
@ -128,9 +131,12 @@ export default function FieldSetWithStatus({
|
|||||||
{label}
|
{label}
|
||||||
</span>
|
</span>
|
||||||
{note && !error &&
|
{note && !error &&
|
||||||
<span className="text-gray-400 dark:text-gray-600">
|
<ResponsiveText
|
||||||
|
className="text-gray-400 dark:text-gray-600"
|
||||||
|
shortText={`(${noteShort})`}
|
||||||
|
>
|
||||||
({note})
|
({note})
|
||||||
</span>}
|
</ResponsiveText>}
|
||||||
{isModified && !error &&
|
{isModified && !error &&
|
||||||
<span className={clsx(
|
<span className={clsx(
|
||||||
'text-main font-medium text-[0.9rem]',
|
'text-main font-medium text-[0.9rem]',
|
||||||
|
|||||||
@ -1,20 +1,26 @@
|
|||||||
|
import clsx from 'clsx/lite';
|
||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
|
|
||||||
export default function ResponsiveText({
|
export default function ResponsiveText({
|
||||||
children,
|
|
||||||
shortText,
|
shortText,
|
||||||
|
className,
|
||||||
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: ReactNode
|
|
||||||
shortText?: ReactNode
|
shortText?: ReactNode
|
||||||
|
className?: string
|
||||||
|
children: ReactNode
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* Short text */}
|
{/* Short text */}
|
||||||
<span className="inline sm:hidden" aria-hidden>
|
<span
|
||||||
|
className={clsx('inline sm:hidden', className)}
|
||||||
|
aria-hidden
|
||||||
|
>
|
||||||
{shortText ?? children}
|
{shortText ?? children}
|
||||||
</span>
|
</span>
|
||||||
{/* Full text */}
|
{/* Full text */}
|
||||||
<span className="hidden sm:inline">
|
<span className={clsx('hidden sm:inline', className)}>
|
||||||
{children}
|
{children}
|
||||||
</span>
|
</span>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -336,6 +336,7 @@ export default function PhotoForm({
|
|||||||
.map(([key, {
|
.map(([key, {
|
||||||
label,
|
label,
|
||||||
note,
|
note,
|
||||||
|
noteShort,
|
||||||
required,
|
required,
|
||||||
selectOptions,
|
selectOptions,
|
||||||
selectOptionsDefaultLabel,
|
selectOptionsDefaultLabel,
|
||||||
@ -363,6 +364,7 @@ export default function PhotoForm({
|
|||||||
: ''
|
: ''
|
||||||
),
|
),
|
||||||
note,
|
note,
|
||||||
|
noteShort,
|
||||||
error: formErrors[key],
|
error: formErrors[key],
|
||||||
value: staticValue ?? formData[key] ?? '',
|
value: staticValue ?? formData[key] ?? '',
|
||||||
isModified: (
|
isModified: (
|
||||||
|
|||||||
@ -48,6 +48,7 @@ export type AnnotatedTag = {
|
|||||||
export type FormMeta = {
|
export type FormMeta = {
|
||||||
label: string
|
label: string
|
||||||
note?: string
|
note?: string
|
||||||
|
noteShort?: string
|
||||||
required?: boolean
|
required?: boolean
|
||||||
excludeFromInsert?: boolean
|
excludeFromInsert?: boolean
|
||||||
readOnly?: boolean
|
readOnly?: boolean
|
||||||
@ -118,7 +119,8 @@ const FORM_METADATA = (
|
|||||||
model: { label: 'camera model' },
|
model: { label: 'camera model' },
|
||||||
film: {
|
film: {
|
||||||
label: 'film',
|
label: 'film',
|
||||||
note: 'Intended for Fujifilm cameras or film scans',
|
note: 'Intended for Fujifilm simulations and analog scans',
|
||||||
|
noteShort: 'Fujifilm simulations / analog scans',
|
||||||
shouldNotOverwriteWithNullDataOnSync: true,
|
shouldNotOverwriteWithNullDataOnSync: true,
|
||||||
},
|
},
|
||||||
recipeTitle: {
|
recipeTitle: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user