diff --git a/config/2024/config.json b/config/2024/config.json index 53b36cf..5648312 100644 --- a/config/2024/config.json +++ b/config/2024/config.json @@ -2,6 +2,7 @@ "$schema": "../schema.json", "title": "QRScout", "page_title": "Crescendo", + "delimiter": "\t", "sections": [ { "name": "Prematch", @@ -111,7 +112,8 @@ "6": "Midline 3 (Middle)", "7": "Midline 2", "8": "Midline 1 (Amp Edge)" - } + }, + "required": false }, { "code": "auf", @@ -245,4 +247,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/config/schema.json b/config/schema.json index 9f85202..ff8c99f 100644 --- a/config/schema.json +++ b/config/schema.json @@ -14,6 +14,9 @@ "page_title": { "type": "string" }, + "delimiter": { + "type": "string" + }, "sections": { "type": "array", "items": { @@ -21,7 +24,11 @@ } } }, - "required": ["title", "page_title", "sections"], + "required": [ + "title", + "page_title", + "sections" + ], "additionalProperties": false }, "Section": { @@ -41,7 +48,10 @@ } } }, - "required": ["name", "fields"], + "required": [ + "name", + "fields" + ], "additionalProperties": false }, "InputProps": { @@ -87,7 +97,12 @@ "type": "boolean" } }, - "required": ["title", "type", "required", "code"], + "required": [ + "title", + "type", + "required", + "code" + ], "additionalProperties": false }, "InputTypes": { @@ -104,4 +119,4 @@ ] } } -} +} \ No newline at end of file diff --git a/src/components/QR/PreviewText.tsx b/src/components/QR/PreviewText.tsx index 86d3be3..a86ece9 100644 --- a/src/components/QR/PreviewText.tsx +++ b/src/components/QR/PreviewText.tsx @@ -1,10 +1,12 @@ +import { useQRScoutState } from '../../store/store'; import { CopyButton } from './CopyButton'; export type PreviewTextProps = { data: string; }; export function PreviewText(props: PreviewTextProps) { - const chunks = props.data.split('\t'); + const formData = useQRScoutState(state => state.formData); + const chunks = props.data.split(formData.delimiter); return (