@@ -7,7 +7,11 @@
|
|||||||
.main-layout
|
.main-layout
|
||||||
display flex
|
display flex
|
||||||
height calc(100vh - 70px)
|
height calc(100vh - 70px)
|
||||||
|
|
||||||
|
.main-layout.isInIframe
|
||||||
|
margin-top 8px
|
||||||
|
height calc(100vh - 8px)
|
||||||
|
|
||||||
.main-layout.calendar-layout
|
.main-layout.calendar-layout
|
||||||
background-color #fff
|
background-color #fff
|
||||||
flex-direction row
|
flex-direction row
|
||||||
@@ -17,6 +21,16 @@
|
|||||||
height 100%
|
height 100%
|
||||||
overflow hidden
|
overflow hidden
|
||||||
|
|
||||||
|
.main-layout.isInIframe .calendar
|
||||||
|
display flex
|
||||||
|
flex-direction column
|
||||||
|
height 100%
|
||||||
|
overflow hidden
|
||||||
|
|
||||||
|
.main-layout.isInIframe .fc
|
||||||
|
flex 1
|
||||||
|
min-height 0
|
||||||
|
|
||||||
.calendarListHeader
|
.calendarListHeader
|
||||||
padding-top 10px
|
padding-top 10px
|
||||||
display flex
|
display flex
|
||||||
|
|||||||
@@ -599,7 +599,9 @@ export default function CalendarApp({
|
|||||||
const { t, lang } = useI18n();
|
const { t, lang } = useI18n();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="main-layout calendar-layout">
|
<main
|
||||||
|
className={`main-layout calendar-layout ${menubarProps?.isIframe ? " isInIframe" : ""}`}
|
||||||
|
>
|
||||||
<Box
|
<Box
|
||||||
className="sidebar"
|
className="sidebar"
|
||||||
sx={{
|
sx={{
|
||||||
@@ -616,7 +618,7 @@ export default function CalendarApp({
|
|||||||
top: 0,
|
top: 0,
|
||||||
zIndex: 10,
|
zIndex: 10,
|
||||||
backgroundColor: "#fff",
|
backgroundColor: "#fff",
|
||||||
paddingTop: 3,
|
paddingTop: menubarProps?.isIframe ? "10px" : 3,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export default function CalendarLayout() {
|
|||||||
menubarProps={menubarProps}
|
menubarProps={menubarProps}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{view === "settings" && <SettingsPage />}
|
{view === "settings" && <SettingsPage isInIframe={isInIframe} />}
|
||||||
<ErrorSnackbar error={error} type="calendar" />
|
<ErrorSnackbar error={error} type="calendar" />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ import {
|
|||||||
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
||||||
import CloseIcon from "@mui/icons-material/Close";
|
import CloseIcon from "@mui/icons-material/Close";
|
||||||
import OpenInFullIcon from "@mui/icons-material/OpenInFull";
|
import OpenInFullIcon from "@mui/icons-material/OpenInFull";
|
||||||
import React, { ReactNode } from "react";
|
import CozyBridge from "cozy-external-bridge";
|
||||||
|
import React, { ReactNode, useMemo } from "react";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ResponsiveDialog - A reusable dialog component that can switch between normal and expanded modes
|
* ResponsiveDialog - A reusable dialog component that can switch between normal and expanded modes
|
||||||
@@ -114,6 +115,7 @@ function ResponsiveDialog({
|
|||||||
sx,
|
sx,
|
||||||
...otherDialogProps
|
...otherDialogProps
|
||||||
}: ResponsiveDialogProps) {
|
}: ResponsiveDialogProps) {
|
||||||
|
const isInIframe = useMemo(() => new CozyBridge().isInIframe(), []);
|
||||||
const baseSx: SxProps<Theme> = {
|
const baseSx: SxProps<Theme> = {
|
||||||
"& .MuiBackdrop-root": {
|
"& .MuiBackdrop-root": {
|
||||||
backgroundColor: "rgba(0, 0, 0, 0.1)",
|
backgroundColor: "rgba(0, 0, 0, 0.1)",
|
||||||
@@ -124,8 +126,11 @@ function ResponsiveDialog({
|
|||||||
"& .MuiDialog-paper": {
|
"& .MuiDialog-paper": {
|
||||||
maxWidth: isExpanded ? "100%" : normalMaxWidth,
|
maxWidth: isExpanded ? "100%" : normalMaxWidth,
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: isExpanded ? `calc(100vh - ${headerHeight})` : undefined,
|
height: isExpanded
|
||||||
margin: isExpanded ? `${headerHeight} 0 0 0` : "32px",
|
? `calc(100vh - ${isInIframe ? "0px" : headerHeight})`
|
||||||
|
: undefined,
|
||||||
|
maxHeight: isExpanded && isInIframe ? "100%" : undefined,
|
||||||
|
margin: isExpanded ? `${isInIframe ? 0 : headerHeight} 0 0 0` : "32px",
|
||||||
boxShadow: isExpanded ? "none !important" : undefined,
|
boxShadow: isExpanded ? "none !important" : undefined,
|
||||||
transition: isExpanded ? "none !important" : undefined,
|
transition: isExpanded ? "none !important" : undefined,
|
||||||
zIndex: isExpanded ? 1200 : 1300,
|
zIndex: isExpanded ? 1200 : 1300,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
align-items center
|
align-items center
|
||||||
padding 0.5rem
|
padding 0.5rem
|
||||||
width 100%
|
width 100%
|
||||||
z-index 1300
|
z-index 1100
|
||||||
height 60px
|
height 60px
|
||||||
background-color #fff
|
background-color #fff
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
height calc(100vh - 70px)
|
height calc(100vh - 70px)
|
||||||
padding 0 10px 10px 0;
|
padding 0 10px 10px 0;
|
||||||
|
|
||||||
|
.main-layout.settings-layout.isInIframe
|
||||||
|
height 100vh
|
||||||
|
|
||||||
.settings-sidebar
|
.settings-sidebar
|
||||||
width 350px
|
width 350px
|
||||||
height 100%
|
height 100%
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import {
|
|||||||
type SidebarNavItem = "settings" | "sync";
|
type SidebarNavItem = "settings" | "sync";
|
||||||
type SettingsSubTab = "settings" | "notifications";
|
type SettingsSubTab = "settings" | "notifications";
|
||||||
|
|
||||||
export default function SettingsPage() {
|
export default function SettingsPage({ isInIframe }: { isInIframe?: boolean }) {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const previousConfig = useAppSelector((state) => state.user.coreConfig);
|
const previousConfig = useAppSelector((state) => state.user.coreConfig);
|
||||||
@@ -246,7 +246,9 @@ export default function SettingsPage() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="main-layout settings-layout">
|
<main
|
||||||
|
className={`main-layout settings-layout${isInIframe ? " isInIframe" : ""}`}
|
||||||
|
>
|
||||||
<Box className="settings-sidebar">
|
<Box className="settings-sidebar">
|
||||||
<List>
|
<List>
|
||||||
<ListItem
|
<ListItem
|
||||||
|
|||||||
Reference in New Issue
Block a user