Skip to content

Commit b375ce0

Browse files
committed
Update UI
- Move Title field to the top - Reduce the font size of Complexity header - Add margin to the bottom of Complexity container
1 parent 5564c7c commit b375ce0

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

Frontend/src/components/question/CreateQn.jsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,18 @@ function CreateQn({handleClose, addQuestion}) {
3838
<div className="w-100 bg-white p-3">
3939
<form onSubmit={Submit}>
4040
{error && <div className="alert alert-danger">{error}</div>}
41+
<div className="mb-2">
42+
<label htmlFor="">Title</label>
43+
<input type="text" placeholder='Shortest Distance' className='form-control'
44+
onChange={(e) => setTitle(e.target.value)}/>
45+
</div>
4146
<div className="mb-2">
4247
<label htmlFor="">Category</label>
4348
<input type="text" placeholder='Data Structures' className='form-control'
4449
onChange={(e) => setCategory(e.target.value.split(","))}/>
4550
</div>
46-
<div className="container mt-3">
47-
<h3>Complexity</h3>
51+
<div className="container my-3">
52+
<h5>Complexity</h5>
4853
<div className="form-check">
4954
<input type="radio" id="easy" value="Easy" name={"complexity"}
5055
onChange={(e) => setComplexity(e.target.value)}/>
@@ -66,11 +71,7 @@ function CreateQn({handleClose, addQuestion}) {
6671
<input type="text" placeholder='Return the largest....' className='form-control'
6772
onChange={(e) => setDescription(e.target.value)}/>
6873
</div>
69-
<div className="mb-2">
70-
<label htmlFor="">Title</label>
71-
<input type="text" placeholder='Shortest Distance' className='form-control'
72-
onChange={(e) => setTitle(e.target.value)}/>
73-
</div>
74+
7475
<button className="btn btn-success">Submit</button>
7576
</form>
7677
</div>

Frontend/src/components/question/EditQn.jsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,18 @@ function EditQn({ question, handleClose, editQuestion }) {
4949
<form onSubmit={Update}>
5050
<h2>Update Question</h2>
5151
{error && <div className="alert alert-danger">{error}</div>}
52+
<div className="mb-2">
53+
<label htmlFor="">Title</label>
54+
<input type="text" placeholder='Shortest Distance' className='form-control'
55+
value={title} onChange={e => setTitle(e.target.value)}/>
56+
</div>
5257
<div className="mb-2">
5358
<label htmlFor="">Category</label>
5459
<input type="text" placeholder='Data Structures' className='form-control'
5560
value={category.join(",")} onChange={(e) => setCategory(e.target.value.split(","))}/>
5661
</div>
57-
<div className="container mt-3">
58-
<h3>Complexity</h3>
62+
<div className="container my-3">
63+
<h5>Complexity</h5>
5964
<div className="form-check">
6065
<input type="radio" id="easy" value="Easy" checked={complexity === "Easy"} onChange={(e) => setComplexity(e.target.value)}/>
6166
<label className="form-check-label" htmlFor="easy">Easy</label>
@@ -74,11 +79,7 @@ function EditQn({ question, handleClose, editQuestion }) {
7479
<input type="text" placeholder='Return the largest....' className='form-control'
7580
value={description} onChange={(e) => setDescription(e.target.value)}/>
7681
</div>
77-
<div className="mb-2">
78-
<label htmlFor="">Title</label>
79-
<input type="text" placeholder='Shortest Distance' className='form-control'
80-
value={title} onChange={e => setTitle(e.target.value)}/>
81-
</div>
82+
8283
<button className="btn btn-success">Update</button>
8384
</form>
8485
</div>

0 commit comments

Comments
 (0)