ChannelDeck working prototype

This commit is contained in:
Sqaaakoi 2025-02-26 03:11:08 +13:00
commit 54fe9f17bf
No known key found for this signature in database
13 changed files with 241 additions and 0 deletions

23
components/DeckPopout.tsx Normal file
View file

@ -0,0 +1,23 @@
import { findComponentByCodeLazy } from "@webpack";
import { useStateFromStores } from "@webpack/common";
import { ChannelDeckStore } from "../ChannelDeckStore";
import DeckView from "./DeckView";
import { DeckContext } from "./util";
const PopoutWindow = findComponentByCodeLazy("Missing guestWindow reference");
export default function DeckPopout({ deckId, windowKey }: { deckId: string; windowKey?: string; }) {
// Copy from an unexported function of the one they use in the experiment
// right click a channel and search withTitleBar:!0,windowKey
const deck = useStateFromStores([ChannelDeckStore], () => ChannelDeckStore.getDeck(deckId));
return <PopoutWindow
withTitleBar
windowKey={windowKey}
title={deck?.name}
>
<DeckContext.Provider value={deck}>
<DeckView />
</DeckContext.Provider>
</PopoutWindow>;
};