Skip to content

Commit

Permalink
[docs][joy-ui] Simplify the button's loading indicator demo (#39082)
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-leal authored Sep 21, 2023
1 parent 9a54ab9 commit f140184
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 61 deletions.
8 changes: 2 additions & 6 deletions docs/data/joy/components/button/ButtonIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ import Box from '@mui/joy/Box';
import Button from '@mui/joy/Button';
import Add from '@mui/icons-material/Add';
import KeyboardArrowRight from '@mui/icons-material/KeyboardArrowRight';
import ThumbUp from '@mui/icons-material/ThumbUp';

export default function ButtonIcons() {
return (
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
<Button startDecorator={<Add />}>Add to cart</Button>
<Button aria-label="Like" variant="outlined" color="neutral">
<ThumbUp />
</Button>
<Button variant="soft" endDecorator={<KeyboardArrowRight />} color="success">
Checkout
<Button endDecorator={<KeyboardArrowRight />} color="success">
Go to checkout
</Button>
</Box>
);
Expand Down
8 changes: 2 additions & 6 deletions docs/data/joy/components/button/ButtonIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ import Box from '@mui/joy/Box';
import Button from '@mui/joy/Button';
import Add from '@mui/icons-material/Add';
import KeyboardArrowRight from '@mui/icons-material/KeyboardArrowRight';
import ThumbUp from '@mui/icons-material/ThumbUp';

export default function ButtonIcons() {
return (
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
<Button startDecorator={<Add />}>Add to cart</Button>
<Button aria-label="Like" variant="outlined" color="neutral">
<ThumbUp />
</Button>
<Button variant="soft" endDecorator={<KeyboardArrowRight />} color="success">
Checkout
<Button endDecorator={<KeyboardArrowRight />} color="success">
Go to checkout
</Button>
</Box>
);
Expand Down
7 changes: 2 additions & 5 deletions docs/data/joy/components/button/ButtonIcons.tsx.preview
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Button startDecorator={<Add />}>Add to cart</Button>
<Button aria-label="Like" variant="outlined" color="neutral">
<ThumbUp />
</Button>
<Button variant="soft" endDecorator={<KeyboardArrowRight />} color="success">
Checkout
<Button endDecorator={<KeyboardArrowRight />} color="success">
Go to checkout
</Button>
9 changes: 3 additions & 6 deletions docs/data/joy/components/button/ButtonLoadingIndicator.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import * as React from 'react';
import Stack from '@mui/joy/Stack';
import SendIcon from '@mui/icons-material/Send';
import Button from '@mui/joy/Button';

export default function ButtonLoadingIndicator() {
return (
<Stack spacing={2} direction="row">
<Button loading endDecorator={<SendIcon />} variant="solid">
Send
</Button>
<Button loading loadingIndicator="Loading…" variant="outlined">
Fetch data
<Button loading>Default</Button>
<Button loading loadingIndicator="Loading…">
Custom
</Button>
</Stack>
);
Expand Down
9 changes: 3 additions & 6 deletions docs/data/joy/components/button/ButtonLoadingIndicator.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import * as React from 'react';
import Stack from '@mui/joy/Stack';
import SendIcon from '@mui/icons-material/Send';
import Button from '@mui/joy/Button';

export default function ButtonLoadingIndicator() {
return (
<Stack spacing={2} direction="row">
<Button loading endDecorator={<SendIcon />} variant="solid">
Send
</Button>
<Button loading loadingIndicator="Loading…" variant="outlined">
Fetch data
<Button loading>Default</Button>
<Button loading loadingIndicator="Loading…">
Custom
</Button>
</Stack>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Button loading endDecorator={<SendIcon />} variant="solid">
Send
</Button>
<Button loading loadingIndicator="Loading…" variant="outlined">
Fetch data
<Button loading>Default</Button>
<Button loading loadingIndicator="Loading…">
Custom
</Button>
13 changes: 4 additions & 9 deletions docs/data/joy/components/button/ButtonLoadingPosition.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ import Button from '@mui/joy/Button';
export default function ButtonLoadingPosition() {
return (
<Stack spacing={2} direction="row">
<Button loading loadingPosition="start" variant="outlined">
Fetch data
<Button loading loadingPosition="start">
Start
</Button>
<Button
loading
loadingPosition="end"
endDecorator={<SendIcon />}
variant="solid"
>
Send
<Button loading loadingPosition="end" endDecorator={<SendIcon />}>
End
</Button>
</Stack>
);
Expand Down
13 changes: 4 additions & 9 deletions docs/data/joy/components/button/ButtonLoadingPosition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ import Button from '@mui/joy/Button';
export default function ButtonLoadingPosition() {
return (
<Stack spacing={2} direction="row">
<Button loading loadingPosition="start" variant="outlined">
Fetch data
<Button loading loadingPosition="start">
Start
</Button>
<Button
loading
loadingPosition="end"
endDecorator={<SendIcon />}
variant="solid"
>
Send
<Button loading loadingPosition="end" endDecorator={<SendIcon />}>
End
</Button>
</Stack>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<Button loading loadingPosition="start" variant="outlined">
Fetch data
<Button loading loadingPosition="start">
Start
</Button>
<Button
loading
loadingPosition="end"
endDecorator={<SendIcon />}
variant="solid"
>
Send
<Button loading loadingPosition="end" endDecorator={<SendIcon />}>
End
</Button>

0 comments on commit f140184

Please sign in to comment.