|
1 | 1 | import { Dispatch, FC, SetStateAction, useEffect, useState } from 'react' |
2 | 2 | import { toast } from 'react-toastify' |
3 | 3 | import { KeyedMutator } from 'swr' |
| 4 | +import { noop } from 'lodash' |
4 | 5 |
|
5 | | -import { Button, Collapsible, FormToggleSwitch, IconOutline, Tooltip } from '~/libs/ui' |
| 6 | +import { Button, Collapsible, FormToggleSwitch, IconSolid, Tooltip } from '~/libs/ui' |
6 | 7 | import { diceIdLogo, MFAImage, SettingSection } from '~/apps/accounts/src/lib' |
7 | 8 | import { MemberMFAStatus, updateMemberMFAStatusAsync, useMemberMFAStatus, UserProfile } from '~/libs/core' |
8 | 9 |
|
@@ -83,20 +84,31 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => { |
83 | 84 | infoText='DICE ID authentication application.' |
84 | 85 | actionElement={( |
85 | 86 | <div className={styles.diceBtnWrap}> |
86 | | - <Button |
87 | | - label='Setup DICE ID Authentication' |
88 | | - secondary |
89 | | - size='lg' |
90 | | - className={styles.diceIdButton} |
91 | | - onClick={handleDiceModalStatus} |
92 | | - disabled={!mfaEnabled || mfaStatusData?.diceEnabled} |
93 | | - /> |
| 87 | + { |
| 88 | + !mfaStatusData?.diceEnabled ? ( |
| 89 | + <FormToggleSwitch |
| 90 | + name='diceEnabled' |
| 91 | + onChange={noop} |
| 92 | + value={mfaStatusData?.diceEnabled as boolean} |
| 93 | + disabled={mfaStatusData?.diceEnabled} |
| 94 | + /> |
| 95 | + ) : ( |
| 96 | + <Button |
| 97 | + label='Setup DICE ID Authentication' |
| 98 | + secondary |
| 99 | + size='lg' |
| 100 | + className={styles.diceIdButton} |
| 101 | + onClick={handleDiceModalStatus} |
| 102 | + disabled={!mfaEnabled} |
| 103 | + /> |
| 104 | + ) |
| 105 | + } |
94 | 106 | { |
95 | 107 | mfaStatusData?.diceEnabled && ( |
96 | 108 | <Tooltip |
97 | 109 | content='Please reach out to [email protected] for deactivating Dice ID.' |
98 | 110 | > |
99 | | - <IconOutline.InformationCircleIcon /> |
| 111 | + <IconSolid.InformationCircleIcon /> |
100 | 112 | </Tooltip> |
101 | 113 | ) |
102 | 114 | } |
|
0 commit comments