diff --git a/.eslintrc.json b/.eslintrc.json index 5be033a58..5cc58d72e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -20,7 +20,11 @@ "functional/no-method-signature": 0, "no-var": "error", "no-param-reassign": "error", - "prefer-const": "error" + "prefer-const": "error", + "jsx-a11y/label-has-associated-control": [ + 2, + { "controlComponents": ["TextArea"] } + ] }, "settings": { "react": { diff --git a/src/components/EntryForm.tsx b/src/components/EntryForm.tsx index 559a0f42a..ce6257a08 100644 --- a/src/components/EntryForm.tsx +++ b/src/components/EntryForm.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useState, useMemo } from 'react'; -import styled from '@emotion/styled'; import { useForm, Controller, @@ -27,6 +26,7 @@ import crosshair from '../../public/crosshair-small.svg'; import { useMapState } from './MapState'; import Icon from '../design-system/components/Icon'; import { css } from '@emotion/react'; +import TextArea from '../design-system/components/TextArea'; type OpeningDayStates = | `${Lowercase}-is-open` @@ -42,16 +42,6 @@ const openingTimesFields = WEEKDAYS.flatMap((day): OpeningDayStates[] => { ]; }); -const Textarea = styled.textarea` - display: block; - height: 10rem; - width: 100%; - margin-top: ${(props) => props.theme.space[1]}px; - padding: ${(props) => props.theme.space[2]}px; - color: ${(props) => props.theme.colors.primary}; - border: 1px solid ${(props) => props.theme.colors.primary}; -`; - interface Question { field: string; subQuestion: string | React.ReactElement; @@ -783,10 +773,11 @@ const EntryForm = ({ title, loo, children, ...props }) => { -