Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: implement new design for Place Order part in Trade path #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

scorebreaker
Copy link
Contributor

Implement new design for Place Order part in Trade path.

@scorebreaker scorebreaker force-pushed the design-trade branch 2 times, most recently from ad7de03 to 09b8a1a Compare April 6, 2021 20:18
Copy link
Collaborator

@stackingcats stackingcats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start, thanks! A few general comments:

  • when narrowing the window width to < 1000px, a horizontal scrollbar appears;
  • it seems that the font is not the same as in the designs;
  • the price warning dialog does not attach to the place order box anymore. It should only cover the place order part instead of whole page;
  • the place warning dialog has buttons with rounded corners (the sharp corners are applied only to ButtonWithLoading?);
  • buttons (with loading?) have become way too large (see for instance a button in open orders table when an order is created);
  • would really appreciate if color codes and other general styles would be inside the common components unless they are extremely specific. I guess we could use more generalization here and separate the styles that are used throughout the application in order to avoid duplicate code and make the code easier to maintain.

Comment on lines +33 to +36
backgroundColor:
props.color === "primary"
? theme.palette.primary.main
: theme.palette.secondary.main,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two concerns here:

  1. the value of color is not either primary or secondary, it can also be another valid option of Material Ui's button color. So let's keep it same as props.color (with primary default). Also, the color value should match with other possible button colors;
  2. do we want this style only for ButtonWithLoading or also for other buttons?

resetFormData={resetFormData}
setOrderError={setOrderError}
orderError={orderError}
tradeStore={tradeStore}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's inject the stores in the component instead of passing them as properties.

@@ -19,25 +13,20 @@ const useStyles = makeStyles(() => {
display: "flex",
alignItems: "center",
},
sectionTitle: {
color: "#f2f2f2",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe would make sense to define the text colors in theme? Would be great not to define it in every component that uses this text color, and there seem to be many.

textHighlighted: {
color: "#f2f2f2",
},
toolTip: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose all the tooltips should look alike, so why not create a component that has those styles and can be used anywhere?

Comment on lines +30 to +31
color: "#979797",
fontSize: "16px",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we could make use of text components that have sizes, colors, etc. Would eliminate duplicate code and make possible restyling and maintaining lot easier.

<ThemeProvider theme={tradeTheme}>
<div className={classes.wrapper} id={id}>
<div className={classes.wrapperWithoutPlaceOrderButton}>
{!initialLoadCompleted || loadingErrors.size ? (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, the place order button is visible when those conditions are not met. It shouldn't.

const useStyles = makeStyles((theme: Theme) => {
return createStyles({
wrapper: {
maxWidth: "550px",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there max width? Imo it does not look good like this. The open orders section does certainly not fit into 550px and would not make sense to keep those sections with different widths. So let's keep them dynamic.
Also, the place order box "jumps" (changes its height) when i switch between buy and sell. The reason is that I have different max limits and with 7 decimal numbers, the Max: 0.0292936 ETH does not fit into one row, causing the box to increase in height. At least 8 decimals have to fit into one row.

root: {
padding: "8px 0",
},
thumb: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thumb looks a bit off (it's downwards from the line + the white border is not continuous).

import { TradeStore, TRADE_STORE } from "../../../stores/tradeStore";
import Button from "../../../common/components/input/buttons/Button";

const useStyles = makeStyles(() => ({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The color of those buttons should only depend on whether buy or sell is selected. If buy, both are green; if sell, both are red.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants