Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"preview": "vite preview"
},
"dependencies": {
"@diamondlightsource/cs-web-lib": "^0.10.21",
"@diamondlightsource/cs-web-lib": "^0.10.22",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mui/icons-material": "^7.3.11",
Expand Down
144 changes: 0 additions & 144 deletions src/components/QuickScreenSettings.tsx

This file was deleted.

53 changes: 0 additions & 53 deletions src/components/QuickScreens.tsx

This file was deleted.

66 changes: 66 additions & 0 deletions src/components/QuickScreens/Display.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { Box, Paper as MuiPaper, styled, Typography } from "@mui/material";
import {
DynamicPageWidget,
newRelativePosition
} from "@diamondlightsource/cs-web-lib";
import {
useWindowWidth,
APP_BAR_HEIGHT,
useWindowHeight
} from "../../utils/helper";
import { createContext, useState } from "react";
import QuickScreenSettings from "./Settings";
import { useLocation } from "react-router";

// Local quick screen storage handler
export const StorageContext = createContext<{
bobDisplayUuid?: string;
setBobDisplayUuid: any;
}>({ bobDisplayUuid: "", setBobDisplayUuid: () => null });

const Paper = styled(MuiPaper)(({ theme }) => ({
height: `calc(${useWindowHeight()}px - ${APP_BAR_HEIGHT}px - 50px)`,
margin: `calc(${APP_BAR_HEIGHT}px + 15px) 5px 5px 5px`,
width: `calc(${useWindowWidth()}px - 10px - ${theme.spacing(7)} - 8px)`
}));

export default function QuickScreenDisplay() {
const [bobDisplayUuid, setBobDisplayUuid] = useState<string>();
const location = useLocation();
const quickScreen = location.state?.pageState?.quickScreen;

return (
<Paper elevation={12}>
<Box sx={{ display: "flex", height: "100%" }}>
<StorageContext.Provider value={{ bobDisplayUuid, setBobDisplayUuid }}>
<QuickScreenSettings />
{quickScreen ? (
<DynamicPageWidget
location={"quickScreen"}
position={newRelativePosition(
undefined,
undefined,
"100%",
"100%"
)}
scroll={false}
showCloseButton={false}
widgetIdsCallback={uuid => {
// The uuid allows the json representation of the display instance to be selected from the redux store
setBobDisplayUuid(uuid);
}}
targetDisplayType="displayGridLayout"
/>
) : (
<Typography
align="center"
sx={{ marginTop: "20%", width: "100%", height: "100%" }}
>
No Quick Screen Loaded
</Typography>
)}
</StorageContext.Provider>
</Box>
</Paper>
);
}
Loading
Loading