Skip to content

Commit

Permalink
fix(root): swap theme colour for code preview buttons
Browse files Browse the repository at this point in the history
Swap theme colour for code preview buttons
  • Loading branch information
GCHQ-Developer-530 committed Dec 10, 2024
1 parent 4f9aca9 commit c58014a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/components/CodePreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const ActionButtons: React.FC<CodeSnippetProps> = ({
selectedLanguage,
isLargeViewport,
}) => {
const { oppositeTheme } = useTheme();
const { theme } = useTheme();
return (
<div className="button-container">
{showStackblitzBtn && projectTitle !== undefined && (
Expand All @@ -78,7 +78,7 @@ const ActionButtons: React.FC<CodeSnippetProps> = ({
aria-label={isLargeViewport ? "" : "Copy code"}
variant={isLargeViewport ? "tertiary" : "icon"}
size={isLargeViewport ? "small" : "medium"}
theme={oppositeTheme}
theme={theme}
monochrome
onClick={() => {
navigator.clipboard.writeText(code);
Expand Down Expand Up @@ -107,15 +107,15 @@ const ToggleShowButton: React.FC<ToggleShowProps> = ({
showMore,
setShowMore,
}) => {
const { oppositeTheme } = useTheme();
const { theme } = useTheme();
return (
<div className="button-container">
{type === "pattern" && (
<IcButton
variant="tertiary"
size="small"
onClick={() => setShow(!show)}
theme={oppositeTheme}
theme={theme}
monochrome
>
{!show ? "Show" : "Hide"} code
Expand All @@ -133,8 +133,8 @@ const ToggleShowButton: React.FC<ToggleShowProps> = ({
variant="tertiary"
size="small"
onClick={() => setShowMore(!showMore)}
theme={oppositeTheme}
monochrome
theme={theme}
>
Show {showMore ? "less" : "full "} code
<SlottedSVG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const StackblitzButtonTestApp: FC<StackblitzButtonTestAppProps> = ({
title,
branch,
}) => {
const { oppositeTheme } = useTheme();
const { theme } = useTheme();
const viewportWidth = useViewportWidth();
const isLargeViewport: boolean = viewportWidth > 992;

Expand All @@ -40,7 +40,7 @@ const StackblitzButtonTestApp: FC<StackblitzButtonTestAppProps> = ({
aria-label="Open code example in StackBlitz"
size={isLargeViewport ? "small" : "medium"}
variant={isLargeViewport ? "tertiary" : "icon"}
theme={oppositeTheme}
theme={theme}
monochrome
onClick={() => createStackblitzProject()}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const StackblitzButton: FC<StackblitzProps> = ({
projectDescription,
isJSX = true,
}) => {
const { oppositeTheme } = useTheme();
const { theme } = useTheme();
const viewportWidth = useViewportWidth();
const isLargeViewport: boolean = viewportWidth > 992;

Expand Down Expand Up @@ -95,7 +95,7 @@ const StackblitzButton: FC<StackblitzProps> = ({
aria-label="Open code example in StackBlitz"
size={isLargeViewport ? "small" : "medium"}
variant={isLargeViewport ? "tertiary" : "icon"}
theme={oppositeTheme}
theme={theme}
monochrome
onClick={() => createStackblitzProject()}
>
Expand Down

0 comments on commit c58014a

Please sign in to comment.