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. Response with Avatar and Nickname.
''' '''
if request.user.id: # if request.user.id:
context = {} # context = {}
context['nickname'] = request.user.username # context['nickname'] = request.user.username
participant = not Logics.validate_already_maker_or_taker(request.user) # participant = not Logics.validate_already_maker_or_taker(request.user)
context['bad_request'] = f'You are already logged in as {request.user}' # context['bad_request'] = f'You are already logged in as {request.user}'
if participant: # if participant:
context['bad_request'] = f'You are already logged in as as {request.user} and have an active order' # 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) # return Response(context,status.HTTP_200_OK)
token = request.GET.get(self.lookup_url_kwarg) 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 SellIcon from '@mui/icons-material/Sell';
import SmartToyIcon from '@mui/icons-material/SmartToy'; import SmartToyIcon from '@mui/icons-material/SmartToy';
import PercentIcon from '@mui/icons-material/Percent'; import PercentIcon from '@mui/icons-material/Percent';
import PriceChangeIcon from '@mui/icons-material/PriceChange';
export default class BottomBar extends Component { export default class BottomBar extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
num_public_buy_orders: 0, num_public_buy_orders: null,
num_active_robotsats: 0, num_active_robotsats: null,
num_public_sell_orders: 0, num_public_sell_orders: null,
fee: 0, fee: null,
today_avg_nonkyc_btc_premium: 0, today_avg_nonkyc_btc_premium: null,
today_volume: 0, today_volume: null,
}; };
this.getInfo(); this.getInfo();
} }
@ -40,11 +41,13 @@ export default class BottomBar extends Component {
return ( return (
<Paper elevation={6} style={{height:40}}> <Paper elevation={6} style={{height:40}}>
<Grid container xs={12}> <Grid container xs={12}>
<Grid item xs={1}> <Grid item xs={1}>
<IconButton color="primary" aria-label="Stats for Nerds" component="span"> <IconButton color="primary" aria-label="Stats for Nerds" component="span">
<SettingsIcon /> <SettingsIcon />
</IconButton> </IconButton>
</Grid> </Grid>
<Grid item xs={2}> <Grid item xs={2}>
<ListItem className="bottomItem"> <ListItem className="bottomItem">
<ListItemIcon size="small"> <ListItemIcon size="small">
@ -57,6 +60,7 @@ export default class BottomBar extends Component {
secondary="Public Buy Orders" /> secondary="Public Buy Orders" />
</ListItem> </ListItem>
</Grid> </Grid>
<Grid item xs={2}> <Grid item xs={2}>
<ListItem className="bottomItem"> <ListItem className="bottomItem">
<ListItemIcon size="small"> <ListItemIcon size="small">
@ -69,6 +73,7 @@ export default class BottomBar extends Component {
secondary="Public Sell Orders" /> secondary="Public Sell Orders" />
</ListItem> </ListItem>
</Grid> </Grid>
<Grid item xs={2}> <Grid item xs={2}>
<ListItem className="bottomItem"> <ListItem className="bottomItem">
<ListItemIcon size="small"> <ListItemIcon size="small">
@ -81,10 +86,11 @@ export default class BottomBar extends Component {
secondary="Num Active RoboSats" /> secondary="Num Active RoboSats" />
</ListItem> </ListItem>
</Grid> </Grid>
<Grid item xs={2}> <Grid item xs={2}>
<ListItem className="bottomItem"> <ListItem className="bottomItem">
<ListItemIcon size="small"> <ListItemIcon size="small">
<PercentIcon/> <PriceChangeIcon/>
</ListItemIcon> </ListItemIcon>
<ListItemText <ListItemText
primaryTypographyProps={{fontSize: '14px'}} primaryTypographyProps={{fontSize: '14px'}}
@ -93,7 +99,20 @@ export default class BottomBar extends Component {
secondary="Today Avg Premium" /> secondary="Today Avg Premium" />
</ListItem> </ListItem>
</Grid> </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 container item xs={1}>
<Grid item xs={2}/> <Grid item xs={2}/>
<Grid item xs={6}> <Grid item xs={6}>
@ -111,6 +130,7 @@ export default class BottomBar extends Component {
<SupportAgentIcon /> <SupportAgentIcon />
</IconButton> </IconButton>
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>
</Paper> </Paper>

View File

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