Skip to content

Commit

Permalink
lint adjusts
Browse files Browse the repository at this point in the history
  • Loading branch information
jandsonrj committed Jul 21, 2023
1 parent f5da7b8 commit b2dc556
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion frontend/components/ProductGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,4 @@ ProductGrid.propTypes = {
ProductGrid.defaultProps = {
filters: {},
query: ''
}
}
114 changes: 57 additions & 57 deletions frontend/components/ProductShare.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
Button,
Dialog,
DialogContent,
DialogTitle,
TextField
Button,
Dialog,
DialogContent,
DialogTitle,
TextField
} from '@mui/material'
import DialogActions from '@mui/material/DialogActions'
import InputAdornment from '@mui/material/InputAdornment'
Expand All @@ -12,60 +12,60 @@ import PropTypes from 'prop-types'
import React from 'react'

export default function ProductShare({
isOpen,
handleShareDialogOpen,
url,
setParentSnackbarOpen
isOpen,
handleShareDialogOpen,
url,
setParentSnackbarOpen
}) {
const handleCopyUrl = () => {
navigator.clipboard
.writeText(url)
.then(() => {
handleShareDialogOpen()
setParentSnackbarOpen(true)
})
.catch(error => {
console.error(error)
})
}
const handleCopyUrl = () => {
navigator.clipboard
.writeText(url)
.then(() => {
handleShareDialogOpen()
setParentSnackbarOpen(true)
})
.catch(error => {
console.error(error)
})
}

return (
<Dialog
open={isOpen}
onClose={handleShareDialogOpen}
PaperProps={{
style: { width: '500px', minHeight: '150px' }
}}
>
<DialogTitle style={{ fontSize: '16px' }}>
Copy the download URL:
</DialogTitle>
<DialogContent>
<TextField
fullWidth
variant="outlined"
value={url}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<Button variant="contained" onClick={handleCopyUrl}>
Copy
</Button>
</InputAdornment>
)
}}
/>
</DialogContent>
<DialogActions>
<Button onClick={handleShareDialogOpen}>Close</Button>
</DialogActions>
</Dialog>
)
return (
<Dialog
open={isOpen}
onClose={handleShareDialogOpen}
PaperProps={{
style: { width: '500px', minHeight: '150px' }
}}
>
<DialogTitle style={{ fontSize: '16px' }}>
Copy the download URL:
</DialogTitle>
<DialogContent>
<TextField
fullWidth
variant="outlined"
value={url}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<Button variant="contained" onClick={handleCopyUrl}>
Copy
</Button>
</InputAdornment>
)
}}
/>
</DialogContent>
<DialogActions>
<Button onClick={handleShareDialogOpen}>Close</Button>
</DialogActions>
</Dialog>
)
}

ProductShare.propTypes = {
isOpen: PropTypes.bool.isRequired,
handleShareDialogOpen: PropTypes.func.isRequired,
url: PropTypes.string,
setParentSnackbarOpen: PropTypes.func.isRequired
}
isOpen: PropTypes.bool.isRequired,
handleShareDialogOpen: PropTypes.func.isRequired,
url: PropTypes.string,
setParentSnackbarOpen: PropTypes.func.isRequired
}

0 comments on commit b2dc556

Please sign in to comment.