From 23e00b62379f3b28037bac5d874537da79aef22d Mon Sep 17 00:00:00 2001 From: Beef Date: Mon, 13 Feb 2023 20:19:55 +0000 Subject: [PATCH] [UI > Components] Add Summary, reorganise --- src/ui/components/Summary.tsx | 32 ++++++++++++++++++++++++++++++++ src/ui/components/index.ts | 9 +++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/ui/components/Summary.tsx create mode 100644 src/ui/components/index.ts diff --git a/src/ui/components/Summary.tsx b/src/ui/components/Summary.tsx new file mode 100644 index 0000000..21a591a --- /dev/null +++ b/src/ui/components/Summary.tsx @@ -0,0 +1,32 @@ +import { getAssetIDByName } from "@ui/assets"; +import { ReactNative as RN } from "@metro/common"; +import { Forms } from "@ui/components"; + +// TODO: Animated would be awesome +// TODO: Destructuring Forms doesn't work here. Why? + +interface SummaryProps { + label: string; + icon?: string; + noPadding?: boolean; + children: JSX.Element | JSX.Element[]; +} + +export default function Summary({ label, icon, noPadding = false, children }: SummaryProps) { + const [hidden, setHidden] = React.useState(true); + + return ( + <> + } + trailing={} + onPress={() => setHidden(!hidden)} + /> + {!hidden && <> + + {children} + } + + ) +} \ No newline at end of file diff --git a/src/ui/components/index.ts b/src/ui/components/index.ts new file mode 100644 index 0000000..8eff4f1 --- /dev/null +++ b/src/ui/components/index.ts @@ -0,0 +1,9 @@ +import { findByDisplayName, findByProps } from "@metro/filters"; + +// Discord +export const Forms = findByProps("Form", "FormSection"); +export const General = findByProps("Button", "Text", "View"); +export const Search = findByDisplayName("StaticSearchBarContainer"); + +// Vendetta +export { default as Summary } from "@ui/components/Summary"; \ No newline at end of file