1
- import { ButtonGroup } from "@material-ui/core" ;
1
+ import { ButtonGroup , makeStyles } from "@material-ui/core" ;
2
2
import { inject , observer } from "mobx-react" ;
3
3
import React , { ReactElement } from "react" ;
4
4
import Button from "../../../common/components/input/buttons/Button" ;
@@ -10,9 +10,43 @@ type OrderSideButtonsProps = {
10
10
tradeStore ?: TradeStore ;
11
11
} ;
12
12
13
+ const useStyles = makeStyles ( ( theme ) => ( {
14
+ buyButton : ( props : OrderSideButtonsProps ) => ( {
15
+ fontSize : "16px" ,
16
+ color : props . tradeStore ! . isBuyActive
17
+ ? theme . palette . primary . main
18
+ : "#636363" ,
19
+ border : "none" ,
20
+ borderBottom : props . tradeStore ! . isBuyActive
21
+ ? `2px solid ${ theme . palette . primary . main } `
22
+ : "2px solid #232322" ,
23
+
24
+ borderRadius : "initial" ,
25
+ "&:hover" : {
26
+ backgroundColor : "transparent" ,
27
+ } ,
28
+ } ) ,
29
+ sellButton : ( props : OrderSideButtonsProps ) => ( {
30
+ fontSize : "16px" ,
31
+ color : props . tradeStore ! . isBuyActive
32
+ ? "#636363"
33
+ : theme . palette . secondary . main ,
34
+ border : "none" ,
35
+ borderBottom : props . tradeStore ! . isBuyActive
36
+ ? "2px solid #232322"
37
+ : `2px solid ${ theme . palette . secondary . main } ` ,
38
+
39
+ borderRadius : "initial" ,
40
+ "&:hover" : {
41
+ backgroundColor : "transparent" ,
42
+ } ,
43
+ } ) ,
44
+ } ) ) ;
45
+
13
46
const OrderSideButtons = inject ( TRADE_STORE ) (
14
47
observer (
15
48
( props : OrderSideButtonsProps ) : ReactElement => {
49
+ const classes = useStyles ( props ) ;
16
50
const { tradeStore, onClick, className } = props ;
17
51
18
52
return (
@@ -23,17 +57,15 @@ const OrderSideButtons = inject(TRADE_STORE)(
23
57
tradeStore ! . setIsBuyActive ( true ) ;
24
58
onClick ( ) ;
25
59
} }
26
- color = "primary"
27
- variant = { tradeStore ! . isBuyActive ? "contained" : "outlined" }
60
+ className = { classes . buyButton }
28
61
/>
29
62
< Button
30
63
text = "Sell"
31
64
onClick = { ( ) => {
32
65
tradeStore ! . setIsBuyActive ( false ) ;
33
66
onClick ( ) ;
34
67
} }
35
- color = "secondary"
36
- variant = { tradeStore ! . isBuyActive ? "outlined" : "contained" }
68
+ className = { classes . sellButton }
37
69
/>
38
70
</ ButtonGroup >
39
71
) ;
0 commit comments