forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
102 additions
and
89 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
17 changes: 10 additions & 7 deletions
17
apps/pigment-css-vite-app/src/pages/fixtures/PigmentCSSMultilineButton.js
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,14 +1,17 @@ | ||
import * as React from 'react'; | ||
import Button from '@mui/material/Button'; | ||
import Layout from './layout'; | ||
|
||
export default function MultilineButton() { | ||
return ( | ||
<Button variant="contained" style={{ width: 400 }}> | ||
{[ | ||
'Contained buttons are rectangular-shaped buttons.', | ||
'They may be used inline.', | ||
'They lift and display ink reactions on press.', | ||
].join(' ')} | ||
</Button> | ||
<Layout> | ||
<Button variant="contained" style={{ width: 400 }}> | ||
{[ | ||
'Contained buttons are rectangular-shaped buttons.', | ||
'They may be used inline.', | ||
'They lift and display ink reactions on press.', | ||
].join(' ')} | ||
</Button> | ||
</Layout> | ||
); | ||
} |
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,50 +1,6 @@ | ||
import * as React from 'react'; | ||
import { useLocation, matchRoutes, Link } from 'react-router-dom'; | ||
import routes from '~react-pages'; | ||
import Layout from '../../Layout'; | ||
import Layout from './layout'; | ||
|
||
export default function FixturesIndex() { | ||
const location = useLocation(); | ||
const matchedRoute = React.useMemo( | ||
() => matchRoutes(routes, location.pathname)?.[0], | ||
[location.pathname], | ||
); | ||
const childRoutes = matchedRoute?.route.children ?? []; | ||
|
||
return ( | ||
<Layout> | ||
<div> | ||
<h1>Fixtures Material UI + PIgment CSS</h1> | ||
<nav id="tests"> | ||
<ul | ||
sx={{ | ||
margin: 0, | ||
marginBlock: '1rem', | ||
padding: 0, | ||
paddingLeft: '1.5rem', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: '0.5rem', | ||
}} | ||
> | ||
{childRoutes | ||
.filter((item) => !!item.path && item.path !== 'index.test') | ||
.map((item) => ( | ||
<li key={item.path}> | ||
<Link | ||
to={`/fixtures/${item.path}`} | ||
sx={{ | ||
textDecoration: 'underline', | ||
fontSize: '17px', | ||
}} | ||
> | ||
{item.path} | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
</nav> | ||
</div> | ||
</Layout> | ||
); | ||
export default function Index() { | ||
return <Layout />; | ||
} |
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,51 @@ | ||
import * as React from 'react'; | ||
import { useLocation, matchRoutes, Link } from 'react-router-dom'; | ||
import routes from '~react-pages'; | ||
import IndexLayout from '../../Layout'; | ||
|
||
export default function Layout(props: { children?: React.ReactNode }) { | ||
const location = useLocation(); | ||
const matchedRoute = React.useMemo( | ||
() => matchRoutes(routes, location.pathname)?.[0], | ||
[location.pathname], | ||
); | ||
const childRoutes = matchedRoute?.route.children ?? []; | ||
|
||
return ( | ||
<IndexLayout> | ||
{props.children && <div id="root-demo">{props.children}</div>} | ||
<div> | ||
<h1>Fixtures Material UI + PIgment CSS</h1> | ||
<nav id="tests"> | ||
<ul | ||
sx={{ | ||
margin: 0, | ||
marginBlock: '1rem', | ||
padding: 0, | ||
paddingLeft: '1.5rem', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: '0.5rem', | ||
}} | ||
> | ||
{childRoutes | ||
.filter((item) => !!item.path && item.path !== 'index.test' && item.path !== 'layout') | ||
.map((item) => ( | ||
<li key={item.path}> | ||
<Link | ||
to={`/fixtures/${item.path}`} | ||
sx={{ | ||
textDecoration: 'underline', | ||
fontSize: '17px', | ||
}} | ||
> | ||
{item.path} | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
</nav> | ||
</div> | ||
</IndexLayout> | ||
); | ||
} |