diff --git a/src/components/CodePreview/index.tsx b/src/components/CodePreview/index.tsx index fa2fcd436..97f0881da 100644 --- a/src/components/CodePreview/index.tsx +++ b/src/components/CodePreview/index.tsx @@ -62,7 +62,7 @@ const ActionButtons: React.FC = ({ selectedLanguage, isLargeViewport, }) => { - const { oppositeTheme } = useTheme(); + const { theme } = useTheme(); return (
{showStackblitzBtn && projectTitle !== undefined && ( @@ -78,7 +78,7 @@ const ActionButtons: React.FC = ({ aria-label={isLargeViewport ? "" : "Copy code"} variant={isLargeViewport ? "tertiary" : "icon"} size={isLargeViewport ? "small" : "medium"} - theme={oppositeTheme} + theme={theme} monochrome onClick={() => { navigator.clipboard.writeText(code); @@ -107,7 +107,7 @@ const ToggleShowButton: React.FC = ({ showMore, setShowMore, }) => { - const { oppositeTheme } = useTheme(); + const { theme } = useTheme(); return (
{type === "pattern" && ( @@ -115,7 +115,7 @@ const ToggleShowButton: React.FC = ({ variant="tertiary" size="small" onClick={() => setShow(!show)} - theme={oppositeTheme} + theme={theme} monochrome > {!show ? "Show" : "Hide"} code @@ -133,8 +133,8 @@ const ToggleShowButton: React.FC = ({ variant="tertiary" size="small" onClick={() => setShowMore(!showMore)} - theme={oppositeTheme} monochrome + theme={theme} > Show {showMore ? "less" : "full "} code = ({ title, branch, }) => { - const { oppositeTheme } = useTheme(); + const { theme } = useTheme(); const viewportWidth = useViewportWidth(); const isLargeViewport: boolean = viewportWidth > 992; @@ -40,7 +40,7 @@ const StackblitzButtonTestApp: FC = ({ aria-label="Open code example in StackBlitz" size={isLargeViewport ? "small" : "medium"} variant={isLargeViewport ? "tertiary" : "icon"} - theme={oppositeTheme} + theme={theme} monochrome onClick={() => createStackblitzProject()} > diff --git a/src/content/structured/patterns/components/StackblitzButton/index.tsx b/src/content/structured/patterns/components/StackblitzButton/index.tsx index 56092fa7f..36e2c081d 100644 --- a/src/content/structured/patterns/components/StackblitzButton/index.tsx +++ b/src/content/structured/patterns/components/StackblitzButton/index.tsx @@ -27,7 +27,7 @@ const StackblitzButton: FC = ({ projectDescription, isJSX = true, }) => { - const { oppositeTheme } = useTheme(); + const { theme } = useTheme(); const viewportWidth = useViewportWidth(); const isLargeViewport: boolean = viewportWidth > 992; @@ -95,7 +95,7 @@ const StackblitzButton: FC = ({ aria-label="Open code example in StackBlitz" size={isLargeViewport ? "small" : "medium"} variant={isLargeViewport ? "tertiary" : "icon"} - theme={oppositeTheme} + theme={theme} monochrome onClick={() => createStackblitzProject()} >