From 4d30efc33b5398b91e756695fefa91cc37f83ff1 Mon Sep 17 00:00:00 2001 From: AAGaming Date: Wed, 8 Jun 2022 21:40:19 -0400 Subject: [PATCH] feat(components): add HorizontalFocus --- src/deck-components/Focusable.tsx | 15 +++++++++++++++ src/deck-components/index.ts | 1 + 2 files changed, 16 insertions(+) create mode 100644 src/deck-components/Focusable.tsx diff --git a/src/deck-components/Focusable.tsx b/src/deck-components/Focusable.tsx new file mode 100644 index 0000000..01ffeb8 --- /dev/null +++ b/src/deck-components/Focusable.tsx @@ -0,0 +1,15 @@ +import { ReactNode, VFC } from "react"; +import { findModuleChild } from "../webpack"; + +export interface FocusableProps { + children: ReactNode; +} + +export const HorizontalFocus = findModuleChild(m => { + if (typeof m !== "object") return undefined; + for (let prop in m) { + if (m[prop]?.toString()?.includes('"children","alignItems","spacing"')) { + return m[prop]; + } + } +}) as VFC; \ No newline at end of file diff --git a/src/deck-components/index.ts b/src/deck-components/index.ts index db2b1ca..a96c044 100755 --- a/src/deck-components/index.ts +++ b/src/deck-components/index.ts @@ -1,6 +1,7 @@ export * from './Button'; export * from './ButtonItem'; export * from './Dropdown'; +export * from './Focusable'; export * from './Menu'; export * from './Modal'; export * from './Panel';