Fix last warnings

This commit is contained in:
Reckless_Satoshi 2022-05-10 11:44:12 -07:00
parent 3c662b847f
commit ee445e0cff
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
6 changed files with 43 additions and 27 deletions

View File

@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { useTranslation } from 'react-i18next';
import { useAutocomplete } from '@mui/base/AutocompleteUnstyled';
import { styled } from '@mui/material/styles';
import { Button} from "@mui/material";
import { Button, Tooltip } from "@mui/material";
import { paymentMethods, swapDestinations } from "./payment-methods/Methods";
// Icons
@ -238,15 +238,17 @@ export default function AutocompletePayments(props) {
return (
<Root>
<div style={{height:'5px'}}></div>
<div {...getRootProps()} >
<Label {...getInputLabelProps()} error={props.error}>{props.label}</Label>
<InputWrapper ref={setAnchorEl} error={props.error} className={focused ? 'focused' : ''}>
{value.map((option, index) => (
<StyledTag label={t(option.name)} icon={option.icon} {...getTagProps({ index })} />
))}
<input {...getInputProps()} value={val}/>
</InputWrapper>
</div>
<Tooltip placement="top" enterTouchDelay={300} enterDelay={700} enterNextDelay={2000} title={props.tooltipTitle}>
<div {...getRootProps()} >
<Label {...getInputLabelProps()} error={props.error ? "error" : null}> {props.label}</Label>
<InputWrapper ref={setAnchorEl} error={props.error ? "error" : null} className={focused ? 'focused' : ''}>
{value.map((option, index) => (
<StyledTag label={t(option.name)} icon={option.icon} {...getTagProps({ index })} />
))}
<input {...getInputProps()} value={val ? val :""}/>
</InputWrapper>
</div>
</Tooltip>
{groupedOptions.length > 0 ? (
<Listbox {...getListboxProps()}>
<div style={{position:'fixed', minHeight:'20px', marginLeft: 120-props.listHeaderText.length*3, marginTop: '-13px'}}>

View File

@ -171,7 +171,7 @@ class BookPage extends Component {
)
}}
pageSize={this.props.bookLoading ? 0 : this.state.pageSize}
rowsPerPageOptions={[6,20,50]}
rowsPerPageOptions={[0,6,20,50]}
onPageSizeChange={(newPageSize) => this.setState({pageSize:newPageSize})}
onRowClick={(params) => this.handleRowClick(params.row.id)} // Whole row is clickable, but the mouse only looks clickly in some places.
/>
@ -275,7 +275,7 @@ class BookPage extends Component {
)
}}
pageSize={this.props.bookLoading ? 0 : this.state.pageSize}
rowsPerPageOptions={[6,20,50]}
rowsPerPageOptions={[0,6,20,50]}
onPageSizeChange={(newPageSize) => this.setState({pageSize:newPageSize})}
onRowClick={(params) => this.handleRowClick(params.row.id)} // Whole row is clickable, but the mouse only looks clickly in some places.

View File

@ -298,7 +298,7 @@ class BottomBar extends Component {
<Divider/>
<Grid spacing={1} align="center" container>
<Grid item align="center">
<FormControlLabel labelPlacement="start"control={
<Switch
checked={this.state.showRewards}
@ -405,7 +405,8 @@ bottomBarDesktop =()=>{
<Tooltip
open={hasRewards || hasOrder}
title={(hasRewards ? t("You can claim satoshis!")+" ": "" )+
(hasOrder ? t("You have an active order"):"")}>
(hasOrder ? t("You have an active order"):"")}
>
<ListItemAvatar sx={{ width: 30, height: 30 }} >
<Badge badgeContent={(this.state.active_order_id > 0 & !this.state.profileShown) ? "": null} color="primary">
<Avatar className='flippedSmallAvatar' sx={{margin: 0, top: -13}}

View File

@ -331,17 +331,16 @@ class MakerPage extends Component {
</Grid>
<Grid item xs={12} align="center">
<Tooltip placement="top" enterTouchDelay={300} enterDelay={700} enterNextDelay={2000} title={t("Enter your preferred fiat payment methods. Fast methods are highly recommended.")}>
<AutocompletePayments
onAutocompleteChange={this.handlePaymentMethodChange}
optionsType={this.state.currency==1000 ? "swap":"fiat"}
error={this.state.badPaymentMethod}
helperText={this.state.badPaymentMethod ? t("Must be shorter than 65 characters"):""}
label={this.state.currency==1000 ? t("Swap Destination(s)") : t("Fiat Payment Method(s)")}
tooltipTitle={t("Enter your preferred fiat payment methods. Fast methods are highly recommended.")}
listHeaderText={t("You can add new methods")}
addNewButtonText={t("Add New")}
/>
</Tooltip>
</Grid>
<Grid item xs={12} align="center">

View File

@ -614,7 +614,7 @@ class OrderPage extends Component {
<Countdown date={new Date(this.state.expires_at)} renderer={this.countdownRenderer} />
</ListItemText>
</ListItem>
<LinearDeterminate total_secs_exp={this.state.total_secs_exp} expires_at={this.state.expires_at}/>
<LinearDeterminate key={this.state.expires_at} total_secs_exp={this.state.total_secs_exp} expires_at={this.state.expires_at}/>
</List>
{/* If the user has a penalty/limit */}

View File

@ -666,11 +666,13 @@ class TradeBox extends Component {
<b> {t("A dispute has been opened")} </b>
</Typography>
</Grid>
<Grid item xs={12} align="left">
<Typography variant="body2">
{t("Please, submit your statement. Be clear and specific about what happened and provide the necessary evidence. You MUST provide a contact method: burner email, XMPP or telegram username to follow up with the staff. Disputes are solved at the discretion of real robots (aka humans), so be as helpful as possible to ensure a fair outcome. Max 5000 chars.")}
</Typography>
</Grid>
<List dense={true}>
<Divider/>
<ListItem>
<Typography variant="body2">
{t("Please, submit your statement. Be clear and specific about what happened and provide the necessary evidence. You MUST provide a contact method: burner email, XMPP or telegram username to follow up with the staff. Disputes are solved at the discretion of real robots (aka humans), so be as helpful as possible to ensure a fair outcome. Max 5000 chars.")}
</Typography>
</ListItem>
<Grid item xs={12} align="center">
<TextField
@ -689,6 +691,8 @@ class TradeBox extends Component {
<Grid item xs={12} align="center">
<Button onClick={this.handleClickSubmitStatementButton} variant='contained' color='primary'>Submit</Button>
</Grid>
</List>
{this.showBondIsSettled()}
</Grid>
)}
@ -703,11 +707,21 @@ class TradeBox extends Component {
<b> {t("We have the statements")} </b>
</Typography>
</Grid>
<Grid item xs={12} align="left">
<Typography variant="body2">
<p>{t("Both statements have been received, wait for the staff to resolve the dispute. If you are hesitant about the state of the dispute or want to add more information, contact robosats@protonmail.com. If you did not provide a contact method, or are unsure whether you wrote it right, write us immediately.")} </p>
<p>{t("Please, save the information needed to identify your order and your payments: order ID; payment hashes of the bonds or escrow (check on your lightning wallet); exact amount of satoshis; and robot nickname. You will have to identify yourself as the user involved in this trade via email (or other contact methods).")}</p>
</Typography>
<Grid item xs={12} align="center">
<List dense={true}>
<Divider/>
<ListItem>
<Typography variant="body2">
{t("Both statements have been received, wait for the staff to resolve the dispute. If you are hesitant about the state of the dispute or want to add more information, contact robosats@protonmail.com. If you did not provide a contact method, or are unsure whether you wrote it right, write us immediately.")}
</Typography>
</ListItem>
<ListItem>
<Typography variant="body2">
{t("Please, save the information needed to identify your order and your payments: order ID; payment hashes of the bonds or escrow (check on your lightning wallet); exact amount of satoshis; and robot nickname. You will have to identify yourself as the user involved in this trade via email (or other contact methods).")}
</Typography>
</ListItem>
<Divider/>
</List>
</Grid>
{this.showBondIsSettled()}
</Grid>