mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 06:04:05 +00:00
refactor: param type colour
This commit is contained in:
committed by
Carlos Valente
parent
24b0cfd24e
commit
089eba3877
@@ -81,6 +81,17 @@ export default function ParamInput(props: EditFormInputProps) {
|
||||
);
|
||||
}
|
||||
|
||||
if (type === 'colour') {
|
||||
const currentvalue = `#${searchParams.get(id) ?? defaultValue}`;
|
||||
|
||||
return (
|
||||
<div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
|
||||
<Input type='color' variant='ontime-filled' name={id} defaultValue={currentvalue} />
|
||||
<span>{`Current colour: ${currentvalue.toUpperCase()}`}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const defaultStringValue = searchParams.get(id) ?? defaultValue;
|
||||
const { prefix, placeholder } = paramField;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user