-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Calendar): mf-6373 new events list (#11934)
* fix: hooks * feat(Calendar): mf-6373 new events list * fix: mf-6147 adjust calendar tab header for dark mode * fixup! feat(Calendar): mf-6373 new events list * fix: prettier --------- Co-authored-by: swkatmask <swkatmask@users.noreply.github.com>
- Loading branch information
Showing
21 changed files
with
518 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { useIsMinimalMode } from '@masknet/plugin-infra/content-script' | ||
import { PluginID } from '@masknet/shared-base' | ||
import { useLocationChange } from '@masknet/shared-base-ui' | ||
import { useState } from 'react' | ||
import { CalendarContent } from './CalendarContent.js' | ||
|
||
interface Props { | ||
target?: '/explore' | '/search' | ||
} | ||
|
||
export function Calendar({ target }: Props) { | ||
const [pathname, setPathname] = useState(location.pathname) | ||
const isMinimalMode = useIsMinimalMode(PluginID.Calendar) | ||
|
||
useLocationChange(() => { | ||
setPathname(location.pathname) | ||
}) | ||
if (isMinimalMode || (target && !pathname.includes(target))) return null | ||
|
||
return <CalendarContent style={{ marginTop: pathname.includes('explore') ? 24 : 0 }} /> | ||
} |
116 changes: 48 additions & 68 deletions
116
packages/plugins/Calendar/src/SiteAdaptor/CalendarContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.