Skip to content

Commit

Permalink
copy edits, style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xvvvyz committed Sep 13, 2024
1 parent 5dfb03e commit 5d18cb8
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 44 deletions.
2 changes: 1 addition & 1 deletion app/_components/event-type-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const EventTypeForm = ({
<Input maxLength={49} required {...form.register('name')} />
</InputRoot>
<InputRoot>
<Label.Root htmlFor="content">Description or instructions</Label.Root>
<Label.Root htmlFor="content">Description</Label.Root>
<Controller
control={form.control}
name="content"
Expand Down
84 changes: 43 additions & 41 deletions app/_components/event-type-use-template-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,54 +48,56 @@ const EventTypeUseTemplateModal = <T extends Form.FieldValues>({
Selecting a template will overwrite any existing event type
values.
</Modal.Description>
<Select
className="pt-16 text-left"
isLoading={isTransitioning}
noOptionsMessage={() => 'No templates.'}
onChange={(t) =>
startTransition(async () => {
const template = t as NonNullable<
ListTemplatesBySubjectIdAndTypeData | ListTemplatesData
>[0];
<div className="pt-16 text-left">
<Select
isLoading={isTransitioning}
noOptionsMessage={() => 'No templates.'}
onChange={(t) =>
startTransition(async () => {
const template = t as NonNullable<
ListTemplatesBySubjectIdAndTypeData | ListTemplatesData
>[0];

const { data: templateData } = await getTemplateData(
template.id,
);
const { data: templateData } = await getTemplateData(
template.id,
);

const data = templateData?.data as EventTypeTemplateDataJson;
const data =
templateData?.data as EventTypeTemplateDataJson;

const inputs = availableInputs.filter(({ id }) =>
forceArray(data?.inputIds).includes(id),
);
const inputs = availableInputs.filter(({ id }) =>
forceArray(data?.inputIds).includes(id),
);

form.setValue(
'name' as Form.FieldPath<T>,
template.name as Form.PathValue<T, Form.FieldPath<T>>,
{ shouldDirty: true },
);
form.setValue(
'name' as Form.FieldPath<T>,
template.name as Form.PathValue<T, Form.FieldPath<T>>,
{ shouldDirty: true },
);

form.setValue(
'content' as Form.FieldPath<T>,
(data?.content ?? '') as Form.PathValue<
T,
Form.FieldPath<T>
>,
{ shouldDirty: true },
);
form.setValue(
'content' as Form.FieldPath<T>,
(data?.content ?? '') as Form.PathValue<
T,
Form.FieldPath<T>
>,
{ shouldDirty: true },
);

form.setValue(
'inputs' as Form.FieldPath<T>,
inputs as Form.PathValue<T, Form.FieldPath<T>>,
{ shouldDirty: true },
);
form.setValue(
'inputs' as Form.FieldPath<T>,
inputs as Form.PathValue<T, Form.FieldPath<T>>,
{ shouldDirty: true },
);

toggleOpen();
})
}
options={availableEventTypeTemplates as IOption[]}
placeholder="Select a template…"
value={null}
/>
toggleOpen();
})
}
options={availableEventTypeTemplates as IOption[]}
placeholder="Select a template…"
value={null}
/>
</div>
<Modal.Close asChild onClick={(e) => e.preventDefault()}>
<Button
className="-mb-3 mt-14 w-full justify-center p-0 py-3"
Expand Down
2 changes: 1 addition & 1 deletion app/_components/module-form-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const ModuleFormSection = <
<RichTextarea
className="rounded-none border-t-0"
key={field.name}
placeholder="Description or instructions"
placeholder="Instructions"
{...field}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion app/_components/protocol-use-template-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const ProtocolUseTemplateModal = ({
<Modal.Content className="max-w-sm p-8 text-center">
<Modal.Title className="text-2xl">Use template</Modal.Title>
<Modal.Description className="mt-4 px-4 text-fg-4">
It is easier than typing.
It&rsquo;s easier than typing.
</Modal.Description>
<div className="pt-16 text-left">
<Select
Expand Down

0 comments on commit 5d18cb8

Please sign in to comment.