1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
metamask-extension/ui/pages/onboarding-flow/privacy-settings/setting.js
David Walsh 43c278d813
Privacy - Show default selected network after a custom network has been added during onboarding (#16789)
* Privacy - Allow users to set a custom RPC from the onboarding process (#16767)

* Privacy - Allow adding custom IPFS from onboarding (#16782)

* Privacy - Show default selected network after a custom network has been added during onboarding

* WIP: Show dropdown list of networks

* Add network switcher to the onboarding advanced privacy screen

* Fix duplicate imports

* Provide default for networks

* Update ui/helpers/utils/ipfs.js

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>

* Fix lint

* Remove unwanted changes

* Fix lint

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2022-12-08 10:42:23 -06:00

43 lines
1.2 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import Box from '../../../components/ui/box';
import Typography from '../../../components/ui/typography';
import ToggleButton from '../../../components/ui/toggle-button';
import {
JUSTIFY_CONTENT,
TYPOGRAPHY,
FONT_WEIGHT,
} from '../../../helpers/constants/design-system';
export const Setting = ({
value,
setValue,
title,
description,
showToggle = true,
}) => {
return (
<Box justifyContent={JUSTIFY_CONTENT.CENTER} margin={3}>
<div className="privacy-settings__setting">
<Typography variant={TYPOGRAPHY.H5} fontWeight={FONT_WEIGHT.BOLD}>
{title}
</Typography>
<Typography variant={TYPOGRAPHY.H6}>{description}</Typography>
</div>
{showToggle ? (
<div className="privacy-settings__setting__toggle">
<ToggleButton value={value} onToggle={(val) => setValue(!val)} />
</div>
) : null}
</Box>
);
};
Setting.propTypes = {
value: PropTypes.bool,
setValue: PropTypes.func,
title: PropTypes.string,
description: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
showToggle: PropTypes.bool,
};