Check for Trans component
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
|||||||
ViewStyle,
|
ViewStyle,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import LinearGradient from 'react-native-linear-gradient'
|
import LinearGradient from 'react-native-linear-gradient'
|
||||||
|
import {Trans} from '@lingui/macro'
|
||||||
|
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {android, atoms as a, flatten, tokens, useTheme} from '#/alf'
|
import {android, atoms as a, flatten, tokens, useTheme} from '#/alf'
|
||||||
@@ -405,7 +406,9 @@ export function Button({
|
|||||||
)}
|
)}
|
||||||
<Context.Provider value={context}>
|
<Context.Provider value={context}>
|
||||||
<ButtonTextErrorBoundary>
|
<ButtonTextErrorBoundary>
|
||||||
{typeof children === 'string' ? (
|
{/* @ts-ignore */}
|
||||||
|
{typeof children === 'string' || children?.type === Trans ? (
|
||||||
|
/* @ts-ignore */
|
||||||
<ButtonText>{children}</ButtonText>
|
<ButtonText>{children}</ButtonText>
|
||||||
) : typeof children === 'function' ? (
|
) : typeof children === 'function' ? (
|
||||||
children(context)
|
children(context)
|
||||||
|
|||||||
Reference in New Issue
Block a user