Skip to content

Commit

Permalink
fix: mf-5284
Browse files Browse the repository at this point in the history
  • Loading branch information
beyond009 committed Sep 20, 2023
1 parent 4a955bb commit b5ccadc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export function CalendarContent() {
setSelectedDate={(date: Date) => setSelectedDate(date)}
list={list}
/>

<TabPanel value={tabs.news} style={{ padding: 0 }}>
<NewsList
list={newsList}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { makeStyles } from '@masknet/theme'
import { Icons } from '@masknet/icons'
import { Typography, IconButton } from '@mui/material'
import { useI18N } from '../../locales/i18n_generated.js'
import { useOpenApplicationSettings } from '@masknet/shared'
import { useOpenApplicationSettings, ApplicationSettingTabs } from '@masknet/shared'
import { PluginID } from '@masknet/shared-base'

const useStyles = makeStyles()((theme) => ({
container: {
Expand Down Expand Up @@ -96,7 +97,11 @@ export function Footer({ provider }: FooterProps) {
<div className={classes.poweredByWrap}>
<Typography className={classes.poweredBy}>{t.powered_by()}</Typography>
{providerMap[provider]}
<IconButton sx={{ width: '16px', height: '16px' }} onClick={() => openApplicationBoardDialog()}>
<IconButton
sx={{ width: '16px', height: '16px' }}
onClick={() =>
openApplicationBoardDialog(ApplicationSettingTabs.pluginSwitch, PluginID.Calendar)
}>
<Icons.Gear size={16} />
</IconButton>
</div>
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/src/UI/modals/modals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ export const SelectFungibleTokenModal = new SingletonModal<
export const PersonaSelectPanelModal = new SingletonModal<PersonaSelectPanelModalOpenProps>()

export const ShareSelectNetworkModal = new SingletonModal<ShareSelectNetworkModalOpenProps>()

export { ApplicationSettingTabs } from './ApplicationBoardModal/ApplicationBoardDialog.js'
4 changes: 3 additions & 1 deletion packages/shared/src/hooks/useOpenApplicationSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ import { useSiteAdaptorContext } from '@masknet/plugin-infra/dom'
import { ApplicationBoardSettingsModal } from '../index.js'
import { useCallback } from 'react'
import type { ApplicationSettingTabs } from '../UI/modals/ApplicationBoardModal/ApplicationBoardDialog.js'
import type { PluginID } from '@masknet/shared-base'

export function useOpenApplicationSettings() {
const { setPluginMinimalModeEnabled, getDecentralizedSearchSettings, setDecentralizedSearchSettings } =
useSiteAdaptorContext()

return useCallback(
(tab?: ApplicationSettingTabs) => {
(tab?: ApplicationSettingTabs, focusPluginID?: PluginID) => {
ApplicationBoardSettingsModal.open({
setPluginMinimalModeEnabled,
getDecentralizedSearchSettings,
setDecentralizedSearchSettings,
tab,
focusPluginID,
})
},
[setPluginMinimalModeEnabled, getDecentralizedSearchSettings, setDecentralizedSearchSettings],
Expand Down

0 comments on commit b5ccadc

Please sign in to comment.