diff --git a/code/src/ui/src/pages/content/organisms/OrganismContent.tsx b/code/src/ui/src/pages/content/organisms/OrganismContent.tsx index 868cb476..7e100f79 100644 --- a/code/src/ui/src/pages/content/organisms/OrganismContent.tsx +++ b/code/src/ui/src/pages/content/organisms/OrganismContent.tsx @@ -11,6 +11,7 @@ import { List, ListItemButton, ListItemText, ListSubheader, styled, Collapse, Bu import { LeftNavHeader, LeftNavItem } from '../../../components/LeftNavTabs'; import ExpandLess from '@mui/icons-material/ExpandLess'; import ExpandMore from '@mui/icons-material/ExpandMore'; +import { NavSwitch } from '../../../components/NavSwitch'; import { TextLayouts } from '../../organisms/TextLayouts'; import { TextIconLayouts } from '../../organisms/TextIconLayouts'; import { DecorativeTextLayouts } from '../../organisms/DecorativeTextLayouts'; @@ -157,6 +158,11 @@ export const OrganismContent: React.FC = ({ user, designSystem }) => { console.log(`${name} - showTemplate=${showTemplate}`) }, [showTemplate]) + const [darkMode, setDarkMode] = useState(pref.get("organisms-mode-selected") == "true" || false); + useEffect(() => { + pref.set("organisms-mode-selected", ""+darkMode); + }, [darkMode]); + interface LeftNavorganismsProps { item: any, indent?:number, disabled?:boolean }; const LeftNavorganisms : React.FC = ({item, indent, disabled}) => { return ( @@ -182,6 +188,10 @@ export const OrganismContent: React.FC = ({ user, designSystem }) => { > Introduction {setShowTemplate("organisms")}}/> + +
+ setDarkMode(!darkMode)}/> +
Template Settings setDisplayText(!displayText)}> @@ -324,7 +334,7 @@ export const OrganismContent: React.FC = ({ user, designSystem }) => { -
+
{showTemplate === "organisms" && diff --git a/code/src/ui/src/pages/content/preview/PreviewContent.tsx b/code/src/ui/src/pages/content/preview/PreviewContent.tsx index b4581b5d..48d62ac6 100644 --- a/code/src/ui/src/pages/content/preview/PreviewContent.tsx +++ b/code/src/ui/src/pages/content/preview/PreviewContent.tsx @@ -45,6 +45,11 @@ export const PreviewContent: React.FC = ({ user, designSystem }) => { pref.set("preview-mobilePreview-selected", ""+displayMobilePreview) }, [displayMobilePreview]) + const [darkMode, setDarkMode] = useState(pref.get("preview-mode-selected") == "true" || false); + useEffect(() => { + pref.set("preview-mode-selected", ""+darkMode); + }, [darkMode]); + const divStyle = { paddingLeft: "30px" } @@ -59,13 +64,13 @@ export const PreviewContent: React.FC = ({ user, designSystem }) => {
- + setDarkMode(!darkMode)} />
-
+