Skip to content

Commit

Permalink
fix: remove setting option from confirm swap page
Browse files Browse the repository at this point in the history
  • Loading branch information
RanGojo committed Apr 20, 2024
1 parent fe86100 commit 1f204c1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function QuoteWarningsAndErrors(props: PropTypes) {
const {
warning,
error,
couldChangeSettings,
showWarningModal,
confirmationDisabled,
refetchQuote,
Expand Down Expand Up @@ -44,6 +45,9 @@ export function QuoteWarningsAndErrors(props: PropTypes) {
? error
: null
);
if (alertInfo && !couldChangeSettings) {
alertInfo.action = null;
}

const showAlerts = !!alertInfo;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface PropTypes {
warning: QuoteWarning | null;
showWarningModal: boolean;
confirmationDisabled: boolean;
couldChangeSettings: boolean;
refetchQuote: () => void;
onOpenWarningModal: () => void;
onCloseWarningModal: () => void;
Expand Down
18 changes: 1 addition & 17 deletions widget/embedded/src/pages/ConfirmSwapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import {
css,
Divider,
IconButton,
SettingsIcon,
styled,
Tooltip,
Typography,
WalletIcon,
} from '@rango-dev/ui';
Expand All @@ -24,7 +22,6 @@ import { useLocation, useNavigate } from 'react-router-dom';

import { getRequiredWallets } from '../components/ConfirmWalletsModal/ConfirmWallets.helpers';
import { ConfirmWalletsModal } from '../components/ConfirmWalletsModal/ConfirmWalletsModal';
import { HeaderButton } from '../components/HeaderButtons/HeaderButtons.styles';
import { RefreshButton } from '../components/HeaderButtons/RefreshButton';
import { Layout, PageContainer } from '../components/Layout';
import { QuoteWarningsAndErrors } from '../components/QuoteWarningsAndErrors';
Expand All @@ -37,7 +34,6 @@ import { useQuoteStore } from '../store/quote';
import { useUiStore } from '../store/ui';
import { useWalletsStore } from '../store/wallets';
import { QuoteWarningType } from '../types';
import { getContainer } from '../utils/common';
import { joinList } from '../utils/ui';

const Buttons = styled('div', {
Expand Down Expand Up @@ -285,6 +281,7 @@ export function ConfirmSwapPage() {
<QuoteWarningsAndErrors
warning={quoteWarning}
error={quoteError}
couldChangeSettings={false}
refetchQuote={onRefresh}
showWarningModal={showQuoteWarningModal}
confirmationDisabled={!isActiveTab}
Expand All @@ -307,19 +304,6 @@ export function ConfirmSwapPage() {
const wallets_url = `../${navigationRoutes.wallets}`;
navigate(wallets_url);
},
suffix: (
<Tooltip
container={getContainer()}
side="bottom"
content={i18n.t('Settings')}>
<HeaderButton
size="small"
variant="ghost"
onClick={() => navigate('../' + navigationRoutes.settings)}>
<SettingsIcon size={18} color="black" />
</HeaderButton>
</Tooltip>
),
}}
footer={
<Buttons>
Expand Down
1 change: 1 addition & 0 deletions widget/embedded/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export function Home() {
<QuoteWarningsAndErrors
warning={quoteWarning}
error={quoteError}
couldChangeSettings={true}
refetchQuote={fetchQuote}
showWarningModal={showQuoteWarningModal}
confirmationDisabled={!isActiveTab}
Expand Down

0 comments on commit 1f204c1

Please sign in to comment.