mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
Revert "Revert "Disable Ledger Live toggle for Firefox users (#11169)""
This reverts commit 6e0da428ac
.
This commit is contained in:
parent
e3ed26cc24
commit
c68a858688
@ -33,4 +33,8 @@
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
&--disabled {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
@ -47,15 +47,19 @@ const colors = {
|
||||
};
|
||||
|
||||
const ToggleButton = (props) => {
|
||||
const { value, onToggle, offLabel, onLabel } = props;
|
||||
const { value, onToggle, offLabel, onLabel, disabled } = props;
|
||||
|
||||
const modifier = value ? 'on' : 'off';
|
||||
|
||||
return (
|
||||
<div className={classnames('toggle-button', `toggle-button--${modifier}`)}>
|
||||
<div
|
||||
className={classnames('toggle-button', `toggle-button--${modifier}`, {
|
||||
'toggle-button--disabled': disabled,
|
||||
})}
|
||||
>
|
||||
<ReactToggleButton
|
||||
value={value}
|
||||
onToggle={onToggle}
|
||||
onToggle={disabled ? undefined : onToggle}
|
||||
activeLabel=""
|
||||
inactiveLabel=""
|
||||
trackStyle={value ? trackStyle : offTrackStyle}
|
||||
@ -76,6 +80,7 @@ ToggleButton.propTypes = {
|
||||
onToggle: PropTypes.func,
|
||||
offLabel: PropTypes.string,
|
||||
onLabel: PropTypes.string,
|
||||
disabled: PropTypes.bool,
|
||||
};
|
||||
|
||||
export default ToggleButton;
|
||||
|
@ -7,6 +7,9 @@ import TextField from '../../../components/ui/text-field';
|
||||
import Button from '../../../components/ui/button';
|
||||
import { MOBILE_SYNC_ROUTE } from '../../../helpers/constants/routes';
|
||||
|
||||
import { getPlatform } from '../../../../app/scripts/lib/util';
|
||||
import { PLATFORM_FIREFOX } from '../../../../shared/constants/app';
|
||||
|
||||
export default class AdvancedTab extends PureComponent {
|
||||
static contextTypes = {
|
||||
t: PropTypes.func,
|
||||
@ -405,6 +408,7 @@ export default class AdvancedTab extends PureComponent {
|
||||
onToggle={(value) => setLedgerLivePreference(!value)}
|
||||
offLabel={t('off')}
|
||||
onLabel={t('on')}
|
||||
disabled={getPlatform() === PLATFORM_FIREFOX}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user