Fix small mistakes

This commit is contained in:
Reckless_Satoshi 2022-01-14 09:35:27 -08:00
parent 4087bb9936
commit 1a99b78229
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
3 changed files with 37 additions and 17 deletions

View File

@ -293,14 +293,14 @@ class UserView(APIView):
Response with Avatar and Nickname.
'''
if request.user.id:
context = {}
context['nickname'] = request.user.username
participant = not Logics.validate_already_maker_or_taker(request.user)
context['bad_request'] = f'You are already logged in as {request.user}'
if participant:
context['bad_request'] = f'You are already logged in as as {request.user} and have an active order'
return Response(context,status.HTTP_200_OK)
# if request.user.id:
# context = {}
# context['nickname'] = request.user.username
# participant = not Logics.validate_already_maker_or_taker(request.user)
# context['bad_request'] = f'You are already logged in as {request.user}'
# if participant:
# context['bad_request'] = f'You are already logged in as as {request.user} and have an active order'
# return Response(context,status.HTTP_200_OK)
token = request.GET.get(self.lookup_url_kwarg)

View File

@ -8,17 +8,18 @@ import InventoryIcon from '@mui/icons-material/Inventory';
import SellIcon from '@mui/icons-material/Sell';
import SmartToyIcon from '@mui/icons-material/SmartToy';
import PercentIcon from '@mui/icons-material/Percent';
import PriceChangeIcon from '@mui/icons-material/PriceChange';
export default class BottomBar extends Component {
constructor(props) {
super(props);
this.state = {
num_public_buy_orders: 0,
num_active_robotsats: 0,
num_public_sell_orders: 0,
fee: 0,
today_avg_nonkyc_btc_premium: 0,
today_volume: 0,
num_public_buy_orders: null,
num_active_robotsats: null,
num_public_sell_orders: null,
fee: null,
today_avg_nonkyc_btc_premium: null,
today_volume: null,
};
this.getInfo();
}
@ -40,11 +41,13 @@ export default class BottomBar extends Component {
return (
<Paper elevation={6} style={{height:40}}>
<Grid container xs={12}>
<Grid item xs={1}>
<IconButton color="primary" aria-label="Stats for Nerds" component="span">
<SettingsIcon />
</IconButton>
</Grid>
<Grid item xs={2}>
<ListItem className="bottomItem">
<ListItemIcon size="small">
@ -57,6 +60,7 @@ export default class BottomBar extends Component {
secondary="Public Buy Orders" />
</ListItem>
</Grid>
<Grid item xs={2}>
<ListItem className="bottomItem">
<ListItemIcon size="small">
@ -69,6 +73,7 @@ export default class BottomBar extends Component {
secondary="Public Sell Orders" />
</ListItem>
</Grid>
<Grid item xs={2}>
<ListItem className="bottomItem">
<ListItemIcon size="small">
@ -81,10 +86,11 @@ export default class BottomBar extends Component {
secondary="Num Active RoboSats" />
</ListItem>
</Grid>
<Grid item xs={2}>
<ListItem className="bottomItem">
<ListItemIcon size="small">
<PercentIcon/>
<PriceChangeIcon/>
</ListItemIcon>
<ListItemText
primaryTypographyProps={{fontSize: '14px'}}
@ -93,7 +99,20 @@ export default class BottomBar extends Component {
secondary="Today Avg Premium" />
</ListItem>
</Grid>
<Grid item xs={2}/>
<Grid item xs={2}>
<ListItem className="bottomItem">
<ListItemIcon size="small">
<PercentIcon/>
</ListItemIcon>
<ListItemText
primaryTypographyProps={{fontSize: '14px'}}
secondaryTypographyProps={{fontSize: '12px'}}
primary={this.state.fee*100}
secondary="Trading Fee" />
</ListItem>
</Grid>
<Grid container item xs={1}>
<Grid item xs={2}/>
<Grid item xs={6}>
@ -111,6 +130,7 @@ export default class BottomBar extends Component {
<SupportAgentIcon />
</IconButton>
</Grid>
</Grid>
</Grid>
</Paper>

View File

@ -38,7 +38,7 @@ export default class OrderPage extends Component {
super(props);
this.state = {
isExplicit: false,
delay: 60000, // Refresh every 60 seconds by default
delay: 3000, // Refresh every 3 seconds by default
currencies_dict: {"1":"USD"},
total_secs_expiry: 300,
loading: true,