Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

fix: invert colors for mobile platform switch #1066

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/components/main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Platform,
PlatformSwitch,
defaultHostsMapper,
useMobileView,
usePlatformNavigation,
} from '@graasp/ui';

Expand Down Expand Up @@ -48,6 +49,7 @@ type Props = { children: JSX.Element | (JSX.Element & string) };
const Main = ({ children }: Props): JSX.Element => {
const { t } = useBuilderTranslation();
const theme = useTheme();
const { isMobile } = useMobileView();

const itemId = useParams()[ITEM_ID_PARAMS];

Expand Down Expand Up @@ -90,8 +92,12 @@ const Main = ({ children }: Props): JSX.Element => {
id={APP_NAVIGATION_PLATFORM_SWITCH_ID}
selected={Platform.Builder}
platformsProps={platformProps}
color={theme.palette.primary.main}
accentColor={theme.palette.secondary.main}
color={
isMobile ? theme.palette.primary.main : theme.palette.secondary.main
}
accentColor={
isMobile ? theme.palette.secondary.main : theme.palette.primary.main
}
/>
}
>
Expand Down