[UI] Move color variables
This commit is contained in:
parent
3f3bfcb78c
commit
d6a8dd6710
4 changed files with 11 additions and 11 deletions
8
src/def.d.ts
vendored
8
src/def.d.ts
vendored
|
@ -340,11 +340,9 @@ interface VendettaObject {
|
||||||
getAssetByID: (id: number) => Asset;
|
getAssetByID: (id: number) => Asset;
|
||||||
getAssetIDByName: (name: string) => number;
|
getAssetIDByName: (name: string) => number;
|
||||||
};
|
};
|
||||||
color: {
|
// TODO: Make a vain attempt to type these
|
||||||
// TODO: Make a vain attempt to type these
|
semanticColors: Indexable<any>;
|
||||||
map: Indexable<any>;
|
rawColors: Indexable<any>;
|
||||||
raw: Indexable<any>;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
plugins: {
|
plugins: {
|
||||||
plugins: Indexable<Plugin>;
|
plugins: Indexable<Plugin>;
|
||||||
|
|
|
@ -12,6 +12,7 @@ import * as common from "@metro/common";
|
||||||
import * as components from "@ui/components";
|
import * as components from "@ui/components";
|
||||||
import * as toasts from "@ui/toasts";
|
import * as toasts from "@ui/toasts";
|
||||||
import * as assets from "@ui/assets";
|
import * as assets from "@ui/assets";
|
||||||
|
import * as color from "@ui/color";
|
||||||
import * as utils from "@utils";
|
import * as utils from "@utils";
|
||||||
|
|
||||||
function without<T extends Record<string, any>>(object: T, ...keys: string[]) {
|
function without<T extends Record<string, any>>(object: T, ...keys: string[]) {
|
||||||
|
@ -32,6 +33,7 @@ export default async function windowObject(unloads: any[]): Promise<VendettaObje
|
||||||
components,
|
components,
|
||||||
toasts,
|
toasts,
|
||||||
assets,
|
assets,
|
||||||
|
...color,
|
||||||
},
|
},
|
||||||
plugins: without(plugins, "initPlugins"),
|
plugins: without(plugins, "initPlugins"),
|
||||||
commands: without(commands, "patchCommands"),
|
commands: without(commands, "patchCommands"),
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { constants } from "@metro/hoist";
|
||||||
const colorModule = findByProps("SemanticColorsByThemeTable");
|
const colorModule = findByProps("SemanticColorsByThemeTable");
|
||||||
|
|
||||||
//? SemanticColor is effectively ThemeColorMap
|
//? SemanticColor is effectively ThemeColorMap
|
||||||
export const map = (colorModule?.SemanticColor ?? constants.ThemeColorMap);
|
export const semanticColors = (constants.ThemeColorMap ?? colorModule?.SemanticColor);
|
||||||
|
|
||||||
//? RawColor is effectively Colors
|
//? RawColor is effectively Colors
|
||||||
export const raw = (colorModule?.RawColor ?? constants.Colors);
|
export const rawColors = (constants.Colors ?? colorModule?.RawColor);
|
|
@ -4,7 +4,7 @@ import { Forms, General } from "@ui/components";
|
||||||
import { Plugin } from "@types";
|
import { Plugin } from "@types";
|
||||||
import { getAssetIDByName } from "@ui/assets";
|
import { getAssetIDByName } from "@ui/assets";
|
||||||
import { showToast } from "@ui/toasts";
|
import { showToast } from "@ui/toasts";
|
||||||
import { map as colorMap } from "@ui/color";
|
import { semanticColors } from "@ui/color";
|
||||||
import { removePlugin, startPlugin, stopPlugin, getSettings } from "@lib/plugins";
|
import { removePlugin, startPlugin, stopPlugin, getSettings } from "@lib/plugins";
|
||||||
import copyText from "@utils/copyText";
|
import copyText from "@utils/copyText";
|
||||||
|
|
||||||
|
@ -17,14 +17,14 @@ const { TouchableOpacity, Image } = General;
|
||||||
// TODO: These styles work weirdly. iOS has cramped text, Android with low DPI probably does too. Fix?
|
// TODO: These styles work weirdly. iOS has cramped text, Android with low DPI probably does too. Fix?
|
||||||
const styles = stylesheet.createThemedStyleSheet({
|
const styles = stylesheet.createThemedStyleSheet({
|
||||||
card: {
|
card: {
|
||||||
backgroundColor: colorMap?.BACKGROUND_SECONDARY,
|
backgroundColor: semanticColors?.BACKGROUND_SECONDARY,
|
||||||
borderRadius: 5,
|
borderRadius: 5,
|
||||||
marginHorizontal: 10,
|
marginHorizontal: 10,
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
padding: 0,
|
padding: 0,
|
||||||
backgroundColor: colorMap?.BACKGROUND_TERTIARY,
|
backgroundColor: semanticColors?.BACKGROUND_TERTIARY,
|
||||||
borderTopLeftRadius: 5,
|
borderTopLeftRadius: 5,
|
||||||
borderTopRightRadius: 5,
|
borderTopRightRadius: 5,
|
||||||
},
|
},
|
||||||
|
@ -36,7 +36,7 @@ const styles = stylesheet.createThemedStyleSheet({
|
||||||
width: 22,
|
width: 22,
|
||||||
height: 22,
|
height: 22,
|
||||||
marginLeft: 5,
|
marginLeft: 5,
|
||||||
tintColor: colorMap?.INTERACTIVE_NORMAL,
|
tintColor: semanticColors?.INTERACTIVE_NORMAL,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue