diff --git a/src/authn-component/index.jsx b/src/authn-component/index.jsx index 00211b9b..cbe6b56a 100644 --- a/src/authn-component/index.jsx +++ b/src/authn-component/index.jsx @@ -1,6 +1,6 @@ import React, { useEffect, useMemo, useState } from 'react'; -import { Spinner } from '@openedx/paragon'; +import { breakpoints, Spinner, useMediaQuery } from '@openedx/paragon'; import PropTypes from 'prop-types'; import { getThirdPartyAuthContext, setCurrentOpenedForm, setOnboardingComponentContext } from './data/reducers'; @@ -46,6 +46,8 @@ export const AuthnComponent = ({ const dispatch = useDispatch(); const queryParams = useMemo(() => getAllPossibleQueryParams(), []); + const isExtraSmall = useMediaQuery({ maxWidth: breakpoints.extraSmall.maxWidth - 1 }); + const [screenSize, setScreenSize] = useState('lg'); const [hasCloseButton, setHasCloseButton] = useState(true); @@ -60,6 +62,15 @@ export const AuthnComponent = ({ const { provider: tpaProvider } = getTpaProvider(tpaHint, providers, secondaryProviders); const pendingState = queryParams?.tpa_hint && thirdPartyAuthApiStatus === PENDING_STATE; + useEffect(() => { + if (isExtraSmall) { + setScreenSize('fullscreen'); + } + if (!isExtraSmall && currentForm !== PROGRESSIVE_PROFILING_FORM) { + setScreenSize('lg'); + } + }, [isExtraSmall, currentForm]); + useEffect(() => { if (currentForm === PROGRESSIVE_PROFILING_FORM) { setHasCloseButton(false); diff --git a/src/forms/fields/index.scss b/src/forms/fields/index.scss index 9d9f6dd2..80287715 100644 --- a/src/forms/fields/index.scss +++ b/src/forms/fields/index.scss @@ -2,3 +2,4 @@ @import "password-field"; @import "text-field"; @import "auto-suggested-field"; +@import "marketing-email-opt-out-field"; diff --git a/src/forms/fields/marketing-email-opt-out-field/index.jsx b/src/forms/fields/marketing-email-opt-out-field/index.jsx index 46046daf..31c62f3c 100644 --- a/src/forms/fields/marketing-email-opt-out-field/index.jsx +++ b/src/forms/fields/marketing-email-opt-out-field/index.jsx @@ -2,9 +2,11 @@ import React from 'react'; import { useIntl } from '@edx/frontend-platform/i18n'; import { Form } from '@openedx/paragon'; +import classNames from 'classnames'; import PropTypes from 'prop-types'; import messages from './messages'; +import './index.scss'; /** * Marketing email opt in field component. It accepts following handler(s) @@ -15,13 +17,20 @@ import messages from './messages'; */ const MarketingEmailOptInCheckbox = (props) => { const { formatMessage } = useIntl(); - const { name, value, handleChange } = props; + const { + name, value, handleChange, isExtraSmall, + } = props; return (