Skip to content

Commit 58089aa

Browse files
authored
update indentation
1 parent c9a5ad6 commit 58089aa

21 files changed

+60
-331
lines changed

docs/AppBar.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,9 @@ import { Logo } from './Logo';
129129

130130
const MyAppBar = () => (
131131
<AppBar>
132-
<Box
133-
component="span"
134-
sx={{
135-
flex: 1
136-
}}
137-
/>
132+
<Box component="span" sx={{ flex: 1 }} />
138133
<Logo />
139-
<Box
140-
component="span"
141-
sx={{
142-
flex: 1
143-
}}
144-
/>
134+
<Box component="span" sx={{ flex: 1 }} />
145135
<Search />
146136
</AppBar>
147137
);
@@ -472,11 +462,7 @@ export const MyAppBar = () => (
472462
<AppBar position="static">
473463
<Toolbar>
474464
<TitlePortal />
475-
<Box
476-
sx={{
477-
flex: "1"
478-
}}
479-
/>
465+
<Box sx={{ flex: "1" }} />
480466
<RefreshIconButton />
481467
</Toolbar>
482468
</AppBar>

docs/Architecture.md

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -346,31 +346,13 @@ const ContactShowContent = () => {
346346
const { record, isPending } = useShowContext<Contact>();
347347
if (isPending || !record) return null;
348348
return (
349-
<Box
350-
sx={{
351-
mt: 2,
352-
display: "flex"
353-
}}
354-
>
355-
<Box
356-
sx={{
357-
flex: "1"
358-
}}
359-
>
349+
<Box sx={{ mt: 2, display: "flex" }}>
350+
<Box sx={{ flex: "1" }}>
360351
<Card>
361352
<CardContent>
362-
<Box
363-
sx={{
364-
display: "flex"
365-
}}
366-
>
353+
<Box sx={{ display: "flex" }}>
367354
<Avatar />
368-
<Box
369-
sx={{
370-
ml: 2,
371-
flex: "1"
372-
}}
373-
>
355+
<Box sx={{ ml: 2, flex: "1" }}>
374356
<Typography variant="h5">
375357
{record.first_name} {record.last_name}
376358
</Typography>

docs/Breadcrumb.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,7 @@ const IconAndLabel = ({
360360
<Stack
361361
direction="row"
362362
spacing={1}
363-
sx={{
364-
alignItems: "center"
365-
}}
363+
sx={{ alignItems: "center" }}
366364
>
367365
{icon}
368366
<Typography variant="body2">{label}</Typography>
@@ -552,9 +550,7 @@ const MyBreadcrumbCustomHome = () => (
552550
<Stack
553551
direction="row"
554552
spacing={1}
555-
sx={{
556-
alignItems: "center"
557-
}}
553+
sx={{ alignItems: "center" }}
558554
>
559555
<CabinIcon />
560556
<Box sx={visuallyHidden}>Dashboard</Box>

docs/Configurable.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@ The inner component reads the preferences using the same `usePreference` hook:
6565
const TextBlock = ({ title, content }) => {
6666
const [color] = usePreference('color', '#ffffff');
6767
return (
68-
<Box
69-
sx={{
70-
bgcolor: color
71-
}}
72-
>
68+
<Box sx={{ bgcolor: color }}>
7369
<Typography variant="h6">{title}</Typography>
7470
<Typography>{content}</Typography>
7571
</Box>
@@ -244,18 +240,10 @@ const MyLayout = ({ children, dashboard }) => (
244240
>
245241
<Box
246242
overflowX="auto"
247-
sx={{
248-
display: "flex",
249-
flexDirection: "column"
250-
}}
243+
sx={{ display: "flex", flexDirection: "column" }}
251244
>
252245
<AppBar />
253-
<Box
254-
sx={{
255-
display: "flex",
256-
flexGrow: 1
257-
}}
258-
>
246+
<Box sx={{ display: "flex", flexGrow: 1 }}>
259247
<Sidebar>
260248
<Menu hasDashboard={!!dashboard} />
261249
</Sidebar>

docs/DatagridAG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,11 +1526,7 @@ const CreatePostDialog = () => {
15261526
<Dialog open onClose={onCancel}>
15271527
<form onSubmit={handleSubmit}>
15281528
<DialogContent>
1529-
<Stack
1530-
sx={{
1531-
gap: 4
1532-
}}
1533-
>
1529+
<Stack sx={{ gap: 4 }}>
15341530
<MUITextField
15351531
name="title"
15361532
value={title}

docs/FilterButton.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,7 @@ const postFilters = [
4040
];
4141

4242
const ListToolbar = () => (
43-
<Stack
44-
direction="row"
45-
sx={{
46-
justifyContent: "space-between"
47-
}}
48-
>
43+
<Stack direction="row" sx={{ justifyContent: "space-between" }}>
4944
<FilterForm filters={postFilters} />
5045
<div>
5146
<FilterButton filters={postFilters} />
@@ -75,12 +70,7 @@ By default, the filter button lets users save a group of filters for later reuse
7570
{% raw %}
7671
```jsx
7772
const ListToolbar = () => (
78-
<Stack
79-
direction="row"
80-
sx={{
81-
justifyContent: "space-between"
82-
}}
83-
>
73+
<Stack direction="row" sx={{ justifyContent: "space-between" }}>
8474
<FilterForm filters={postFilters} />
8575
<div>
8676
<FilterButton filters={postFilters} disableSaveQuery />

docs/FilterForm.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,7 @@ const postFilters = [
4040
];
4141

4242
const ListToolbar = () => (
43-
<Stack
44-
direction="row"
45-
sx={{
46-
justifyContent: "space-between",
47-
}}
48-
>
43+
<Stack direction="row" sx={{ justifyContent: "space-between" }}>
4944
<FilterForm filters={postFilters} />
5045
<div>
5146
<FilterButton filters={postFilters} />

docs/FilteringTutorial.md

Lines changed: 10 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -533,19 +533,8 @@ import { FilterLiveForm, TextInput, NullableBooleanInput } from 'react-admin';
533533

534534
const PostFilterForm = () => (
535535
<FilterLiveForm>
536-
<Box
537-
sx={{
538-
display: "flex",
539-
alignItems: "flex-end",
540-
mb: 1
541-
}}
542-
>
543-
<Box
544-
component="span"
545-
sx={{
546-
mr: 2
547-
}}
548-
>
536+
<Box sx={{ display: "flex", alignItems: "flex-end", mb: 1 }}>
537+
<Box component="span" sx={{ mr: 2 }}>
549538
{/* Full-text search filter. We don't use <SearchFilter> to force a large form input */}
550539
<TextInput
551540
resettable
@@ -561,12 +550,7 @@ const PostFilterForm = () => (
561550
}}
562551
/>
563552
</Box>
564-
<Box
565-
component="span"
566-
sx={{
567-
mr: 2
568-
}}
569-
>
553+
<Box component="span" sx={{ mr: 2 }}>
570554
{/* Commentable filter */}
571555
<NullableBooleanInput
572556
helperText={false}
@@ -618,19 +602,8 @@ const PostFilterForm = () => {
618602
return (
619603
<FormProvider {...form}>
620604
<form onSubmit={form.handleSubmit(onSubmit)}>
621-
<Box
622-
sx={{
623-
display: "flex",
624-
alignItems: "flex-end",
625-
mb: 1
626-
}}
627-
>
628-
<Box
629-
component="span"
630-
sx={{
631-
mr: 2
632-
}}
633-
>
605+
<Box sx={{ display: "flex", alignItems: "flex-end", mb: 1 }}>
606+
<Box component="span" sx={{ mr: 2 }}>
634607
{/* Full-text search filter. We don't use <SearchFilter> to force a large form input */}
635608
<TextInput
636609
resettable
@@ -646,39 +619,19 @@ const PostFilterForm = () => {
646619
}}
647620
/>
648621
</Box>
649-
<Box
650-
component="span"
651-
sx={{
652-
mr: 2
653-
}}
654-
>
622+
<Box component="span" sx={{ mr: 2 }}>
655623
{/* Commentable filter */}
656624
<NullableBooleanInput
657625
helperText={false}
658626
source="commentable"
659627
/>
660628
</Box>
661-
<Box
662-
component="span"
663-
sx={{
664-
mr: 2,
665-
mb: 1.5
666-
}}
667-
>
668-
<Button
669-
variant="outlined"
670-
color="primary"
671-
type="submit"
672-
>
629+
<Box component="span" sx={{ mr: 2, mb: 1.5 }}>
630+
<Button variant="outlined" color="primary" type="submit">
673631
Filter
674632
</Button>
675633
</Box>
676-
<Box
677-
component="span"
678-
sx={{
679-
mb: 1.5
680-
}}
681-
>
634+
<Box component="span" sx={{ mb: 1.5 }}>
682635
<Button variant="outlined" onClick={resetFilter}>
683636
Close
684637
</Button>
@@ -701,11 +654,7 @@ import { TopToolbar, ExportButton } from 'react-admin';
701654
import { Box } from '@mui/material';
702655

703656
const ListActions = () => (
704-
<Box
705-
sx={{
706-
width: "100%"
707-
}}
708-
>
657+
<Box sx={{ width: "100%" }}>
709658
<TopToolbar>
710659
<PostFilterButton />
711660
<ExportButton />

docs/InfiniteList.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,7 @@ const LoadMore = () => {
103103
isFetchingNextPage,
104104
} = useInfinitePaginationContext();
105105
return hasNextPage ? (
106-
<Box
107-
sx={{
108-
mt: 1,
109-
textAlign: "center"
110-
}}
111-
>
106+
<Box sx={{ mt: 1, textAlign: "center" }}>
112107
<Button
113108
disabled={isFetchingNextPage}
114109
onClick={() => fetchNextPage()}
@@ -148,13 +143,7 @@ const CustomPagination = () => {
148143
<>
149144
<InfinitePagination />
150145
{total > 0 && (
151-
<Box
152-
sx={{
153-
position: "sticky",
154-
bottom: 0,
155-
textAlign: "center"
156-
}}
157-
>
146+
<Box sx={{ position: "sticky", bottom: 0, textAlign: "center" }}>
158147
<Card
159148
elevation={2}
160149
sx={{ px: 2, py: 1, mb: 1, display: 'inline-block' }}

docs/Layout.md

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,9 @@ import Logo from './Logo';
104104
export const MyAppBar = () => (
105105
<AppBar color="primary">
106106
<TitlePortal />
107-
<Box
108-
sx={{
109-
flex: "1"
110-
}}
111-
/>
107+
<Box sx={{ flex: "1" }} />
112108
<Logo />
113-
<Box
114-
sx={{
115-
flex: "1"
116-
}}
117-
/>
109+
<Box sx={{ flex: "1" }} />
118110
</AppBar>
119111
);
120112
```
@@ -489,18 +481,10 @@ const MyLayout = ({ children }) => (
489481
>
490482
<Box
491483
overflowX="auto"
492-
sx={{
493-
display: "flex",
494-
flexDirection: "column"
495-
}}
484+
sx={{ display: "flex", flexDirection: "column" }}
496485
>
497486
<AppBar />
498-
<Box
499-
sx={{
500-
display: "flex",
501-
flexGrow: 1
502-
}}
503-
>
487+
<Box sx={{ display: "flex", flexGrow: 1 }}>
504488
<Sidebar>
505489
<Menu />
506490
</Sidebar>

0 commit comments

Comments
 (0)