Commit 689100af authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by GitHub

feat: support moonpay iframe theme (#5986)

* feat: support moonpay iframe theme

* move theme param to body
parent d546ffec
......@@ -3,6 +3,7 @@ import { useWeb3React } from '@web3-react/core'
import { useCallback, useEffect, useState } from 'react'
import { useCloseModal, useModalIsOpen } from 'state/application/hooks'
import { ApplicationModal } from 'state/application/reducer'
import { useIsDarkMode } from 'state/user/hooks'
import styled, { useTheme } from 'styled-components/macro'
import { CustomLightSpinner, ThemedText } from 'theme'
......@@ -67,6 +68,7 @@ const MOONPAY_SUPPORTED_CURRENCY_CODES = [
export default function FiatOnrampModal() {
const { account } = useWeb3React()
const theme = useTheme()
const isDarkMode = useIsDarkMode()
const closeModal = useCloseModal()
const fiatOnrampModalOpen = useModalIsOpen(ApplicationModal.FIAT_ONRAMP)
......@@ -90,6 +92,7 @@ export default function FiatOnrampModal() {
},
method: 'POST',
body: JSON.stringify({
theme: isDarkMode ? 'dark' : 'light',
colorCode: theme.accentAction,
defaultCurrencyCode: 'eth',
redirectUrl: 'https://app.uniswap.org/#/swap',
......@@ -112,7 +115,7 @@ export default function FiatOnrampModal() {
} finally {
setLoading(false)
}
}, [account, theme.accentAction])
}, [account, isDarkMode, theme.accentAction])
useEffect(() => {
fetchSignedIframeUrl()
......
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