Skip to content

Commit a0fc3b7

Browse files
committed
refactor: addressed comments
1 parent eefda58 commit a0fc3b7

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,6 @@ e.g.:
154154
</Modal>
155155
```
156156

157-
### Dialog
158-
159-
- The default elevation changed from level `1` to level `3`.
160-
- 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.
161-
162157
### TextInput
163158

164159
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.
@@ -282,6 +277,9 @@ const theme = {
282277

283278
### Dialog
284279

280+
- The default elevation changed from level `1` to level `3`.
281+
- 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.
282+
285283
The Paper 6.x `Dialog` now supports a simplified prop-based API for common dialog layouts. If your dialog previously composed `Dialog.Title`, `Dialog.Content`, and `Dialog.Actions` via `children`, migrate to the dedicated `icon`, `title`, `content`, and `actions` props.
286284

287285
#### Removed props
@@ -303,7 +301,7 @@ The new **`actions`** prop is more customizable because it accepts **`React.Reac
303301
- **`contentProps`** passes props to the internal `Dialog.Content` when `scrollable` is not enabled.
304302
- **`scrollAreaProps`** passes props to the internal `Dialog.ScrollArea` when `scrollable` is enabled.
305303
- **`scrollViewProps`** passes props to the internal `ScrollView` when `scrollable` is enabled.
306-
- **`aria-label`** provides an accessibility label when the dialog title is not a string.
304+
- **`aria-label`** overrides the title as the dialog's accessible name.
307305

308306
```tsx
309307
// Before (v5)

‎src/components/Dialog/Dialog.tsx‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ import * as React from 'react';
22
import { Platform, ScrollView, StyleSheet } from 'react-native';
33
import type { ScrollViewProps, StyleProp } from 'react-native';
44

5-
import type {
6-
DialogContentProps,
7-
DialogScrollAreaProps,
8-
} from 'react-native-paper';
95
import { useSafeAreaInsets } from 'react-native-safe-area-context';
106

117
import Modal from '../Modal';
@@ -18,6 +14,8 @@ import { useInternalTheme } from '../../core/theming';
1814
import type { Elevation, ThemeProp } from '../../theme/types';
1915
import type { IconSource } from '../Icon';
2016
import type { SurfaceStyle } from '../Surface';
17+
import type { Props as DialogContentProps } from './DialogContent';
18+
import type { Props as DialogScrollAreaProps } from './DialogScrollArea';
2119
import Text from '../Typography/Text';
2220

2321
export type Props = {

‎src/components/Modal.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ function Modal({
227227
return (
228228
<Animated.View
229229
pointerEvents={visible ? 'auto' : 'none'}
230-
aria-modal
231230
aria-live="polite"
232231
style={StyleSheet.absoluteFill}
233232
onAccessibilityEscape={onDismissCallback}
@@ -266,6 +265,7 @@ function Modal({
266265
transitionDuration={scale * DEFAULT_DURATION}
267266
aria-label={ariaLabel}
268267
role="dialog"
268+
aria-modal
269269
>
270270
{children}
271271
</Surface>

0 commit comments

Comments
 (0)