ChannelDeck working prototype
This commit is contained in:
commit
54fe9f17bf
13 changed files with 241 additions and 0 deletions
23
components/DeckPopout.tsx
Normal file
23
components/DeckPopout.tsx
Normal 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>;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue