venom-connect
Version:
<p align="center"> <a href="https://github.com/venom-blockchain/developer-program"> <img src="https://raw.githubusercontent.com/venom-blockchain/developer-program/main/vf-dev-program.png" alt="Logo" width="366.8" height="146.4"> </a> </p>
28 lines (26 loc) • 707 B
text/typescript
import { Theme } from "../types";
type PartialTextTheme = Omit<Theme, "popup" | "item"> & {
popup: Omit<Theme["popup"], "text"> & Partial<Theme["popup"]["text"]>;
item: Omit<Theme["item"], "text"> &
Partial<Theme["item"]["text"]> & {
warning: Omit<Theme["item"]["warning"], "text"> &
Partial<Theme["item"]["warning"]["text"]>;
};
};
export const getThemeWithFallback = (theme: PartialTextTheme): Theme => {
return {
...theme,
popup: {
...theme.popup,
text: theme.common.text,
},
item: {
...theme.item,
text: theme.common.text,
warning: {
...theme.item.warning,
text: theme.item.warning.text,
},
},
};
};