1+ import { cn } from "../../lib/cn" ;
12import { MOBILE_MOTION , MOBILE_SHAPE } from "../../lib/designTokens" ;
23import { useCallback , useEffect , useLayoutEffect , useState } from "react" ;
34import { AccessibilityInfo , Platform , StyleSheet , View , useWindowDimensions } from "react-native" ;
@@ -45,15 +46,19 @@ export function Toast(props: ToastProps) {
4546function ToastContent ( props : ToastProps & { readonly glassReady ?: boolean } ) {
4647 const { fontScale } = useWindowDimensions ( ) ;
4748 const { colorScheme } = useControlTheme ( ) ;
48- const borderRadius = Platform . OS === "ios" ? 31 : MOBILE_SHAPE . toast ;
49+ const borderRadius = Platform . OS === "ios" ? 28 : MOBILE_SHAPE . toast ;
4950 // Explicit single-line notices reserve the action's width and truncate the text.
5051 const inlineAction = props . singleLine || ( ! props . description && fontScale < 1.5 ) ;
5152 const message =
5253 props . singleLine && props . description
5354 ? `${ props . message } : ${ props . description } `
5455 : props . message ;
5556 const action = props . action ? (
56- < Button label = { props . action . label } onPress = { props . action . onPress } />
57+ < Button
58+ label = { props . action . label }
59+ onPress = { props . action . onPress }
60+ size = { Platform . OS === "ios" ? "compact" : "default" }
61+ />
5762 ) : null ;
5863 // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- announces the toast message to VoiceOver through AccessibilityInfo
5964 useEffect ( ( ) => {
@@ -64,10 +69,16 @@ function ToastContent(props: ToastProps & { readonly glassReady?: boolean }) {
6469 key = { props . glassReady === false ? "entering" : "settled" }
6570 chrome = { Platform . OS === "ios" && colorScheme === "dark" ? "none" : undefined }
6671 tintColor = { Platform . OS === "ios" ? null : undefined }
67- className = { Platform . OS === "ios" ? "bg-transparent p-3 " : "p-3" }
72+ className = { Platform . OS === "ios" ? "bg-transparent p-2 " : "p-3" }
6873 style = { { borderRadius } }
6974 >
70- < View className = "flex-row items-center gap-3" >
75+ < View
76+ className = { cn (
77+ "flex-row items-center gap-3" ,
78+ // Match the leading inset to the action label's, which sits inside the button's padding.
79+ Platform . OS === "ios" && inlineAction && action && "pl-5" ,
80+ ) }
81+ >
7182 { props . busy ? (
7283 < AppActivityIndicator />
7384 ) : (
0 commit comments