Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { StyleSheet } from 'react-native';
import { Theme } from '../../../../../../util/theme/models';
import { Theme, AppThemeKey } from '../../../../../../util/theme/models';
import { colors } from '../../../../../../styles/common';

const styleSheet = (params: { theme: Theme }) =>
StyleSheet.create({
const styleSheet = (params: { theme: Theme }) => {
const isDark = params.theme.themeAppearance === AppThemeKey.dark;
return StyleSheet.create({
headerWithoutPadding: {
paddingVertical: 0,
},
webview: {
backgroundColor: params.theme.colors.background.default,
backgroundColor: isDark
? colors.transakBackgroundDark
: colors.transakBackgroundLight,
},
});
};

export default styleSheet;
14 changes: 14 additions & 0 deletions app/components/UI/Ramp/Aggregator/Views/Checkout/Checkout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ import {
} from '../../../../../../component-library/components/Icons/Icon';
import { useStyles } from '../../../../../../component-library/hooks';
import styleSheet from './Checkout.styles';
import { useTheme } from '../../../../../../util/theme';
import { AppThemeKey } from '../../../../../../util/theme/models';
import { colors } from '../../../../../../styles/common';
import Device from '../../../../../../util/device';
import { shouldStartLoadWithRequest } from '../../../../../../util/browser';
import { CHECKOUT_TEST_IDS } from './Checkout.testIds';
Expand Down Expand Up @@ -67,6 +70,16 @@ const CheckoutWebView = () => {
const handleSuccessfulOrder = useHandleSuccessfulOrder();

const { styles } = useStyles(styleSheet, {});
const { themeAppearance } = useTheme();
// Intentionally overrides the design-system BottomSheet background to match
// Transak's iframe, which we cannot style. Keeps the native chrome seamless
// with the embedded checkout flow. See colors.transak* in app/styles/common.ts.
const transakBgStyle = {
backgroundColor:
themeAppearance === AppThemeKey.dark
? colors.transakBackgroundDark
: colors.transakBackgroundLight,
};

const { url: uri, customOrderId, provider } = params;

Expand Down Expand Up @@ -252,6 +265,7 @@ const CheckoutWebView = () => {
isFullscreen
isInteractable={!Device.isAndroid()}
keyboardAvoidingViewEnabled={false}
style={transakBgStyle}
>
<BottomSheetHeader
endAccessory={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const createStyles = (
flex: options?.asScreen ? 1 : undefined,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: colors.background.default,
},
content: {
width: '100%',
Expand Down
5 changes: 5 additions & 0 deletions app/styles/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export const colors = {
gettingStartedPageBackgroundColor: '#EAC2FF',
gettingStartedTextColor: '#3D065F',
gettingStartedPageBackgroundColorLightMode: '#FFF2EB',
// Transak's iframe renders these background colors — values are set by Transak
// and outside our control. Used to match the BottomSheet surface so the
// checkout feels seamless. Update only if Transak changes their theme colors.
transakBackgroundDark: '#1a1a1a',
transakBackgroundLight: '#ffffff',
};

export const onboardingCarouselColors: Record<
Expand Down
Loading