-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improved examples with MUI and etc (#55)
- Loading branch information
Showing
15 changed files
with
620 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import React from 'react'; | ||
import vueImg from "./assets/vue.svg"; | ||
|
||
export default function () { | ||
return ( | ||
<div style={{ background: 'yellow', padding: 30 }}> | ||
Vite react App1 as default export via remote | ||
<img src={vueImg} /> | ||
Vite React App1 as default export via remote in | ||
<i>{import.meta.env.DEV ? ' Dev ' : ' prod '}</i> mode | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import ReactDOM from 'react-dom/client'; | ||
import "./app2.sass"; | ||
|
||
console.log("App2 shared React", React, ReactDOM) | ||
export function App2() { | ||
return ( | ||
<div class="container"> | ||
Vite react App2 as named export via remote with Sass use | ||
<div className="container"> | ||
Vite react (v. {React.version})App2 as named export via remote with Sass use | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.container { | ||
padding: 20px; | ||
border: 2px; | ||
border-style: solid; | ||
border-color: cadetblue; | ||
} | ||
|
||
.myButton { | ||
color: black; | ||
background-color: blueviolet; | ||
font-size: 10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import { css } from '@emotion/react'; | ||
import { createTheme, Paper, StyledEngineProvider, ThemeProvider, Typography } from '@mui/material'; | ||
import Button from '@mui/material/Button'; | ||
import React from 'react'; | ||
import styles from './Mui5Widget.module.css'; | ||
|
||
const FooterClasses = { | ||
root: { | ||
padding: '10px', | ||
}, | ||
}; | ||
|
||
// Emotion | ||
const emotionClass = css` | ||
background-color: orange; | ||
color: red; | ||
border: 1px solid black; | ||
font-size: 20px; | ||
margin: 10px; | ||
`; | ||
|
||
// Create Theme | ||
const theme = createTheme({ | ||
palette: { | ||
background: { | ||
paper: '#FF0000', | ||
}, | ||
text: { | ||
primary: '#173A5E', | ||
secondary: '#46505A', | ||
}, | ||
action: { | ||
active: '#001E3C', | ||
}, | ||
}, | ||
components: { | ||
// Name of the component | ||
MuiButtonBase: { | ||
defaultProps: { | ||
// The props to change the default for. | ||
disableRipple: true, // No more ripple, on the whole application 💣! | ||
}, | ||
}, | ||
MuiButton: { | ||
styleOverrides: { | ||
// Name of the slot | ||
root: { | ||
// Some CSS | ||
fontSize: '1rem', | ||
fontFamily: 'Arial', | ||
margin: 10, | ||
border: '2px solid yellow', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
export const MuiDemo = ({ }) => { | ||
return ( | ||
<StyledEngineProvider injectFirst> | ||
<div className={styles.container}> | ||
<div> | ||
<Button variant="contained">Button OutSide Theme</Button> | ||
</div> | ||
<div> | ||
<ThemeProvider theme={theme}> | ||
<Button variant="contained">Button Theme Styled </Button> | ||
</ThemeProvider> | ||
</div> | ||
<div> | ||
<ThemeProvider theme={theme}> | ||
<Button variant="contained" sx={{ bgcolor: 'background.paper' }}> | ||
Button Theme Styled overriden | ||
</Button> | ||
</ThemeProvider> | ||
</div> | ||
<div> | ||
<Button variant="contained" css={emotionClass}> | ||
Button Emotion Styled | ||
</Button> | ||
</div> | ||
|
||
<div> | ||
<Button variant="contained" className={styles.myButton}> | ||
Button CSS Module Styled | ||
</Button> | ||
</div> | ||
|
||
<Paper component="footer" sx={FooterClasses.root} elevation={3} id="footer-paper-container"> | ||
<Typography variant="subtitle1">Text inside typography</Typography> | ||
</Paper> | ||
</div> | ||
</StyledEngineProvider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#grid1 .ag-header-cell { | ||
background-color: #b02e2e; | ||
} | ||
|
||
#grid1 .ag-row { | ||
font-weight: bold; | ||
} | ||
|
||
#grid2 .ag-header-cell { | ||
background-color: #26ea2c; | ||
} | ||
|
||
#grid2 .ag-row { | ||
font-weight: bold; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.