1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 15:50:28 +01:00
metamask-extension/ui/components/app/gas-details-item/gas-details-item-title/gas-details-item-title.js

50 lines
1.6 KiB
JavaScript
Raw Normal View History

2021-12-12 00:26:28 +01:00
import React from 'react';
import { useSelector } from 'react-redux';
2023-05-15 19:56:20 +02:00
import { TextVariant } from '../../../../helpers/constants/design-system';
2021-12-12 00:26:28 +01:00
import { useI18nContext } from '../../../../hooks/useI18nContext';
import { getIsMainnet } from '../../../../selectors';
import Box from '../../../ui/box';
import InfoTooltip from '../../../ui/info-tooltip/info-tooltip';
2023-05-15 19:56:20 +02:00
import { Text } from '../../../component-library';
2021-12-12 00:26:28 +01:00
const GasDetailsItemTitle = () => {
const t = useI18nContext();
const isMainnet = useSelector(getIsMainnet);
return (
<Box display="flex">
<Box marginRight={1}>{t('gas')}</Box>
2021-12-12 00:26:28 +01:00
<span className="gas-details-item-title__estimate">
({t('transactionDetailGasInfoV2')})
2021-12-12 00:26:28 +01:00
</span>
<InfoTooltip
contentText={
<>
2023-05-15 19:56:20 +02:00
<Text variant={TextVariant.bodySm} as="h6">
2021-12-12 00:26:28 +01:00
{t('transactionDetailGasTooltipIntro', [
isMainnet ? t('networkNameEthereum') : '',
])}
2023-05-15 19:56:20 +02:00
</Text>
<Text variant={TextVariant.bodySm} as="h6">
2021-12-12 00:26:28 +01:00
{t('transactionDetailGasTooltipExplanation')}
2023-05-15 19:56:20 +02:00
</Text>
<Text variant={TextVariant.bodySm} as="h6">
2021-12-12 00:26:28 +01:00
<a
href="https://community.metamask.io/t/what-is-gas-why-do-transactions-take-so-long/3172"
target="_blank"
rel="noopener noreferrer"
>
{t('transactionDetailGasTooltipConversion')}
</a>
2023-05-15 19:56:20 +02:00
</Text>
2021-12-12 00:26:28 +01:00
</>
}
position="bottom"
/>
</Box>
);
};
export default GasDetailsItemTitle;