Skip to content

Commit

Permalink
Remove unnecessary checkboxes for repeated opening hours
Browse files Browse the repository at this point in the history
Instead, we give the label a more descriptive title.
  • Loading branch information
kasperbirch1 committed Apr 25, 2024
1 parent 6a0e261 commit 6731c8d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 35 deletions.
31 changes: 4 additions & 27 deletions src/apps/opening-hours-editor/EventForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,37 +180,14 @@ const EventForm: React.FC<EventFormProps> = ({
htmlFor="event-form-repeated"
>
{t("openingHoursEventFormRepeatedText", {
placeholders: { "@startDate": startDateString }
placeholders: {
"@startDate": startDateString,
"@weekDayName": weekDayName
}
})}
</label>
</div>

<div className="opening-hours-editor-form__checkbox">
<input
id="event-form-weekly"
data-cy="opening-hours-editor-form-week-day"
type="checkbox"
checked={isRepeated}
disabled={!isRepeated}
/>
<label className="" htmlFor="event-form-weekly">
{t("openingHoursEventFormWeklyText")}
</label>
</div>

<div className="opening-hours-editor-form__checkbox">
<input
id="event-form-week-day"
data-cy="opening-hours-editor-form-week-day"
type="checkbox"
checked={isRepeated}
disabled={!isRepeated}
/>
<label className="" htmlFor="event-form-week-day">
{weekDayName}
</label>
</div>

<label
className="opening-hours-editor-form__label"
htmlFor="event-form-end-date"
Expand Down
9 changes: 2 additions & 7 deletions src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,10 @@ export default {
},
openingHoursEventFormRepeatedText: {
name: "Opening hours event form repeated",
defaultValue: "Repeat opening hour from @startDate",
control: { type: "text" }
},
openingHoursEventFormWeklyText: {
name: "Opening hours event form weekly",
defaultValue: "Weekly",
defaultValue:
"Repeat opening hour weekly every @weekDayName from @startDate",
control: { type: "text" }
},

openingHoursEventFormEndDateText: {
name: "Opening hours event to end date",
defaultValue: "End date",
Expand Down
1 change: 0 additions & 1 deletion src/apps/opening-hours-editor/OpeningHoursEditor.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ interface OpeningHoursEditorEntryTextProps {
openingHoursEventFormEndTimeText: string;
openingHoursEventFormSubmitText: string;
openingHoursEventFormRepeatedText: string;
openingHoursEventFormWeklyText: string;
openingHoursEventFormEndDateText: string;
openingHoursEventFormEveryWeekdayText: string;
openingHoursEventFormStartDateText: string;
Expand Down

0 comments on commit 6731c8d

Please sign in to comment.