diff --git a/multiplayer/public/index.html b/multiplayer/public/index.html index 077c11f1b4e3..91a6a607408f 100644 --- a/multiplayer/public/index.html +++ b/multiplayer/public/index.html @@ -13,7 +13,7 @@ -
+ @@ -23,6 +23,7 @@ + diff --git a/multiplayer/src/App.css b/multiplayer/src/App.css index 95e109efb09d..e8449320d63e 100644 --- a/multiplayer/src/App.css +++ b/multiplayer/src/App.css @@ -2,10 +2,6 @@ --black: #000; --white: #fff; - --primary-color: #E77038; - --secondary-color: #ffeb9a; - --tertiary-color: #E77038; - --header-height: 4rem; --header-padding-top: 1rem; @@ -29,19 +25,19 @@ code { font-family: var(--body-font-family); } .common-button.primary { - background: var(--primary-color); - color: #fff; - border: 1px solid var(--primary-color); + background: var(--pxt-primary-background); + color: var(--pxt-primary-foreground); + border: 1px solid var(--pxt-primary-background); } .common-button.secondary { - background: var(--secondary-color); - color: #fff; - border: 1px solid var(--secondary-color); + background: var(--pxt-secondary-background); + color: var(--pxt-secondary-foreground); + border: 1px solid var(--pxt-secondary-background); } .common-button.tertiary { - background: var(--tertiary-color); - color: #fff; - border: 1px solid var(--tertiary-color); + background: var(--pxt-tertiary-background); + color: var(--pxt-tertiary-foreground); + border: 1px solid var(--pxt-tertiary-background); } img.pixel-art-image { diff --git a/multiplayer/src/App.tsx b/multiplayer/src/App.tsx index 840f26e4ae7d..e77c7fa00e7d 100644 --- a/multiplayer/src/App.tsx +++ b/multiplayer/src/App.tsx @@ -12,6 +12,7 @@ import { setDeepLinks, setTargetConfig } from "./state/actions"; import { cleanupJoinCode, cleanupShareCode } from "./util"; import { joinGameAsync, hostGameAsync, visibilityChanged } from "./epics"; import { useVisibilityChange } from "./hooks"; +import { ThemeManager } from "react-common/components/theming/themeManager"; // eslint-disable-next-line import/no-unassigned-import import "./App.css"; @@ -44,6 +45,17 @@ function App() { .catch(() => setAuthCheckComplete(true)); }, [setAuthCheckComplete]); + useEffect(() => { + // We don't currently support switching themes in multiplayer, so just load the default. + const themeId = pxt.appTarget?.appTheme?.defaultColorTheme; + if (themeId) { + const themeManager = ThemeManager.getInstance(document); + if (themeId !== themeManager.getCurrentColorTheme()?.id) { + themeManager.switchColorTheme(themeId); + } + } + }); + const parseUrlParams = useCallback(() => { let params: URLSearchParams | undefined = undefined; if (window.location.hash[1] === "?") { diff --git a/multiplayer/src/components/Presence.tsx b/multiplayer/src/components/Presence.tsx index 77d55cb18eb1..1844fcbd90f0 100644 --- a/multiplayer/src/components/Presence.tsx +++ b/multiplayer/src/components/Presence.tsx @@ -141,7 +141,7 @@ function PlayerMenu(