Skip to content

Commit 7e01362

Browse files
committed
style: rename containerStyle->safeAreaStyle & contentContainerStyle->containerStyle for consistency
1 parent 43f71c9 commit 7e01362

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/ui-components/SimpleToast.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import {
1010
import type { NotifierComponentProps } from '../types';
1111

1212
const s = StyleSheet.create({
13-
container: {
13+
safeArea: {
1414
alignItems: 'center',
1515
},
16-
contentContainer: {
16+
container: {
1717
backgroundColor: '#333333',
1818
borderRadius: 25,
1919
margin: 10,
@@ -42,29 +42,29 @@ export interface SimpleToastProps extends NotifierComponentProps {
4242
* @default null */
4343
titleStyle?: StyleProp<TextStyle>;
4444

45-
/** The style to use for toast container.
45+
/** The style to use for safe area container.
4646
* @default null */
47-
containerStyle?: StyleProp<ViewStyle>;
47+
safeAreaStyle?: StyleProp<ViewStyle>;
4848

4949
/** The style to use for toast content container.
5050
* Might be useful to change background color, shadows, paddings or margins
5151
* @default null */
52-
contentContainerStyle?: StyleProp<ViewStyle>;
52+
containerStyle?: StyleProp<ViewStyle>;
5353
}
5454

5555
export const SimpleToastComponent = ({
5656
title,
5757
titleStyle,
5858
ContainerComponent,
5959
maxTitleLines,
60+
safeAreaStyle,
6061
containerStyle,
61-
contentContainerStyle,
6262
ViewWithOffsets,
6363
}: SimpleToastProps) => {
6464
const Container = ContainerComponent ?? ViewWithOffsets;
6565
return (
66-
<Container style={[s.container, containerStyle]}>
67-
<View style={[s.contentContainer, contentContainerStyle]}>
66+
<Container style={[s.safeArea, safeAreaStyle]}>
67+
<View style={[s.container, containerStyle]}>
6868
{!!title && (
6969
<Text style={[s.title, titleStyle]} numberOfLines={maxTitleLines}>
7070
{title}

src/ui-components/Toast.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import {
2020
} from './common';
2121

2222
const s = StyleSheet.create({
23-
container: {
23+
safeArea: {
2424
alignItems: 'center',
2525
},
26-
contentContainer: {
26+
container: {
2727
margin: 10,
2828
backgroundColor: '#ffffff',
2929
borderRadius: 33,
@@ -95,14 +95,14 @@ export interface ToastProps extends NotifierComponentProps {
9595
* @example iconSource: require('./icons/success.png') */
9696
iconSource?: ImageSourcePropType;
9797

98-
/** Style for the outermost container of the toast.
98+
/** Style for the safe area container of the toast.
9999
* @default null */
100-
containerStyle?: StyleProp<ViewStyle>;
100+
safeAreaStyle?: StyleProp<ViewStyle>;
101101

102102
/** Style for the toast content container, often used to modify background color,
103103
* shadows, padding, or margin.
104104
* @default null */
105-
contentContainerStyle?: StyleProp<ViewStyle>;
105+
containerStyle?: StyleProp<ViewStyle>;
106106

107107
/** Style for the icon container, useful for adjusting background color or size.
108108
* @default null */
@@ -139,8 +139,8 @@ export const ToastComponent = ({
139139
maxTitleLines,
140140
maxDescriptionLines,
141141
iconSource,
142+
safeAreaStyle,
142143
containerStyle,
143-
contentContainerStyle,
144144
iconContainerStyle,
145145
iconStyle,
146146
textContainerStyle,
@@ -151,13 +151,13 @@ export const ToastComponent = ({
151151
}: ToastProps) => {
152152
const Container = ContainerComponent ?? ViewWithOffsets;
153153
return (
154-
<Container style={[s.container, containerStyle]}>
154+
<Container style={[s.safeArea, safeAreaStyle]}>
155155
<View
156156
style={[
157-
s.contentContainer,
157+
s.container,
158158
commonStyles.shadow,
159159
!type && !iconSource && s.contentContainerNoIcon,
160-
contentContainerStyle,
160+
containerStyle,
161161
]}
162162
>
163163
{(!!type || !!iconSource) && (

0 commit comments

Comments
 (0)