Skip to content

Commit

Permalink
dirty mobile hack
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminaAiren committed Dec 8, 2023
1 parent cf9d544 commit 35482b2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ui/snippets/header/RampButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { RampInstantSDK } from '@ramp-network/ramp-instant-sdk';
import React from 'react';

import config from 'configs/app';
import useIsMobile from 'lib/hooks/useIsMobile';

const feature = config.features.ramp;

const RampButton = () => {
const isMobile = useIsMobile();
const openRamp = React.useCallback(() => {
if (!feature.isEnabled) {
return;
Expand All @@ -17,10 +19,17 @@ const RampButton = () => {
hostLogoUrl: config.UI.sidebar.icon.default ? config.app.baseUrl + config.UI.sidebar.icon.default : '',
hostApiKey: feature.hostApiKey,
defaultAsset: feature.defaultAsset,
variant: isMobile ? 'mobile' : 'desktop',
// remove after demo
url: 'https://app.demo.ramp.network',
}).show();
}, []);

const rampOverlay = document.querySelector('body > div:last-of-type')?.shadowRoot?.children[1] as HTMLDivElement;
if (rampOverlay) {
rampOverlay.style.zIndex = '10000';
}

}, [ isMobile ]);

if (!feature.isEnabled) {
return null;
Expand Down

0 comments on commit 35482b2

Please sign in to comment.