This commit is contained in:
Olivier Gagnon
2021-09-13 22:27:43 -04:00
parent 05fd85002c
commit 2d463b60a0
21 changed files with 82 additions and 199 deletions
-47
View File
@@ -1,47 +0,0 @@
/**
* Wrapper around material-ui's Button component that styles it with
* Bitburner's UI theme
*/
import React from "react";
import { Button as MuiButton, ButtonProps, makeStyles } from "@material-ui/core";
import { colors } from "./Theme";
const useStyles = makeStyles({
// Tries to emulate StdButton in buttons.scss
root: {
backgroundColor: "#333",
border: "1px solid #000",
color: colors.primary,
margin: "5px",
padding: "3px 5px",
"&:hover": {
backgroundColor: "#000",
},
borderRadius: 0,
},
textPrimary: {
color: "rgb( 144, 202, 249)",
},
textSecondary: {
color: "rgb(244, 143, 177)",
},
disabled: {
backgroundColor: "#333",
color: "#fff",
cursor: "default",
},
});
export const Button: React.FC<ButtonProps> = (props: ButtonProps) => {
return (
<MuiButton
{...props}
classes={{
...useStyles(),
...props.classes,
}}
/>
);
};
-19
View File
@@ -1,19 +0,0 @@
/**
* Wrapper around material-ui's Button component that styles it with
* Bitburner's UI colors
*/
import React from "react";
import { TextField as MuiTF, TextFieldProps, makeStyles } from "@material-ui/core";
import { colors } from "./Theme";
export const TextField: React.FC<TextFieldProps> = (props: TextFieldProps) => {
return (
<MuiTF
{...props}
classes={{
...props.classes,
}}
/>
);
};
+30 -4
View File
@@ -1,7 +1,5 @@
import React from "react";
import { createMuiTheme } from "@material-ui/core/styles";
import { ThemeProvider } from "@material-ui/core/styles";
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles";
export const colors = {
primarylight: "#0f0",
@@ -41,7 +39,7 @@ export const theme = createMuiTheme({
borderBottomColor: "#fff",
},
underline: {
"&:hover:before": {
"&:hover": {
borderBottomColor: colors.primarydark,
},
"&:before": {
@@ -61,6 +59,20 @@ export const theme = createMuiTheme({
},
},
},
MuiButton: {
root: {
backgroundColor: "#333",
border: "1px solid " + colors.well,
color: colors.primary,
margin: "5px",
padding: "3px 5px",
"&:hover": {
backgroundColor: "#000",
},
borderRadius: 0,
},
},
MuiSelect: {
icon: {
color: colors.primary,
@@ -86,6 +98,20 @@ export const theme = createMuiTheme({
backgroundColor: "#000",
},
},
MuiIconButton: {
root: {
color: colors.primary,
},
},
MuiTooltip: {
tooltip: {
fontSize: "1em",
color: colors.primary,
backgroundColor: colors.well,
borderRadius: 0,
border: "2px solid white",
},
},
},
});