Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Issue forms and make the issue options more visually appealing #386

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 104 additions & 16 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,104 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MediHub</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>

</html>
import React, { useState } from 'react';

const ContactPage = () => {
const [formData, setFormData] = useState({
title: '',
description: '',
steps: '',
expected: '',
actual: '',
email: ''
});

const handleChange = (e) => {
const { name, value } = e.target;
setFormData((prevData) => ({
...prevData,
[name]: value
}));
};

const handleSubmit = (e) => {
e.preventDefault();
// Logic to handle form submission
console.log('Bug Report Submitted:', formData);
// You can add API calls or form submission logic here
};

return (
<div className="container">
<h1>Report a Bug</h1>
<form onSubmit={handleSubmit}>
<label htmlFor="title">Bug Title:</label>
<input
type="text"
id="title"
name="title"
value={formData.title}
onChange={handleChange}
required
placeholder="Enter a brief title for the bug"
/>

<label htmlFor="description">Description:</label>
<textarea
id="description"
name="description"
rows="6"
value={formData.description}
onChange={handleChange}
required
placeholder="Describe the bug in detail"
></textarea>

<label htmlFor="steps">Steps to Reproduce:</label>
<textarea
id="steps"
name="steps"
rows="6"
value={formData.steps}
onChange={handleChange}
required
placeholder="List the steps to reproduce the bug"
></textarea>

<label htmlFor="expected">Expected Result:</label>
<textarea
id="expected"
name="expected"
rows="3"
value={formData.expected}
onChange={handleChange}
required
placeholder="What did you expect to happen?"
></textarea>

<label htmlFor="actual">Actual Result:</label>
<textarea
id="actual"
name="actual"
rows="3"
value={formData.actual}
onChange={handleChange}
required
placeholder="What actually happened?"
></textarea>

<label htmlFor="email">Your Email:</label>
<input
type="email"
id="email"
name="email"
value={formData.email}
onChange={handleChange}
required
placeholder="Your email for follow-up"
/>

<button type="submit">Submit Bug Report</button>
</form>
</div>
);
};

export default ContactPage;