Skip to content
Snippets Groups Projects
Commit 87370ff1 authored by Jose Manuel Serrano Amaut's avatar Jose Manuel Serrano Amaut
Browse files

[FEAT]: [MVP]: Add FileMosaicDemo Page and refactor right menu

parent 6288d595
Branches
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ const DemoFileMosaicDarkMode = () => { ...@@ -19,7 +19,7 @@ const DemoFileMosaicDarkMode = () => {
justifyContent: "center", justifyContent: "center",
width: "50%", width: "50%",
backgroundColor: "white", backgroundColor: "white",
padding: "10px 0", padding: "15px 0",
}} }}
> >
<FileMosaic {...sampleFileProps} info onDelete={removeFile} /> <FileMosaic {...sampleFileProps} info onDelete={removeFile} />
...@@ -30,7 +30,7 @@ const DemoFileMosaicDarkMode = () => { ...@@ -30,7 +30,7 @@ const DemoFileMosaicDarkMode = () => {
justifyContent: "center", justifyContent: "center",
width: "50%", width: "50%",
backgroundColor: "#121212", backgroundColor: "#121212",
padding: "10px 0", padding: "15px 0",
}} }}
> >
<FileMosaic {...sampleFileProps} info darkMode onDelete={removeFile} /> <FileMosaic {...sampleFileProps} info darkMode onDelete={removeFile} />
......
...@@ -112,7 +112,11 @@ const ShowDemoCode: React.FC<ShowDemoCodeProps> = ( ...@@ -112,7 +112,11 @@ const ShowDemoCode: React.FC<ShowDemoCodeProps> = (
console.log("code copied to clipboard: "); console.log("code copied to clipboard: ");
console.log(code_); console.log(code_);
}} }}
style={{ margin: "20px 0" }} style={{
margin: "20px 0",
fontSize:"15px",
lineHeight:"",
}}
> >
{code} {code}
</Highlighter> </Highlighter>
......
...@@ -60,6 +60,9 @@ const FileMosaicDemoPage = (props) => { ...@@ -60,6 +60,9 @@ const FileMosaicDemoPage = (props) => {
</AnchorToTab> </AnchorToTab>
</TypeHighlight>{" "} </TypeHighlight>{" "}
object or from given props. object or from given props.
<br />
Also, the <TypeHighlight>onDelete</TypeHighlight> prop is used to
remove the file selection.
</DescParagraph> </DescParagraph>
<DemoContainerFileMosaic> <DemoContainerFileMosaic>
...@@ -96,10 +99,15 @@ const FileMosaicDemoPage = (props) => { ...@@ -96,10 +99,15 @@ const FileMosaicDemoPage = (props) => {
<DescParagraph> <DescParagraph>
By setting the <CodeHighlight>preview</CodeHighlight> prop to{" "} By setting the <CodeHighlight>preview</CodeHighlight> prop to{" "}
<TypeHighlight>true</TypeHighlight> the component will show an image <TypeHighlight>true</TypeHighlight> the component will show an image
preview instead of a file icon. To acomplish this task this preview instead of a file icon.
component will take the <CodeHighlight>imageUrl</CodeHighlight> <br />
To acomplish this task this component will take the{" "}
<CodeHighlight>imageUrl</CodeHighlight>
prop or will read the <TypeHighlight>File</TypeHighlight> object if prop or will read the <TypeHighlight>File</TypeHighlight> object if
given and if it is an image. given and if it is an image.
<br />
Finally, the <TypeHighlight>info</TypeHighlight> prop is used to
show the complete information of the file.
</DescParagraph> </DescParagraph>
<DemoContainerFileMosaic> <DemoContainerFileMosaic>
...@@ -213,7 +221,7 @@ const FileMosaicDemoPage = (props) => { ...@@ -213,7 +221,7 @@ const FileMosaicDemoPage = (props) => {
</ul> </ul>
</Alert> </Alert>
</section> </section>
<section id="dark mode"> <section id="dark-mode">
<SubTitle content="Dark mode" /> <SubTitle content="Dark mode" />
<DescParagraph> <DescParagraph>
The <CodeHighlight>FileMosaic</CodeHighlight> component supports The <CodeHighlight>FileMosaic</CodeHighlight> component supports
...@@ -225,7 +233,7 @@ const FileMosaicDemoPage = (props) => { ...@@ -225,7 +233,7 @@ const FileMosaicDemoPage = (props) => {
<Paper <Paper
variant="outlined" variant="outlined"
style={{ style={{
padding: "25px", //padding: "25px",
display: "flex", display: "flex",
alignItems: "center", alignItems: "center",
justifyContent: "center", justifyContent: "center",
...@@ -246,30 +254,20 @@ const FileMosaicDemoPage = (props) => { ...@@ -246,30 +254,20 @@ const FileMosaicDemoPage = (props) => {
<CodeHighlight>{"localization"}</CodeHighlight> prop. So far only <CodeHighlight>{"localization"}</CodeHighlight> prop. So far only
the following languages are supported: the following languages are supported:
<ul> <ul>
<li> {[
<TypeHighlight>English</TypeHighlight> "English",
</li> "Spanish",
<li> "French",
<TypeHighlight>Spanish</TypeHighlight> "Italian",
</li> "Portuguese",
<li> "Russian",
<TypeHighlight>French</TypeHighlight> "Chinnese (simplified)",
</li> "Chinnese (traditional)",
<li> ].map((x) => (
<TypeHighlight>Italian</TypeHighlight> <li>
</li> <TypeHighlight>{x}</TypeHighlight>
<li> </li>
<TypeHighlight>Portuguese</TypeHighlight> ))}
</li>
<li>
<TypeHighlight>Russian</TypeHighlight>
</li>
<li>
<TypeHighlight>Chinnese (simplified)</TypeHighlight>
</li>
<li>
<TypeHighlight>Chinnese (traditional)</TypeHighlight>
</li>
</ul> </ul>
</DescParagraph> </DescParagraph>
...@@ -286,23 +284,50 @@ const FileMosaicDemoPage = (props) => { ...@@ -286,23 +284,50 @@ const FileMosaicDemoPage = (props) => {
> >
<DemoFileMosaicLocalization /> <DemoFileMosaicLocalization />
</Paper> </Paper>
<CodeJSFileMosaicLocalization /> <CodeJSFileMosaicLocalization />
</section> </section>
<section id="file icon"> <section id="file-icon">
<SubTitle content="File Icons (extensive list)" /> <SubTitle content="File Icons (extensive list)" />
<DescParagraph> <DescParagraph>
The <CodeHighlight>FileMosaic</CodeHighlight> component supports The <CodeHighlight>FileMosaic</CodeHighlight> component supports
several file types to properly set a file icon. The complete list of file icons is the following: several file types to properly set a file icon. The complete list of
file icons is the following:
</DescParagraph> </DescParagraph>
<Paper
<DemoContainerFileMosaic variant="outlined"
style={{
padding: "25px 0",
display: "flex",
alignItems: "center",
justifyContent: "center",
//flexDirection: "column",
gap: "10px",
flexWrap: "wrap",
}}
> >
<DemoFileMosaicFileIcons /> <DemoFileMosaicFileIcons />
</DemoContainerFileMosaic> </Paper>
</section>
<section id="api">
<SubTitle content="API" />
<DescParagraph>
See the documentation below for a complete reference to all of the
props available to the components mentioned here.
</DescParagraph>
<ul>
<li>
<AnchorToTab href="/api/filemosaic">
{"<FileMosaic/>"}
</AnchorToTab>
</li>
<li>
<AnchorToTab href="/api/fileinputbuttom">
{"<FileInputButton/>"}
</AnchorToTab>
</li>
</ul>
</section> </section>
</MainContentContainer> </MainContentContainer>
<RightMenuContainer> <RightMenuContainer>
...@@ -333,29 +358,19 @@ const rightMenuItems = [ ...@@ -333,29 +358,19 @@ const rightMenuItems = [
label: "Uploading", label: "Uploading",
referTo: "/components/filemosaic#uploading", referTo: "/components/filemosaic#uploading",
}, },
{
id: 8,
label: "Dark mode",
referTo: "/components/filemosaic#dark-mode",
},
{ {
id: 4, id: 4,
label: "Localization", label: "Localization",
referTo: "/components/filemosaic#localization", referTo: "/components/filemosaic#localization",
}, },
{ {
id: 5, id: 9,
label: "Previews", label: "File Icons",
referTo: "/components/filemosaic#previews", referTo: "/components/filemosaic#file-icon",
},
{
id: 6,
label: "Actions",
referTo: "/components/filemosaic#actions",
},
{
id: 7,
label: "Default previews",
referTo: "/components/filemosaic#default-previews",
},
{
id: 8,
label: "Dark mode",
referTo: "/components/filemosaic#dark-mode",
}, },
]; ];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment