-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c93aad
commit a1eaeda
Showing
4 changed files
with
60 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 46 additions & 69 deletions
115
frontend/src/components/report-modal/ReportBugModal.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,52 @@ | ||
import React, { useState } from "react"; | ||
import "./ReportBugModal.css"; | ||
import telegramIcon from "../../assets/icons/telegram.svg"; | ||
import { Button } from "components/ui/custom-button/Button"; | ||
import { useWalletStore } from "stores/useWalletStore"; | ||
import { useBugReport } from "hooks/useBugReport"; | ||
import React, { useState } from 'react'; | ||
import './ReportBugModal.css'; | ||
import telegramIcon from '../../assets/icons/telegram.svg'; | ||
import { Button } from '../../components/ui/custom-button/Button'; | ||
import { useWalletStore } from '../../stores/useWalletStore'; | ||
import { useBugReport } from '../../hooks/useBugReport'; | ||
|
||
export function ReportBugModal({ onClose }) { | ||
const { walletId } = useWalletStore(); | ||
const [bugDescription, setBugDescription] = useState(""); | ||
const { mutation, handleSubmit } = useBugReport(walletId, bugDescription, onClose); | ||
const { walletId } = useWalletStore(); | ||
const [bugDescription, setBugDescription] = useState(''); | ||
const { mutation, handleSubmit } = useBugReport(walletId, bugDescription, onClose); | ||
|
||
return ( | ||
<div | ||
onClick={onClose} | ||
className="modall-overlay" | ||
> | ||
<form | ||
className="report-bug-form" | ||
onClick={(e) => e.stopPropagation()} | ||
onSubmit={handleSubmit} | ||
> | ||
<div className="modall-content"> | ||
<div className="text-group"> | ||
<h3>Report Bug</h3> | ||
<p className="modal-paragraph-text"> | ||
Please describe the bug you've encountered | ||
</p> | ||
<textarea | ||
value={bugDescription} | ||
onChange={(e) => setBugDescription(e.target.value)} | ||
placeholder="The bug I'm experiencing..." | ||
className="bug-textarea" | ||
|
||
/> | ||
<a | ||
className="dev-group-link" | ||
href="https://t.me/spotnet_dev" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<img | ||
src={telegramIcon} | ||
alt="telegram-icon" | ||
className="telegram-icon" | ||
/> | ||
Ask in our Dev group | ||
</a> | ||
</div> | ||
return ( | ||
<div onClick={onClose} className="modall-overlay"> | ||
<form className="report-bug-form" onClick={(e) => e.stopPropagation()} onSubmit={handleSubmit}> | ||
<div className="modall-content"> | ||
<div className="text-group"> | ||
<h3>Report Bug</h3> | ||
<p className="modal-paragraph-text">Please describe the bug you've encountered</p> | ||
<textarea | ||
value={bugDescription} | ||
onChange={(e) => setBugDescription(e.target.value)} | ||
placeholder="The bug I'm experiencing..." | ||
className="bug-textarea" | ||
/> | ||
<a className="dev-group-link" href="https://t.me/spotnet_dev" target="_blank" rel="noopener noreferrer"> | ||
<img src={telegramIcon} alt="telegram-icon" className="telegram-icon" /> | ||
Ask in our Dev group | ||
</a> | ||
</div> | ||
|
||
<div className="button-group"> | ||
<Button | ||
variant="secondary" | ||
type="button" | ||
className="cancel-button" | ||
onClick={(e) => { | ||
e.stopPropagation(); | ||
onClose(); | ||
}} | ||
> | ||
Cancel | ||
</Button> | ||
<Button | ||
variant="primary" | ||
type="submit" | ||
className="submit-button" | ||
> | ||
{mutation.isPending ? "Sending..." : "Send Report"} | ||
</Button> | ||
</div> | ||
</div> | ||
</form> | ||
<div className="button-group"> | ||
<Button | ||
variant="secondary" | ||
type="button" | ||
className="cancel-button" | ||
onClick={(e) => { | ||
e.stopPropagation(); | ||
onClose(); | ||
}} | ||
> | ||
Cancel | ||
</Button> | ||
<Button variant="primary" type="submit" className="submit-button"> | ||
{mutation.isPending ? 'Sending...' : 'Send Report'} | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
</form> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters