Commit 6a02bde8 authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by GitHub

fix: darkmode FoR iframe wrapper background color (#5993)

* fix: darkmode FoR iframe wrapper background color

* pr feedback
parent c1852215
...@@ -10,8 +10,10 @@ import { CustomLightSpinner, ThemedText } from 'theme' ...@@ -10,8 +10,10 @@ import { CustomLightSpinner, ThemedText } from 'theme'
import Circle from '../../assets/images/blue-loader.svg' import Circle from '../../assets/images/blue-loader.svg'
import Modal from '../Modal' import Modal from '../Modal'
const Wrapper = styled.div` const MOONPAY_DARK_BACKGROUND = '#1c1c1e'
background-color: ${({ theme }) => theme.white}; const Wrapper = styled.div<{ isDarkMode: boolean }>`
// #1c1c1e is the background color for the darkmode moonpay iframe as of 2/16/2023
background-color: ${({ isDarkMode, theme }) => (isDarkMode ? MOONPAY_DARK_BACKGROUND : theme.white)};
border-radius: 20px; border-radius: 20px;
box-shadow: ${({ theme }) => theme.deepShadow}; box-shadow: ${({ theme }) => theme.deepShadow};
display: flex; display: flex;
...@@ -29,8 +31,9 @@ const ErrorText = styled(ThemedText.BodyPrimary)` ...@@ -29,8 +31,9 @@ const ErrorText = styled(ThemedText.BodyPrimary)`
text-align: center; text-align: center;
width: 90%; width: 90%;
` `
const StyledIframe = styled.iframe` const StyledIframe = styled.iframe<{ isDarkMode: boolean }>`
background-color: ${({ theme }) => theme.white}; // #1c1c1e is the background color for the darkmode moonpay iframe as of 2/16/2023
background-color: ${({ isDarkMode, theme }) => (isDarkMode ? MOONPAY_DARK_BACKGROUND : theme.white)};
border-radius: 12px; border-radius: 12px;
bottom: 0; bottom: 0;
left: 0; left: 0;
...@@ -123,7 +126,7 @@ export default function FiatOnrampModal() { ...@@ -123,7 +126,7 @@ export default function FiatOnrampModal() {
return ( return (
<Modal isOpen={fiatOnrampModalOpen} onDismiss={closeModal} maxHeight={720}> <Modal isOpen={fiatOnrampModalOpen} onDismiss={closeModal} maxHeight={720}>
<Wrapper data-testid="fiat-onramp-modal"> <Wrapper data-testid="fiat-onramp-modal" isDarkMode={isDarkMode}>
{error ? ( {error ? (
<> <>
<ThemedText.MediumHeader> <ThemedText.MediumHeader>
...@@ -138,7 +141,12 @@ export default function FiatOnrampModal() { ...@@ -138,7 +141,12 @@ export default function FiatOnrampModal() {
) : loading ? ( ) : loading ? (
<StyledSpinner src={Circle} alt="loading spinner" size="90px" /> <StyledSpinner src={Circle} alt="loading spinner" size="90px" />
) : ( ) : (
<StyledIframe src={signedIframeUrl ?? ''} frameBorder="0" title="fiat-onramp-iframe" /> <StyledIframe
src={signedIframeUrl ?? ''}
frameBorder="0"
title="fiat-onramp-iframe"
isDarkMode={isDarkMode}
/>
)} )}
</Wrapper> </Wrapper>
</Modal> </Modal>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment