Skip to content

Commit

Permalink
fix: checkbox label styles for small screen
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoa committed Nov 3, 2024
1 parent 1c9a2be commit a149a8d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/modal-tos/ModalToS.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { FormattedMessage, getLocale, injectIntl } from '@edx/frontend-platform/
import {
Button, Form, Hyperlink, ModalDialog, useToggle, useCheckboxSetValues,
ActionRow,
useWindowSize,
} from '@openedx/paragon';

import { getUserTOSPreference, updateUserTOSPreference } from './data/api';
Expand All @@ -23,7 +24,8 @@ const createTOSLink = (chunks, url) => (
const ModalToS = () => {
const [tosPreference, setTosPreference] = useState(undefined);
const [isOpen, open, close] = useToggle(false);

const {width} = useWindowSize();

Check failure on line 27 in src/components/modal-tos/ModalToS.jsx

View workflow job for this annotation

GitHub Actions / tests

A space is required after '{'

Check failure on line 27 in src/components/modal-tos/ModalToS.jsx

View workflow job for this annotation

GitHub Actions / tests

A space is required before '}'
const checkboxLabelStyle = (width<768)?"d-inline-block": null

Check failure on line 28 in src/components/modal-tos/ModalToS.jsx

View workflow job for this annotation

GitHub Actions / tests

Operator '<' must be spaced

Check failure on line 28 in src/components/modal-tos/ModalToS.jsx

View workflow job for this annotation

GitHub Actions / tests

Operator '?' must be spaced

Check failure on line 28 in src/components/modal-tos/ModalToS.jsx

View workflow job for this annotation

GitHub Actions / tests

Strings must use singlequote

Check failure on line 28 in src/components/modal-tos/ModalToS.jsx

View workflow job for this annotation

GitHub Actions / tests

Operator ':' must be spaced

Check failure on line 28 in src/components/modal-tos/ModalToS.jsx

View workflow job for this annotation

GitHub Actions / tests

Missing semicolon
const {
MODAL_UPDATE_TERMS_OF_SERVICE,
PRIVACY_POLICY_URL,
Expand Down Expand Up @@ -108,7 +110,7 @@ const ModalToS = () => {
>
{dataAuthorization
&& (
<Form.Checkbox value="dataAuthorization">
<Form.Checkbox value="dataAuthorization" labelClassName={checkboxLabelStyle}>
<FormattedMessage
id="modalToS.dataAuthorization.checkbox.label"
description="The label for the data authorization checkbox inside the TOS modal."
Expand All @@ -121,7 +123,7 @@ const ModalToS = () => {
)}
{termsOfService
&& (
<Form.Checkbox value="termsOfService">
<Form.Checkbox value="termsOfService" labelClassName={checkboxLabelStyle}>
<FormattedMessage
id="modalToS.termsOfService.checkbox.label"
description="The label for the terms of service checkbox inside the TOS modal."
Expand All @@ -135,7 +137,7 @@ const ModalToS = () => {
)}
{honorCode
&& (
<Form.Checkbox value="honorCode">
<Form.Checkbox value="honorCode" labelClassName={checkboxLabelStyle}>
<FormattedMessage
id="modalToS.honorCode.checkbox.label"
description="The label for the honor code checkbox inside the TOS modal."
Expand Down

0 comments on commit a149a8d

Please sign in to comment.