-
Notifications
You must be signed in to change notification settings - Fork 0
Side panel #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Side panel #32
Changes from all commits
8ac9301
21630b0
547a9c5
32e6029
a449d9d
478b71a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,44 @@ | ||||||||||||||||||
| import { useEffect, useState } from "react"; | ||||||||||||||||||
| import PropTypes from "prop-types"; | ||||||||||||||||||
| import { previewOutput } from "./prepareOutput.js"; | ||||||||||||||||||
| import { CCFormCard, CCFormSidebar } from "./ThemedComponents.jsx"; | ||||||||||||||||||
| import { Typography } from "@mui/material"; | ||||||||||||||||||
|
|
||||||||||||||||||
| const Sidebar = ({ formData, path, handleOutput }) => { | ||||||||||||||||||
| const [outputData, setOutputData] = useState(null); | ||||||||||||||||||
|
|
||||||||||||||||||
| useEffect(() => { | ||||||||||||||||||
| if (formData) { | ||||||||||||||||||
| // todo: should we show output if there is no function to process it? | ||||||||||||||||||
| if (handleOutput && typeof handleOutput === "function") { | ||||||||||||||||||
| setOutputData(handleOutput(previewOutput(formData, path))); | ||||||||||||||||||
| } | ||||||||||||||||||
|
Comment on lines
+14
to
+15
|
||||||||||||||||||
| setOutputData(handleOutput(previewOutput(formData, path))); | |
| } | |
| setOutputData(handleOutput(previewOutput(formData, path))); | |
| } else { | |
| setOutputData(null); | |
| } | |
| } else { | |
| setOutputData(null); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -349,13 +349,7 @@ export const CCFormSlider = styled(Slider, { | |
| export const CCFormSidebarInner = styled(Box, { | ||
| name: "MuiCreateCollectionForm", | ||
| slot: "sidebarStickyInner", | ||
| })(({ theme }) => ({ | ||
| position: "sticky", | ||
| top: "2rem", | ||
| [theme.breakpoints.down("md")]: { | ||
| position: "static", | ||
| }, | ||
| })); | ||
| })(); | ||
|
Comment on lines
349
to
+352
|
||
|
|
||
| export const CCFormSidebar = styled( | ||
| (props) => ( | ||
|
|
@@ -368,23 +362,23 @@ export const CCFormSidebar = styled( | |
| slot: "sidebar", | ||
| }, | ||
| )(({ theme }) => ({ | ||
| position: "sticky", | ||
| top: "2rem", | ||
| alignSelf: "flex-start", | ||
| borderRadius: 0, | ||
| position: "absolute", | ||
| bottom: 0, | ||
| right: 0, | ||
| top: 0, | ||
| width: "clamp(12.5rem, 25vw, 18.75rem)", | ||
| minWidth: "12.5rem", | ||
| padding: "2rem 1.5rem", | ||
| padding: "3rem 0 2rem", | ||
| flexShrink: 0, | ||
| background: theme.palette.background.default, | ||
| color: theme.palette.text.primary, | ||
| zIndex: 2, | ||
| maxHeight: "calc(100vh - 4rem)", | ||
| overflowY: "auto", | ||
| [theme.breakpoints.down("md")]: { | ||
| position: "fixed", | ||
| width: "100vw", | ||
| top: "auto", | ||
| padding: "1.5rem 1.5rem 2rem", | ||
| boxShadow: "0 0 10px 0 rgba(0,0,0,0.2)", | ||
| maxHeight: "none", | ||
| }, | ||
| })); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The empty fragment
<></>is unnecessary. Consider usingnullinstead for cleaner code when nothing needs to be rendered.