Skip to content

Commit

Permalink
Merge pull request #57 from asgeir-eth/asgeir/zodiac-ui-components-in…
Browse files Browse the repository at this point in the history
…tegration

Remove local theming instead use the theme from zodiac-ui-components
  • Loading branch information
samepant authored Apr 19, 2022
2 parents 8bb2079 + 0bac216 commit 6259feb
Show file tree
Hide file tree
Showing 36 changed files with 228 additions and 524 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"react-dom": "^17.0.1",
"react-redux": "^7.2.4",
"styled-components": "^5.1.1",
"timeago-react": "^3.0.2"
"timeago-react": "^3.0.2",
"zodiac-ui-components": "^0.0.28"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.4",
Expand Down
86 changes: 0 additions & 86 deletions src/GlobalStyle.ts

This file was deleted.

Binary file removed src/assets/images/bridge-module-logo.png
Binary file not shown.
Binary file removed src/assets/images/custom-module-logo.png
Binary file not shown.
Binary file removed src/assets/images/delay-module-logo.png
Binary file not shown.
Binary file removed src/assets/images/exit-module-logo.png
Binary file not shown.
Binary file removed src/assets/images/reality-module-logo.png
Binary file not shown.
Binary file removed src/assets/images/zodiac-app-logo.png
Binary file not shown.
11 changes: 8 additions & 3 deletions src/components/Collapsable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import { makeStyles, Paper, PaperProps } from "@material-ui/core";
import { makeStyles, PaperProps } from "@material-ui/core";
import { ZodiacPaper } from "zodiac-ui-components";
import classNames from "classnames";

interface CollapsableProps extends PaperProps {
Expand Down Expand Up @@ -37,7 +38,11 @@ export const Collapsable: React.FC<CollapsableProps> = ({
}) => {
const classes = useStyles();
return (
<Paper {...props} className={classNames(classes.root, className)}>
<ZodiacPaper
{...props}
borderStyle="double"
className={classNames(classes.root, className)}
>
{children}
{content ? (
<div
Expand All @@ -48,6 +53,6 @@ export const Collapsable: React.FC<CollapsableProps> = ({
{content}
</div>
) : null}
</Paper>
</ZodiacPaper>
);
};
9 changes: 5 additions & 4 deletions src/components/ethereum/ParamInput.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from "react";
import { ParamType } from "@ethersproject/abi";
import { TextField, TextFieldProps } from "../input/TextField";
import { ZodiacTextField } from "zodiac-ui-components";
import { TextFieldProps } from "../input/TextField";
import { formatParamValue } from "../../utils/contracts";
import { MenuItem } from "@material-ui/core";
import { BigNumber } from "ethers";
Expand Down Expand Up @@ -70,7 +71,7 @@ export const ParamInput = ({

if (param.baseType === "boolean") {
return (
<TextField
<ZodiacTextField
select
color="secondary"
label={getLabel(param)}
Expand All @@ -80,12 +81,12 @@ export const ParamInput = ({
>
<MenuItem value="true">True</MenuItem>
<MenuItem value="false">True</MenuItem>
</TextField>
</ZodiacTextField>
);
}

return (
<TextField
<ZodiacTextField
color="secondary"
label={getLabel(param)}
value={value}
Expand Down
4 changes: 0 additions & 4 deletions src/components/input/ArbitratorSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ const useStyles = makeStyles((theme) => ({
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
"& input": {
borderRightWidth: 1,
borderRightStyle: "solid",
borderRightColor: theme.palette.secondary.main,
paddingRight: theme.spacing(1),
textAlign: "right",
},
},
Expand Down
7 changes: 4 additions & 3 deletions src/components/input/DisplayField.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import { makeStyles, Paper, Typography } from "@material-ui/core";
import { makeStyles, Typography } from "@material-ui/core";
import { ZodiacPaper } from "zodiac-ui-components";

interface DisplayFieldProps {
label: string;
Expand All @@ -26,9 +27,9 @@ export const DisplayField = ({ label, value }: DisplayFieldProps) => {
<Typography noWrap className={classes.label}>
{label}
</Typography>
<Paper className={classes.field} elevation={0}>
<ZodiacPaper borderStyle="double" className={classes.field}>
<Typography noWrap>{value}</Typography>
</Paper>
</ZodiacPaper>
</div>
);
};
10 changes: 1 addition & 9 deletions src/components/input/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ const StyledTextField = withStyles((theme) => ({
marginTop: 0,
minHeight: "37px",
},
"& .MuiInputBase-root input": {
fontFamily: "Roboto Mono",
fontSize: ".75rem",
},
"& .MuiSelect-select:focus": {
backgroundColor: "transparent",
},
Expand All @@ -41,7 +37,7 @@ const useStyles = makeStyles((theme) => ({
},
label: {
color: theme.palette.text.primary,
marginBottom: theme.spacing(1),
marginBottom: "4px",
},
inputContainer: {
flexGrow: 1,
Expand All @@ -50,10 +46,6 @@ const useStyles = makeStyles((theme) => ({
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
"& input": {
borderRightWidth: 1,
borderRightStyle: "solid",
borderRightColor: theme.palette.secondary.main,
paddingRight: theme.spacing(1),
textAlign: "right",
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/input/TimeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { Box, makeStyles, MenuItem, Select } from "@material-ui/core";
import { BigNumber, BigNumberish } from "ethers";
import { ReactComponent as CheckmarkIcon } from "../../assets/icons/checkmark.svg";
import { TextField } from "./TextField";
import { TextField } from "./TextField"

const unitConversion = {
seconds: 1,
Expand Down
26 changes: 7 additions & 19 deletions src/components/layout/AppLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
import React from "react";
import { makeStyles, Paper } from "@material-ui/core";
import { makeStyles } from "@material-ui/core";
import { ZodiacPaper } from "zodiac-ui-components";

const useStyles = makeStyles((theme) => ({
root: {
display: "grid",
height: "calc(100% - 70px)",
gridTemplateColumns: "390px 1fr",
gridGap: theme.spacing(0.5),
borderRadius: 0,
overflow: "hidden",
padding: theme.spacing(0.5),
background: "none",
"&::before": {
content: "none",
},
},
leftPanel: {
overflowY: "auto",
borderRightStyle: "solid",
borderRightWidth: 1,
borderRightColor: theme.palette.divider,
backgroundColor: "none",
},
content: {
overflowY: "auto",
background: "none",
"&::before": {
content: "none",
},
},
}));

Expand All @@ -38,11 +26,11 @@ interface AppLayoutProps {
export const AppLayout: React.FC<AppLayoutProps> = ({ children, left }) => {
const classes = useStyles();
return (
<Paper className={classes.root}>
<Paper className={classes.content}>{left}</Paper>
<Paper id="app-content" className={classes.content}>
<ZodiacPaper variant="outlined" className={classes.root}>
<ZodiacPaper variant="outlined" className={classes.content}>{left}</ZodiacPaper>
<ZodiacPaper variant="outlined" id="app-content" className={classes.content}>
{children}
</Paper>
</Paper>
</ZodiacPaper>
</ZodiacPaper>
);
};
Loading

0 comments on commit 6259feb

Please sign in to comment.