Skip to content

Commit 31d8c58

Browse files
authored
fix: rename misspelled props and various typos (#5117)
1 parent 23b4d3c commit 31d8c58

21 files changed

Lines changed: 96 additions & 74 deletions

File tree

docs/6.x/docs/guides/fonts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Older Material Design 2 platform-split font configuration (`configureFonts` with
5757
In the latest version fonts in theme are structured based on the `variant` keys e.g. `displayLarge` or `bodyMedium` which are then used in `Text`'s component throughout the whole library.
5858
5959
:::info
60-
The default `fontFamily` is different per particular platfrom:
60+
The default `fontFamily` is different per particular platform:
6161
6262
```js
6363
Platform.select({

docs/6.x/docs/guides/migration.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,28 @@ e.g.:
188188
- The default elevation changed from level `1` to level `3`.
189189
- The `style` prop no longer configures the background color or border radius. You can override `theme.colors.surfaceContainerHigh` and `theme.shapes.corner.extraLarge` using the `theme` prop instead.
190190

191+
### Searchbar
192+
193+
The misspelled `traileringIcon` props have been renamed:
194+
195+
- **`traileringIcon`****`trailingIcon`**
196+
- **`traileringIconColor`****`trailingIconColor`**
197+
- **`traileringIconAccessibilityLabel`****`trailingIconAccessibilityLabel`**
198+
- **`onTraileringIconPress`****`onTrailingIconPress`**
199+
200+
```diff
201+
<Searchbar
202+
- traileringIcon="microphone"
203+
- traileringIconColor={colors.onSurfaceVariant}
204+
- traileringIconAccessibilityLabel="microphone button"
205+
- onTraileringIconPress={onMicrophonePress}
206+
+ trailingIcon="microphone"
207+
+ trailingIconColor={colors.onSurfaceVariant}
208+
+ trailingIconAccessibilityLabel="microphone button"
209+
+ onTrailingIconPress={onMicrophonePress}
210+
/>
211+
```
212+
191213
### TextInput
192214

193215
The Paper 6.x `TextInput` is a complete rewrite with a new API. Import the component the same way, but note that the props and behavior have changed significantly.

docs/src/components/ScreenshotTabs.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ const getClassName = (value: string) =>
1616
: `tabScreenshot${value.includes('full-width') ? 'full-width' : ''}`;
1717

1818
const ScreenshotTabs = ({ screenshotData }: ScreenshotTabsProps) => {
19-
const renderScreenhot = (src: string): ReactNode => (
19+
const renderScreenshot = (src: string): ReactNode => (
2020
<img src={withBase(src)} className={getClassName(src)} />
2121
);
2222

2323
if (typeof screenshotData === 'string') {
24-
return renderScreenhot(screenshotData);
24+
return renderScreenshot(screenshotData);
2525
}
2626

2727
const screenshots = Object.entries(screenshotData).map(([key, value]) => (
2828
<TabItem key={key} value={key} label={key} default>
29-
{typeof value === 'string' ? renderScreenhot(value) : null}
29+
{typeof value === 'string' ? renderScreenshot(value) : null}
3030
</TabItem>
3131
));
3232

docs/src/data/themeColors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export const themeColors = {
164164
'textColor/iconColor': 'theme.colors.onTertiaryContainer',
165165
},
166166
surface: {
167-
backgroundColor: 'theme.colors.elevarion.level3',
167+
backgroundColor: 'theme.colors.elevation.level3',
168168
'textColor/iconColor': 'theme.colors.primary',
169169
},
170170
},
@@ -186,7 +186,7 @@ export const themeColors = {
186186
'textColor/iconColor': 'theme.colors.onTertiaryContainer',
187187
},
188188
surface: {
189-
backgroundColor: 'theme.colors.elevarion.level3',
189+
backgroundColor: 'theme.colors.elevation.level3',
190190
'textColor/iconColor': 'theme.colors.primary',
191191
},
192192
},

example/src/Examples/SearchbarExample.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const SearchExample = () => {
1919
const [isVisible, setIsVisible] = React.useState(false);
2020
const [searchQueries, setSearchQuery] = React.useState({
2121
searchBarMode: '',
22-
traileringIcon: '',
23-
traileringIconWithRightItem: '',
22+
trailingIcon: '',
23+
trailingIconWithRightItem: '',
2424
rightItem: '',
2525
loadingBarMode: '',
2626
searchViewMode: '',
@@ -47,36 +47,36 @@ const SearchExample = () => {
4747
mode="bar"
4848
/>
4949
<Searchbar
50-
placeholder="Trailering icon"
50+
placeholder="Trailing icon"
5151
onChangeText={(query) =>
52-
setSearchQuery({ ...searchQueries, traileringIcon: query })
52+
setSearchQuery({ ...searchQueries, trailingIcon: query })
5353
}
54-
value={searchQueries.traileringIcon}
55-
traileringIcon={'microphone'}
56-
traileringIconColor={
54+
value={searchQueries.trailingIcon}
55+
trailingIcon={'microphone'}
56+
trailingIconColor={
5757
isVisible ? Palette.error40 : colors.onSurfaceVariant
5858
}
59-
traileringIconAccessibilityLabel={'microphone button'}
60-
onTraileringIconPress={() => setIsVisible(true)}
59+
trailingIconAccessibilityLabel={'microphone button'}
60+
onTrailingIconPress={() => setIsVisible(true)}
6161
style={styles.searchbar}
6262
mode="bar"
6363
/>
6464
<Searchbar
6565
mode="bar"
66-
placeholder="Trailering icon with right item"
66+
placeholder="Trailing icon with right item"
6767
onChangeText={(query) =>
6868
setSearchQuery({
6969
...searchQueries,
70-
traileringIconWithRightItem: query,
70+
trailingIconWithRightItem: query,
7171
})
7272
}
73-
value={searchQueries.traileringIconWithRightItem}
74-
traileringIcon={'microphone'}
75-
traileringIconColor={
73+
value={searchQueries.trailingIconWithRightItem}
74+
trailingIcon={'microphone'}
75+
trailingIconColor={
7676
isVisible ? Palette.error40 : colors.onSurfaceVariant
7777
}
78-
traileringIconAccessibilityLabel={'microphone button'}
79-
onTraileringIconPress={() => setIsVisible(true)}
78+
trailingIconAccessibilityLabel={'microphone button'}
79+
onTrailingIconPress={() => setIsVisible(true)}
8080
right={(props) => (
8181
<Avatar.Image
8282
{...props}
@@ -117,7 +117,7 @@ const SearchExample = () => {
117117
style={styles.searchbar}
118118
mode="bar"
119119
loading
120-
traileringIcon={'microphone'}
120+
trailingIcon={'microphone'}
121121
/>
122122
</List.Section>
123123
<List.Section title="View mode">

src/components/Button/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export type Props = Omit<ViewProps, 'style'> & {
7474
*/
7575
uppercase?: boolean;
7676
/**
77-
* Type of background drawabale to display the feedback (Android).
77+
* Type of background drawable to display the feedback (Android).
7878
* https://reactnative.dev/docs/pressable#rippleconfig
7979
*/
8080
background?: PressableAndroidRippleConfig;

src/components/Checkbox/CheckboxItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export type Props = {
3737
*/
3838
onLongPress?: (e: GestureResponderEvent) => void;
3939
/**
40-
* Type of background drawabale to display the feedback (Android).
40+
* Type of background drawable to display the feedback (Android).
4141
* https://reactnative.dev/docs/pressable#rippleconfig
4242
*/
4343
background?: PressableAndroidRippleConfig;

src/components/Chip/Chip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export type Props = Omit<ViewProps, 'style'> & {
7575
*/
7676
disabled?: boolean;
7777
/**
78-
* Type of background drawabale to display the feedback (Android).
78+
* Type of background drawable to display the feedback (Android).
7979
* https://reactnative.dev/docs/pressable#rippleconfig
8080
*/
8181
background?: PressableAndroidRippleConfig;

src/components/Drawer/DrawerItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export type Props = ViewProps & {
3939
*/
4040
onPress?: (e: GestureResponderEvent) => void;
4141
/**
42-
* Type of background drawabale to display the feedback (Android).
42+
* Type of background drawable to display the feedback (Android).
4343
* https://reactnative.dev/docs/pressable#rippleconfig
4444
*/
4545
background?: PressableAndroidRippleConfig;

src/components/List/ListAccordion.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export type Props = {
6767
*/
6868
theme?: ThemeProp;
6969
/**
70-
* Type of background drawabale to display the feedback (Android).
70+
* Type of background drawable to display the feedback (Android).
7171
* https://reactnative.dev/docs/pressable#rippleconfig
7272
*/
7373
background?: PressableAndroidRippleConfig;

0 commit comments

Comments
 (0)