diff --git a/src/components/demo-components/filemosaic-demo/CodeJSFileMosaicDarkMode.tsx b/src/components/demo-components/filemosaic-demo/CodeJSFileMosaicDarkMode.tsx index d9e90d71aaf4962667f5e0e267f2c436ce54c45d..37ea3ae9d25297a274c1dc198e492199d696080f 100644 --- a/src/components/demo-components/filemosaic-demo/CodeJSFileMosaicDarkMode.tsx +++ b/src/components/demo-components/filemosaic-demo/CodeJSFileMosaicDarkMode.tsx @@ -39,14 +39,14 @@ const Demo${card?"FileCard":"FileMosaic"}DarkMode = () => { console.log("delete button clicked on file: " + id); }; return ( - <> + <div style={{ display: "flex", flexWrap: "wrap" }}> <div style={{ display: "flex", justifyContent: "center", - width: "50%", backgroundColor: "white", - padding: "10px 0", + padding: "25px 0", + flexGrow:1 }} > <${card?"FileCard":"FileMosaic"} {...sampleFileProps} info onDelete={removeFile} /> @@ -55,18 +55,17 @@ const Demo${card?"FileCard":"FileMosaic"}DarkMode = () => { style={{ display: "flex", justifyContent: "center", - width: "50%", - backgroundColor: "#121212", - padding: "10px 0", + backgroundColor: "white", + padding: "25px 0", + flexGrow:1 }} > <${card?"FileCard":"FileMosaic"} {...sampleFileProps} info darkMode onDelete={removeFile} /> </div> - </> + </div> ); }; -export default Demo${card?"FileCard":"FileMosaic"}DarkMode; -`; +export default Demo${card?"FileCard":"FileMosaic"}DarkMode;`; const completeCodeTS = (card?: boolean) => `import * as React from "react"; import { ExtFile, ${card?"FileCard":"FileMosaic"} } from "@files-ui/react"; @@ -82,14 +81,14 @@ const Demo${card?"FileCard":"FileMosaic"}DarkMode = () => { console.log("delete button clicked on file: " + id); }; return ( - <> + <div style={{ display: "flex", flexWrap: "wrap" }}> <div style={{ display: "flex", justifyContent: "center", - width: "50%", backgroundColor: "white", - padding: "10px 0", + padding: "25px 0", + flexGrow:1 }} > <${card?"FileCard":"FileMosaic"} {...sampleFileProps} info onDelete={removeFile} /> @@ -98,15 +97,14 @@ const Demo${card?"FileCard":"FileMosaic"}DarkMode = () => { style={{ display: "flex", justifyContent: "center", - width: "50%", - backgroundColor: "#121212", - padding: "10px 0", + backgroundColor: "white", + padding: "25px 0", + flexGrow:1 }} > <${card?"FileCard":"FileMosaic"} {...sampleFileProps} info darkMode onDelete={removeFile} /> </div> - </> + </div> ); }; -export default Demo${card?"FileCard":"FileMosaic"}DarkMode; -`; +export default Demo${card?"FileCard":"FileMosaic"}DarkMode;`; diff --git a/src/components/demo-components/filemosaic-demo/DemoFileMosaicDarkMode.tsx b/src/components/demo-components/filemosaic-demo/DemoFileMosaicDarkMode.tsx index e1cbbecc3b806680ba356d02d32d69448c271132..cd00c210de763ee0951df8b37b479176046994af 100644 --- a/src/components/demo-components/filemosaic-demo/DemoFileMosaicDarkMode.tsx +++ b/src/components/demo-components/filemosaic-demo/DemoFileMosaicDarkMode.tsx @@ -19,9 +19,8 @@ const DemoFileMosaicDarkMode = (props: { card?: boolean }) => { style={{ display: "flex", justifyContent: "center", - minWidth: "50%", backgroundColor: "white", - padding: "15px 0", + padding: "25px 0", flexGrow:1 }} > @@ -31,9 +30,8 @@ const DemoFileMosaicDarkMode = (props: { card?: boolean }) => { style={{ display: "flex", justifyContent: "center", - minWidth: "50%", backgroundColor: "#121212", - padding: "15px 0", + padding: "25px 0", flexGrow: 1, }} > diff --git a/src/components/demo-components/filemosaic-demo/DemoFileMosaicUpload.scss b/src/components/demo-components/filemosaic-demo/DemoFileMosaicUpload.scss new file mode 100644 index 0000000000000000000000000000000000000000..a90ac865c623c3bae5d76277dff42be8d8bd97b0 --- /dev/null +++ b/src/components/demo-components/filemosaic-demo/DemoFileMosaicUpload.scss @@ -0,0 +1,20 @@ +/* .flex-container-group-group { + display: flex; + flex-direction: row; + gap: 10px; +} */ +.flex-container-group-card { + display: flex; + flex-direction: column; + flex-wrap: wrap; + gap: 10px; +} +.flex-container-group-mosaic { + display: flex; + flex-direction: row; + flex-wrap: wrap; + gap: 10px; + align-items: center; + justify-content: center; + } + diff --git a/src/components/demo-components/filemosaic-demo/DemoFileMosaicUploadStatus.tsx b/src/components/demo-components/filemosaic-demo/DemoFileMosaicUploadStatus.tsx index 2a3dcc011125df0ab708885050147b096e163b23..8668e4f2ba3e3cf276a567419e6bb00478012ad9 100644 --- a/src/components/demo-components/filemosaic-demo/DemoFileMosaicUploadStatus.tsx +++ b/src/components/demo-components/filemosaic-demo/DemoFileMosaicUploadStatus.tsx @@ -7,8 +7,8 @@ import { FileCard, } from "../../../files-ui"; import TypeHighlight from "../../typeHighlight/TypeHighlight"; -import DemoContainerFileMosaic from "./DemoContainerFileMosaic"; +import "./DemoFileMosaicUpload.scss"; const DemoFileMosaicUploadStatus = (props: { card?: boolean }) => { const progress = useFakeProgress(); @@ -95,14 +95,20 @@ export default DemoFileMosaicUploadStatus; const FlexRowContainer = (props: { children: React.ReactNode; card?: boolean; - title?:string + title?: string; }) => { + const { children, card, title } = props; return ( <React.Fragment> - <TypeHighlight>{props.title}</TypeHighlight> - <DemoContainerFileMosaic card={props.card}> - {props.children} - </DemoContainerFileMosaic> + {!card && <h4 style={{ margin: 0 }}>{title}</h4>} + <div + className={ + card ? "flex-container-group-card" : "flex-container-group-mosaic" + } + > + {card && <h4 style={{ margin: 0 }}>{title}</h4>} + {children} + </div> </React.Fragment> ); }; diff --git a/src/pages/demo/FileCardDemoPage.jsx b/src/pages/demo/FileCardDemoPage.jsx index 641e39cc36c11f881b7a776c99ece648bb885dd7..f1851fe50a7a31a7faa1e9ebb327033a287dd5fa 100644 --- a/src/pages/demo/FileCardDemoPage.jsx +++ b/src/pages/demo/FileCardDemoPage.jsx @@ -217,19 +217,9 @@ const FileCardDemoPage = (props) => { <TypeHighlight>true</TypeHighlight>. </DescParagraph> - <Paper - variant="outlined" - style={{ - padding: "25px", - display: "flex", - alignItems: "center", - justifyContent: "center", - flexDirection: "column", - gap: "20px", - }} - > + <div style={{ display: "flex", flexWrap: "wrap" }}> <DemoFileMosaicDarkMode card /> - </Paper> + </div> <CodeJSFileMosaicDarkMode card /> </section>