diff options
Diffstat (limited to 'apps/web/src/components/editor/panels/assets')
| -rw-r--r-- | apps/web/src/components/editor/panels/assets/index.tsx | 7 | ||||
| -rw-r--r-- | apps/web/src/components/editor/panels/assets/tabbar.tsx | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/apps/web/src/components/editor/panels/assets/index.tsx b/apps/web/src/components/editor/panels/assets/index.tsx index bae73299..09d64eed 100644 --- a/apps/web/src/components/editor/panels/assets/index.tsx +++ b/apps/web/src/components/editor/panels/assets/index.tsx @@ -10,16 +10,17 @@ import { SoundsView } from "@/sounds/components/assets-view"; import { StickersView } from "@/stickers/components/assets-view"; import { TextView } from "@/text/components/assets-view"; import { EffectsView } from "@/effects/components/assets-view"; +import { FEATURES } from "@/features"; export function AssetsPanel() { const { activeTab } = useAssetsPanelStore(); const viewMap: Record<Tab, React.ReactNode> = { media: <MediaView />, - sounds: <SoundsView />, + sounds: FEATURES.sounds ? <SoundsView /> : null, text: <TextView />, - stickers: <StickersView />, - effects: <EffectsView />, + stickers: FEATURES.stickers ? <StickersView /> : null, + effects: FEATURES.effects ? <EffectsView /> : null, transitions: ( <div className="text-muted-foreground p-4"> Transitions view coming soon... diff --git a/apps/web/src/components/editor/panels/assets/tabbar.tsx b/apps/web/src/components/editor/panels/assets/tabbar.tsx index 3b084c0d..b468b5bb 100644 --- a/apps/web/src/components/editor/panels/assets/tabbar.tsx +++ b/apps/web/src/components/editor/panels/assets/tabbar.tsx @@ -13,6 +13,14 @@ import { tabs,
useAssetsPanelStore,
} from "@/components/editor/panels/assets/assets-panel-store";
+import { FEATURES } from "@/features";
+
+const VISIBLE_TAB_KEYS = TAB_KEYS.filter((tabKey) => {
+ if (tabKey === "sounds") return FEATURES.sounds;
+ if (tabKey === "stickers") return FEATURES.stickers;
+ if (tabKey === "effects") return FEATURES.effects;
+ return true;
+});
export function TabBar() {
const { activeTab, setActiveTab } = useAssetsPanelStore();
@@ -51,7 +59,7 @@ export function TabBar() { ref={scrollRef}
className="scrollbar-hidden relative flex size-full p-1 flex-col items-center justify-start gap-0.5 overflow-y-auto"
>
- {TAB_KEYS.map((tabKey) => {
+ {VISIBLE_TAB_KEYS.map((tabKey) => {
const tab = tabs[tabKey];
return (
<Tooltip key={tabKey} delayDuration={10}>
|
