Skip to content

Commit 8a1c86a

Browse files
authored
fix(docs): syntax highlighting (#4857)
* fix: syntax highlighting for ripple effect section * fix: tabulation in Appbar docs examples * fix: table docs code snippets tabulation * fix: drawer docs code snippets tabulation * fix: modal docs example snippet formatting * fix: ToggleButtonGroup docs example snippet formatting
1 parent 16a4849 commit 8a1c86a

File tree

12 files changed

+61
-60
lines changed

12 files changed

+61
-60
lines changed

docs/docs/guides/11-ripple-effect.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The ripple effect on the iOS platform is replaced by a highlight effect.
1414

1515
The `rippleColor` prop is available for every pressable component which allows you to set the color of the ripple effect. For the instance, to make the `Button` component's ripple effect transparent, simply pass the desired color value to the prop:
1616

17-
```
17+
```typescript
1818
<Button
1919
rippleColor="#FF000020"
2020
icon="camera"
@@ -28,7 +28,7 @@ The `rippleColor` prop is available for every pressable component which allows y
2828
2929
To disable the ripple effect in **all** of Paper's components set `rippleEffectEnabled: false` on the `settings` prop of `PaperProvider`.
3030
31-
```
31+
```typescript
3232
import { Provider as PaperProvider } from 'react-native-paper';
3333
// ...
3434

src/components/Appbar/AppbarAction.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ export type Props = React.ComponentPropsWithoutRef<typeof IconButton> & {
7171
* const MORE_ICON = Platform.OS === 'ios' ? 'dots-horizontal' : 'dots-vertical';
7272
*
7373
* const MyComponent = () => (
74-
* <Appbar.Header>
75-
* <Appbar.Content title="Title" subtitle={'Subtitle'} />
76-
* <Appbar.Action icon="magnify" onPress={() => {}} />
77-
* <Appbar.Action icon={MORE_ICON} onPress={() => {}} />
78-
* </Appbar.Header>
74+
* <Appbar.Header>
75+
* <Appbar.Content title="Title" subtitle={'Subtitle'} />
76+
* <Appbar.Action icon="magnify" onPress={() => {}} />
77+
* <Appbar.Action icon={MORE_ICON} onPress={() => {}} />
78+
* </Appbar.Header>
7979
* );
8080
*
8181
* export default MyComponent;

src/components/Appbar/AppbarBackAction.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ export type Props = $Omit<
4949
* import { Appbar } from 'react-native-paper';
5050
*
5151
* const MyComponent = () => (
52-
* <Appbar.Header>
53-
* <Appbar.BackAction onPress={() => {}} />
54-
* </Appbar.Header>
52+
* <Appbar.Header>
53+
* <Appbar.BackAction onPress={() => {}} />
54+
* </Appbar.Header>
5555
* );
5656
*
5757
* export default MyComponent;

src/components/Appbar/AppbarContent.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ export type Props = $RemoveChildren<typeof View> & {
9292
* import { Appbar } from 'react-native-paper';
9393
*
9494
* const MyComponent = () => (
95-
* <Appbar.Header>
96-
* <Appbar.Content title="Title" />
97-
* </Appbar.Header>
95+
* <Appbar.Header>
96+
* <Appbar.Content title="Title" />
97+
* </Appbar.Header>
9898
* );
9999
*
100100
* export default MyComponent;

src/components/DataTable/DataTableCell.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ export type Props = $RemoveChildren<typeof TouchableRipple> & {
4848
* import { DataTable } from 'react-native-paper';
4949
*
5050
* const MyComponent = () => (
51-
* <DataTable.Row>
52-
* <DataTable.Cell numeric>1</DataTable.Cell>
53-
* <DataTable.Cell numeric>2</DataTable.Cell>
54-
* <DataTable.Cell numeric>3</DataTable.Cell>
55-
* <DataTable.Cell numeric>4</DataTable.Cell>
56-
* </DataTable.Row>
51+
* <DataTable.Row>
52+
* <DataTable.Cell numeric>1</DataTable.Cell>
53+
* <DataTable.Cell numeric>2</DataTable.Cell>
54+
* <DataTable.Cell numeric>3</DataTable.Cell>
55+
* <DataTable.Cell numeric>4</DataTable.Cell>
56+
* </DataTable.Row>
5757
* );
5858
*
5959
* export default MyComponent;

src/components/DataTable/DataTableHeader.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ export type Props = React.ComponentPropsWithRef<typeof View> & {
2828
* import { DataTable } from 'react-native-paper';
2929
*
3030
* const MyComponent = () => (
31-
* <DataTable>
32-
* <DataTable.Header>
33-
* <DataTable.Title
34-
* sortDirection='descending'
35-
* >
36-
* Dessert
37-
* </DataTable.Title>
38-
* <DataTable.Title numeric>Calories</DataTable.Title>
39-
* <DataTable.Title numeric>Fat (g)</DataTable.Title>
40-
* </DataTable.Header>
41-
* </DataTable>
31+
* <DataTable>
32+
* <DataTable.Header>
33+
* <DataTable.Title
34+
* sortDirection='descending'
35+
* >
36+
* Dessert
37+
* </DataTable.Title>
38+
* <DataTable.Title numeric>Calories</DataTable.Title>
39+
* <DataTable.Title numeric>Fat (g)</DataTable.Title>
40+
* </DataTable.Header>
41+
* </DataTable>
4242
* );
4343
*
4444
* export default MyComponent;

src/components/DataTable/DataTableRow.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ export type Props = $RemoveChildren<typeof TouchableRipple> & {
4444
* import { DataTable } from 'react-native-paper';
4545
*
4646
* const MyComponent = () => (
47-
* <DataTable.Row>
48-
* <DataTable.Cell numeric>1</DataTable.Cell>
49-
* <DataTable.Cell numeric>2</DataTable.Cell>
50-
* <DataTable.Cell numeric>3</DataTable.Cell>
51-
* <DataTable.Cell numeric>4</DataTable.Cell>
52-
* </DataTable.Row>
47+
* <DataTable.Row>
48+
* <DataTable.Cell numeric>1</DataTable.Cell>
49+
* <DataTable.Cell numeric>2</DataTable.Cell>
50+
* <DataTable.Cell numeric>3</DataTable.Cell>
51+
* <DataTable.Cell numeric>4</DataTable.Cell>
52+
* </DataTable.Row>
5353
* );
5454
*
5555
* export default MyComponent;

src/components/DataTable/DataTableTitle.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ export type Props = React.ComponentPropsWithRef<typeof Pressable> & {
6363
* import { DataTable } from 'react-native-paper';
6464
*
6565
* const MyComponent = () => (
66-
* <DataTable>
67-
* <DataTable.Header>
68-
* <DataTable.Title
69-
* sortDirection='descending'
70-
* >
71-
* Dessert
72-
* </DataTable.Title>
73-
* <DataTable.Title numeric>Calories</DataTable.Title>
74-
* <DataTable.Title numeric>Fat (g)</DataTable.Title>
75-
* </DataTable.Header>
76-
* </DataTable>
66+
* <DataTable>
67+
* <DataTable.Header>
68+
* <DataTable.Title
69+
* sortDirection='descending'
70+
* >
71+
* Dessert
72+
* </DataTable.Title>
73+
* <DataTable.Title numeric>Calories</DataTable.Title>
74+
* <DataTable.Title numeric>Fat (g)</DataTable.Title>
75+
* </DataTable.Header>
76+
* </DataTable>
7777
* );
7878
*
7979
* export default MyComponent;

src/components/Drawer/DrawerCollapsedItem.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ const outlineHeight = 32;
8585
* import { Drawer } from 'react-native-paper';
8686
*
8787
* const MyComponent = () => (
88-
* <Drawer.CollapsedItem
89-
* focusedIcon="inbox"
90-
* unfocusedIcon="inbox-outline"
91-
* label="Inbox"
92-
* />
88+
* <Drawer.CollapsedItem
89+
* focusedIcon="inbox"
90+
* unfocusedIcon="inbox-outline"
91+
* label="Inbox"
92+
* />
9393
* );
9494
*
9595
* export default MyComponent;

src/components/Drawer/DrawerItem.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ export type Props = React.ComponentPropsWithRef<typeof View> & {
8181
* import { Drawer } from 'react-native-paper';
8282
*
8383
* const MyComponent = () => (
84-
* <Drawer.Item
85-
* style={{ backgroundColor: '#64ffda' }}
86-
* icon="star"
87-
* label="First Item"
88-
* />
84+
* <Drawer.Item
85+
* style={{ backgroundColor: '#64ffda' }}
86+
* icon="star"
87+
* label="First Item"
88+
* />
8989
* );
9090
*
9191
* export default MyComponent;

0 commit comments

Comments
 (0)