diff --git a/src/components/internal-components/InternalShadowRoundButton/InternalShadowRoundButton.tsx b/src/components/internal-components/InternalShadowRoundButton/InternalShadowRoundButton.tsx index 41c4b52cf..7489cb1ab 100644 --- a/src/components/internal-components/InternalShadowRoundButton/InternalShadowRoundButton.tsx +++ b/src/components/internal-components/InternalShadowRoundButton/InternalShadowRoundButton.tsx @@ -159,18 +159,16 @@ export const InternalShadowRoundButton = ( ...rest } = props; + const iconColorFilter = disabled + ? disabledIconColor + : defaultIconColor ?? null; + const icon = iconName && ( ); diff --git a/src/components/messaging-and-feedback/OakModalCenter/OakModalCenter.test.tsx b/src/components/messaging-and-feedback/OakModalCenter/OakModalCenter.test.tsx index bb2fc8c03..052705d86 100644 --- a/src/components/messaging-and-feedback/OakModalCenter/OakModalCenter.test.tsx +++ b/src/components/messaging-and-feedback/OakModalCenter/OakModalCenter.test.tsx @@ -53,13 +53,13 @@ describe(OakModalCenter, () => { it("hides close button when hideCloseButton is true", () => { const onCloseSpy = jest.fn(); - const { queryAllByTestId } = renderWithTheme( + const { queryByTestId } = renderWithTheme( Modal content , ); - expect(queryAllByTestId("close-button")).toBeNull; + expect(queryByTestId("close-button")).toBeNull(); }); it("calls onClose when the backdrop is clicked", () => { diff --git a/src/components/owa/OakCodeRenderer/OakCodeRenderer.test.tsx b/src/components/owa/OakCodeRenderer/OakCodeRenderer.test.tsx index 25de9a461..054f90404 100644 --- a/src/components/owa/OakCodeRenderer/OakCodeRenderer.test.tsx +++ b/src/components/owa/OakCodeRenderer/OakCodeRenderer.test.tsx @@ -20,7 +20,7 @@ describe("OakCodeRenderer", () => { const { getByText } = renderWithTheme( , ); - expect(getByText("output")).toBeInTheDocument; + expect(getByText("output")).toBeInTheDocument(); }); it("matches snapshot", () => { diff --git a/src/components/owa/pupil/lesson/OakLessonNavItem/OakLessonNavItem.tsx b/src/components/owa/pupil/lesson/OakLessonNavItem/OakLessonNavItem.tsx index 5538ec3be..a7473145c 100644 --- a/src/components/owa/pupil/lesson/OakLessonNavItem/OakLessonNavItem.tsx +++ b/src/components/owa/pupil/lesson/OakLessonNavItem/OakLessonNavItem.tsx @@ -156,12 +156,14 @@ export const OakLessonNavItem = ( disabledBackgroundColor, ] = pickColorsForSection(lessonSectionName); - const resolvedBackgroundColor = - isDisabled && disabledBackgroundColor - ? disabledBackgroundColor - : progress === "not-started" - ? notStartedBackgroundColor - : backgroundColor; + let resolvedBackgroundColor; + if (isDisabled && disabledBackgroundColor) { + resolvedBackgroundColor = disabledBackgroundColor; + } else if (progress === "not-started") { + resolvedBackgroundColor = notStartedBackgroundColor; + } else { + resolvedBackgroundColor = backgroundColor; + } return ( { + const { isOpen, onOpenChange, ...accordionProps } = props; + const contextValue = useMemo( + () => ({ isOpen, setOpen: onOpenChange }), + [isOpen, onOpenChange], + ); + return ( + + + + ); +}; + /** * - UnstyledChevronAccordion has a chevron icon that rotates when the accordion is open. * - Unlike InternalChevronAccordion, it has no border effects for hover or focus states. @@ -158,12 +174,7 @@ export const UnstyledChevronAccordion = ( ) => { // Is the accordion being used as a controlled component? if (props.isOpen !== undefined) { - const { isOpen, onOpenChange, ...accordionProps } = props; - return ( - - - - ); + return ; } const { isInitiallyOpen = false, ...accordionProps } = props;