Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-andrusciac-lgp committed Dec 13, 2024
1 parent 1a0f952 commit 591afcd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ThemeDecorator/AccessibilityDecorator.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import hoc from '@enact/core/hoc';
import Registry from '@enact/core/internal/Registry';
import {setDefaultProps} from '@enact/core/util';
import {ResizeContext} from '@enact/ui/Resizable';
import {objectify} from '@enact/ui/Skinnable/util';
import PropTypes from 'prop-types';
import {useContext, useEffect, useRef} from 'react';

const accessibilityDefaultProps = {
textSize: 'normal'
};

/**
* A higher-order component that classifies an application with a target set of font sizing rules.
*
Expand All @@ -15,7 +20,7 @@ import {useContext, useEffect, useRef} from 'react';
*/
const AccessibilityDecorator = hoc((config, Wrapped) => {
const Accessibility = (props) => {
const {className, focusRing, highContrast, skinVariants, textSize = 'normal', ...rest} = props;
const {className, focusRing, highContrast, skinVariants, textSize, ...rest} = setDefaultProps(props, accessibilityDefaultProps);
let accessibilityClassName = highContrast ? `enact-a11y-high-contrast enact-text-${textSize}` : `enact-text-${textSize}`;
accessibilityClassName = focusRing ? `enact-a11y-focus-ring ${accessibilityClassName}` : `${accessibilityClassName}`;
const combinedClassName = className ? `${className} ${accessibilityClassName}` : accessibilityClassName;
Expand Down

0 comments on commit 591afcd

Please sign in to comment.