@@ -4,11 +4,11 @@ import { DashboardRoutes } from '@masknet/shared-base'
44import { makeStyles } from '@masknet/theme'
55import { Box , Typography } from '@mui/material'
66import { memo } from 'react'
7- import { Outlet , useMatch , useNavigate , useOutletContext } from 'react-router-dom'
7+ import { Outlet , useNavigate , useOutletContext } from 'react-router-dom'
88import { CloudBackupFormContext } from './CloudBackupFormContext.js'
99import type { PortalContainerProps } from '../../../../components/OutletPortal.js'
1010
11- const useStyles = makeStyles < void , 'activeButton' > ( ) ( ( theme , _ , refs ) => ( {
11+ const useStyles = makeStyles ( ) ( ( theme ) => ( {
1212 container : {
1313 display : 'flex' ,
1414 flexDirection : 'column' ,
@@ -25,11 +25,7 @@ const useStyles = makeStyles<void, 'activeButton'>()((theme, _, refs) => ({
2525 height : 18 ,
2626 color : theme . palette . maskColor . main ,
2727 } ,
28- activeButton : {
29- backgroundColor : theme . palette . maskColor . input ,
30- } ,
3128 toggleButton : {
32- backgroundColor : theme . palette . maskColor . bottom ,
3329 cursor : 'pointer' ,
3430 boxSizing : 'border-box' ,
3531 borderRadius : 18 ,
@@ -38,35 +34,22 @@ const useStyles = makeStyles<void, 'activeButton'>()((theme, _, refs) => ({
3834 border : `1px solid ${ theme . palette . maskColor . line } ` ,
3935 display : 'inline-flex' ,
4036 padding : theme . spacing ( 1 , 1.5 ) ,
41- [ `&.${ refs . activeButton } ` ] : {
42- backgroundColor : theme . palette . maskColor . input ,
43- } ,
37+ backgroundColor : theme . palette . maskColor . input ,
4438 } ,
4539} ) )
4640
4741export const Component = memo ( function CloudBackup ( ) {
4842 const outletContext = useOutletContext < PortalContainerProps > ( )
49- const { classes, cx } = useStyles ( )
43+ const { classes } = useStyles ( )
5044
5145 const navigate = useNavigate ( )
52- const match = useMatch ( DashboardRoutes . BackupCloudGoogleDrive ) // MaskBook is index
53- const isGoogleDrive = ! ! match
5446
5547 return (
5648 < Box className = { classes . container } >
5749 < Box className = { classes . providers } >
5850 < button
5951 type = "button"
60- className = { cx ( classes . toggleButton , isGoogleDrive ? null : classes . activeButton ) }
61- onClick = { ( ) => navigate ( DashboardRoutes . BackupCloudMaskNetwork , { replace : true } ) } >
62- < Icons . MaskBlue size = { 18 } />
63- < Typography className = { classes . providerName } >
64- < Trans > Mask Network</ Trans >
65- </ Typography >
66- </ button >
67- < button
68- type = "button"
69- className = { cx ( classes . toggleButton , isGoogleDrive ? classes . activeButton : null ) }
52+ className = { classes . toggleButton }
7053 onClick = { ( ) => navigate ( DashboardRoutes . BackupCloudGoogleDrive , { replace : true } ) } >
7154 < Icons . GoogleDrive size = { 18 } />
7255 < Typography className = { classes . providerName } >
0 commit comments