Skip to content

Commit f54a07b

Browse files
authored
Merge pull request #301 from ZeroGachis/SORD-657/rename-eventual-occurences-of-pop-up-popup-dialog-to-modal
🚚 SORD-657 replace dialog to modal
2 parents 9e8a558 + 587fc88 commit f54a07b

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

Storybook/components/Dialog/Dialog.stories.tsx renamed to Storybook/components/Modals/Modals.stories.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import type { Meta, StoryObj } from '@storybook/react-native';
22
import React from 'react';
33
import { StyleSheet, View } from 'react-native';
44

5-
import { Body, Dialog } from 'smartway-react-native-ui';
5+
import { Body, Modal } from 'smartway-react-native-ui';
66
import { IconsName } from '../config/IconList';
77

8-
type DialogPropsAndCustomArgs = React.ComponentProps<typeof Dialog> & {
8+
type ModalPropsAndCustomArgs = React.ComponentProps<typeof Modal> & {
99
haveSecondButton?: boolean;
1010
};
1111

1212
export default {
1313
title: 'components/Dialog',
14-
component: Dialog,
14+
component: Modal,
1515
args: {
1616
variant: 'left',
1717
haveSecondButton: false,
@@ -65,9 +65,9 @@ export default {
6565
\`\`\`
6666
`,
6767
},
68-
} as Meta<DialogPropsAndCustomArgs>;
68+
} as Meta<ModalPropsAndCustomArgs>;
6969

70-
type Story = StoryObj<DialogPropsAndCustomArgs>;
70+
type Story = StoryObj<ModalPropsAndCustomArgs>;
7171

7272
const InsideDialog = ({ variantBody }: { variantBody?: 'left' | 'center' }) => {
7373
const styles = StyleSheet.create({
@@ -90,7 +90,7 @@ export const Default: Story = {
9090
color: args.color ?? undefined,
9191
};
9292
return (
93-
<Dialog
93+
<Modal
9494
icon={iconprops ?? undefined}
9595
{...args}
9696
visible={true}
@@ -112,7 +112,7 @@ export const Default: Story = {
112112
}}
113113
>
114114
<InsideDialog variantBody={args?.variant ?? 'left'} />
115-
</Dialog>
115+
</Modal>
116116
);
117117
},
118118
};

src/components/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Logo } from './logos/Logo';
44
import { Screen } from './Screen';
55
import { Headline } from './typography/Headline';
66
import { Body } from './typography/Body';
7-
import { Dialog } from './dialogs/Dialog';
7+
import { Modal } from './modals/Modal';
88
import { TextField } from './fields/TextField';
99
import { Icon } from './icons/Icon';
1010
import { TopAppBar } from './topAppBar/TopAppBar';
@@ -25,7 +25,7 @@ export {
2525
Body,
2626
Button,
2727
IconButton,
28-
Dialog,
28+
Modal,
2929
Headline,
3030
Icon,
3131
Logo,
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Dimensions, StyleSheet, TextStyle, View, ViewStyle } from 'react-native
33
import { Dialog as BaseDialog, Portal } from 'react-native-paper';
44
import { Button } from '../buttons/Button';
55
import { Headline } from '../typography/Headline';
6-
import { DialogIcon, DialogIconProps } from './DialogIcon';
6+
import { DialogIcon, DialogIconProps } from './ModalIcon';
77
import { useTheme } from '../../styles/themes';
88
import DeviceInfo from 'react-native-device-info';
99

@@ -14,12 +14,12 @@ interface Action {
1414
onPress: () => void;
1515
}
1616

17-
interface DialogActions {
17+
interface ModalActions {
1818
confirm: Action;
1919
cancel?: Action;
2020
}
2121

22-
export interface DialogProps extends PropsWithChildren {
22+
export interface ModalProps extends PropsWithChildren {
2323
visible: boolean;
2424
style?: ViewStyle;
2525
titleStyle?: TextStyle;
@@ -31,10 +31,10 @@ export interface DialogProps extends PropsWithChildren {
3131
variant?: 'left' | 'center';
3232
dismissable?: boolean;
3333
onDismiss?: () => void;
34-
actions: DialogActions;
34+
actions: ModalActions;
3535
}
3636

37-
export const Dialog = (props: DialogProps) => {
37+
export const Modal = (props: ModalProps) => {
3838
const { style, actionsStyle, leftActionsStyle, rightActionsStyle, actions, variant } = props;
3939

4040
const styles = useStyles({
@@ -98,10 +98,10 @@ export const Dialog = (props: DialogProps) => {
9898
};
9999

100100
type UseStylesProps = Pick<
101-
DialogProps,
101+
ModalProps,
102102
'style' | 'actionsStyle' | 'leftActionsStyle' | 'rightActionsStyle' | 'variant'
103103
> & {
104-
cancel: DialogProps['actions']['cancel'];
104+
cancel: ModalProps['actions']['cancel'];
105105
};
106106

107107
function useStyles({

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export {
22
Body,
33
Button,
44
IconButton,
5-
Dialog,
5+
Modal,
66
Headline,
77
Icon,
88
Logo,

0 commit comments

Comments
 (0)