[UI > Components] Add Discord's SafeAreaView
This commit is contained in:
parent
5344f0017a
commit
4d68c112bc
3 changed files with 6 additions and 4 deletions
3
src/def.d.ts
vendored
3
src/def.d.ts
vendored
|
@ -415,7 +415,8 @@ interface VendettaObject {
|
|||
Search: _React.ComponentType;
|
||||
Alert: _React.ComponentType;
|
||||
Button: _React.ComponentType<any> & { Looks: any, Colors: ButtonColors, Sizes: any };
|
||||
HelpMessage: _React.ComponentType;
|
||||
HelpMessage: _React.ComponentType;
|
||||
SafeAreaView: typeof _RN.SafeAreaView;
|
||||
// Vendetta
|
||||
Summary: _React.ComponentType<SummaryProps>;
|
||||
ErrorBoundary: _React.ComponentType<ErrorBoundaryProps>;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { ReactNative as RN } from "@metro/common";
|
||||
import { findByName, findByProps } from "@metro/filters";
|
||||
|
||||
// Discord
|
||||
|
@ -7,6 +8,8 @@ export const Search = findByName("StaticSearchBarContainer");
|
|||
export const Alert = findByProps("alertDarkStyles", "alertLightStyles").default;
|
||||
export const Button = findByProps("Looks", "Colors", "Sizes") as React.ComponentType<any> & { Looks: any, Colors: any, Sizes: any };
|
||||
export const HelpMessage = findByName("HelpMessage");
|
||||
// React Native's included SafeAreaView only adds padding on iOS.
|
||||
export const SafeAreaView = findByProps("useSafeAreaInsets").SafeAreaView as typeof RN.SafeAreaView;
|
||||
|
||||
// Vendetta
|
||||
export { default as Summary } from "@ui/components/Summary";
|
||||
|
|
|
@ -5,13 +5,11 @@ import { after } from "@lib/patcher";
|
|||
import { DeviceManager } from "@lib/native";
|
||||
import { toggleSafeMode } from "@lib/debug";
|
||||
import { semanticColors } from "@ui/color";
|
||||
import { Button, Codeblock, ErrorBoundary as _ErrorBoundary } from "@ui/components";
|
||||
import { Button, Codeblock, ErrorBoundary as _ErrorBoundary, SafeAreaView } from "@ui/components";
|
||||
import settings from "@lib/settings";
|
||||
|
||||
const ErrorBoundary = findByName("ErrorBoundary");
|
||||
|
||||
// React Native's included SafeAreaView only adds padding on iOS.
|
||||
const { SafeAreaView } = findByProps("useSafeAreaInsets");
|
||||
// Let's just pray they have this.
|
||||
const { BadgableTabBar } = findByProps("BadgableTabBar");
|
||||
|
||||
|
|
Loading…
Reference in a new issue