Skip to content

Commit f87f969

Browse files
authored
Merge pull request #30 from ClaPalo/Switch-theme-button
Added button to switch theme
2 parents 2740aee + 12fbeec commit f87f969

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/components/EditorHeader/ControlPanel.jsx

+18
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,24 @@ export default function ControlPanel({
13131313
<i className="fa-regular fa-calendar-check" />
13141314
</button>
13151315
</Tooltip>
1316+
<Divider layout="vertical" margin="8px" />
1317+
<Tooltip content="Change theme" position="bottom">
1318+
<button
1319+
className="py-1 px-2 hover-2 rounded text-xl -mt-0.5"
1320+
onClick={() => {
1321+
const body = document.body;
1322+
if (body.hasAttribute("theme-mode")) {
1323+
if (body.getAttribute("theme-mode") === "light") {
1324+
menu["View"]["Theme"].children[1]["Dark"]();
1325+
} else {
1326+
menu["View"]["Theme"].children[0]["Light"]();
1327+
}
1328+
}
1329+
}}
1330+
>
1331+
<i className="fa-solid fa-circle-half-stroke" />
1332+
</button>
1333+
</Tooltip>
13161334
</div>
13171335
<button
13181336
onClick={() => invertLayout("header")}

0 commit comments

Comments
 (0)