Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/components/Snackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export type Props = $Omit<React.ComponentProps<typeof Surface>, 'mode'> & {
* Style for the wrapper of the snackbar
*/
wrapperStyle?: StyleProp<ViewStyle>;
/**
* Style for the content of the snackbar
*/
contentStyle?: StyleProp<ViewStyle>;
style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
ref?: React.RefObject<View>;
/**
Expand Down Expand Up @@ -152,8 +156,9 @@ const Snackbar = ({
onDismiss,
children,
elevation = 2,
wrapperStyle,
style,
wrapperStyle,
contentStyle,
theme: themeOverrides,
maxFontSizeMultiplier,
rippleColor,
Expand Down Expand Up @@ -279,7 +284,7 @@ const Snackbar = ({
}

return (
<View style={styles.content}>
<View style={[styles.content, contentStyle]}>
{/* View is added to allow multiple lines support for Text component as children */}
<View>{children}</View>
</View>
Expand Down
26 changes: 16 additions & 10 deletions src/components/__tests__/__snapshots__/Snackbar.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ exports[`renders snackbar with Text as a child 1`] = `
>
<View
style={
{
"flex": 1,
"marginHorizontal": 16,
"marginVertical": 14,
}
[
{
"flex": 1,
"marginHorizontal": 16,
"marginVertical": 14,
},
undefined,
]
}
>
<View>
Expand Down Expand Up @@ -154,11 +157,14 @@ exports[`renders snackbar with View & Text as a child 1`] = `
>
<View
style={
{
"flex": 1,
"marginHorizontal": 16,
"marginVertical": 14,
}
[
{
"flex": 1,
"marginHorizontal": 16,
"marginVertical": 14,
},
undefined,
]
}
>
<View>
Expand Down
Loading