1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 06:07:06 +01:00
metamask-extension/ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-popover.js

40 lines
1.2 KiB
JavaScript

import React from 'react';
import { useI18nContext } from '../../../hooks/useI18nContext';
import { useTransactionModalContext } from '../../../contexts/transaction-modal';
import Box from '../../ui/box';
import Popover from '../../ui/popover';
import { AdvanceGasFeePopoverContextProvider } from './context';
import AdvancedGasFeeInputs from './advanced-gas-fee-inputs';
import AdvancedGasFeeSaveButton from './advanced-gas-fee-save';
const AdvancedGasFeePopover = () => {
const t = useI18nContext();
const {
closeModal,
closeAllModals,
currentModal,
} = useTransactionModalContext();
if (currentModal !== 'advancedGasFee') return null;
return (
<AdvanceGasFeePopoverContextProvider>
<Popover
className="advanced-gas-fee-popover"
title={t('advancedGasFeeModalTitle')}
onBack={() => closeModal('advancedGasFee')}
onClose={closeAllModals}
footer={<AdvancedGasFeeSaveButton />}
>
<Box className="advanced-gas-fee-popover__wrapper">
<AdvancedGasFeeInputs />
</Box>
</Popover>
</AdvanceGasFeePopoverContextProvider>
);
};
export default AdvancedGasFeePopover;