Skip to content

Commit 241972b

Browse files
committed
refactor: refine sidebar feature exports
1 parent b3d5f63 commit 241972b

3 files changed

Lines changed: 5 additions & 12 deletions

File tree

entrypoints/rednote.content/features.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import type { ContentScriptContext } from 'wxt/utils/content-script-context'
22
import { initRouter, onRouteChange } from './router'
3-
import {
4-
hideFeed,
5-
hideNotificationBadge,
6-
hideSearchSuggestions,
7-
hideSidebarButton,
8-
slashFocus,
9-
} from './impl'
3+
import { hideFeed, hideSearchSuggestions, sidebarFeatures, slashFocus } from './impl'
104

115
interface FeatureContext {
126
key: FeatureKey
@@ -24,9 +18,8 @@ export interface FeatureRegistration<T extends FeatureKey> {
2418
const featureRegistrations = [
2519
hideFeed,
2620
hideSearchSuggestions,
27-
hideNotificationBadge,
2821
slashFocus,
29-
...hideSidebarButton,
22+
...sidebarFeatures,
3023
] as const
3124

3225
const createFeatureContext = (ctx: ContentScriptContext, key: FeatureKey): FeatureContext => {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export * from './hideFeed'
22
export * from './hideSearchSuggestions'
33
export * from './slashFocus'
4-
export * from './hideSidebarButton'
4+
export * from './sidebarFeatures'

entrypoints/rednote.content/impl/hideSidebarButton.ts renamed to entrypoints/rednote.content/impl/sidebarFeatures.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ const hideNotificationButton = defineRootClassFeature(
1414
'RS_hide-sidebar-nav-notification',
1515
)
1616

17-
export const hideNotificationBadge = defineRootClassFeature(
17+
const hideNotificationBadge = defineRootClassFeature(
1818
'hideNotificationBadge',
1919
'RS_hide-notification-badge',
2020
)
2121

2222
const hideRedVideo = defineRootClassFeature('hideRedVideo', 'RS_hide-sidebar-nav-red-video')
2323

24-
export const hideSidebarButton = [
24+
export const sidebarFeatures = [
2525
hideLivelistButton,
2626
hideAIChat,
2727
hidePublishButton,

0 commit comments

Comments
 (0)