Skip to content

Commit

Permalink
Solve Error and some warning in frontend using eslint (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepGajjar31 authored Aug 13, 2024
1 parent cf82c53 commit 3297a0a
Show file tree
Hide file tree
Showing 18 changed files with 232 additions and 223 deletions.
7 changes: 4 additions & 3 deletions frontend/src/About.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ const AboutPage = () => {
<b> Search Doctors : </b>Quickly find doctors by specialty,
location, availability, and ratings. Our comprehensive database
allows you to compare and select the right healthcare provider for
you.Read detailed profiles, patient reviews, and see the doctor's
credentials to make an informed decision. Our user-friendly search
filters help you narrow down the best options effortlessly.
you.Read detailed profiles, patient reviews, and see the
doctor&apos;s credentials to make an informed decision. Our
user-friendly search filters help you narrow down the best options
effortlessly.
</p>
<p className="about-p lst">
<b> DashBoard For Doctors : </b> A dedicated dashboard for doctors
Expand Down
130 changes: 71 additions & 59 deletions frontend/src/Admin/AdminHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,74 +67,86 @@ const Header = () => {
<span> | {user.role}</span>
</div>
)}
<div className="user_icon" onBlur={closeProfileActions}>
<img
src={userIcon}
alt="User Icon"
onClick={toggleProfileActions}
/>
<div
className={`profile-actions ${
profileActionsVisible ? 'show_profileActions' : ''
}`}
ref={profileActionRef}
>
<div className="profile_link">
{user && (
<button
className="user_icon"
onBlur={closeProfileActions}
onClick={toggleProfileActions}
aria-label="User profile"
style={{
background: 'none',
border: 'none',
padding: 0,
margin: 0,
}}
>
<img src={userIcon} alt="User Icon" />
</button>
<div
className={`profile-actions ${
profileActionsVisible ? 'show_profileActions' : ''
}`}
ref={profileActionRef}
>
<div className="profile_link">
{user ? (
<Link
className="myprofile"
to="/myprofile"
style={{
textDecoration: 'none',
color: 'var(--primary-color)',
}}
onClick={closeProfileActions}
>
My Profile
</Link>
) : (
<>
<Link
className="myprofile"
to="/myprofile"
to="/signup"
style={{
textDecoration: 'none',
color: 'var(--primary-color)',
}}
onClick={closeProfileActions}
>
My Profile
SignUp
</Link>
)}
{!user ? (
<>
<Link
to="/signup"
style={{
textDecoration: 'none',
color: 'var(--primary-color)',
}}
onClick={closeProfileActions}
>
SignUp
</Link>
<Link
to="/login"
style={{
textDecoration: 'none',
color: 'var(--primary-color)',
}}
onClick={closeProfileActions}
>
Login
</Link>
</>
) : (
<>
<Link
to="#"
onClick={handleLogout}
style={{
textDecoration: 'none',
color: 'var(--primary-color)',
}}
>
Logout
</Link>
</>
)}
</div>
<Link
to="/login"
style={{
textDecoration: 'none',
color: 'var(--primary-color)',
}}
onClick={closeProfileActions}
>
Login
</Link>
</>
)}
{user && (
<button
onClick={handleLogout}
style={{
textDecoration: 'none',
color: 'var(--primary-color)',
background: 'none',
border: 'none',
padding: 0,
margin: 0,
}}
>
Logout
</button>
)}
</div>
</div>
<div className="mobile_menu">
<span className="menu_icon" onClick={menuToggle}>
<button
className="mobile_menu"
onClick={menuToggle}
aria-label="Toggle Menu"
>
<span className="menu_icon">
<svg
width="24"
height="24"
Expand Down Expand Up @@ -165,7 +177,7 @@ const Header = () => {
></path>
</svg>
</span>
</div>
</button>
</div>
</div>
</Row>
Expand Down
15 changes: 7 additions & 8 deletions frontend/src/Appointment.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ const AppointmentScheduler = () => {
};

// Payment Function
const [currentCardBackground, setCurrentCardBackground] = useState(
Math.floor(Math.random() * 25 + 1)
);
const [currentCardBackground] = useState(Math.floor(Math.random() * 25 + 1));
const [cardName, setCardName] = useState('');
const [cardNumber, setCardNumber] = useState('');
const [cardMonth, setCardMonth] = useState('');
Expand Down Expand Up @@ -387,8 +385,9 @@ const AppointmentScheduler = () => {
<p>{appointment.patient_number}</p>
</div>
))} */}
<label>Reason for Visit</label>
<label htmlFor="reason">Reason for Visit</label>
<input
id="reason"
className="ap-form-input"
name="reasonForVisit"
value={formValues.reasonForVisit}
Expand Down Expand Up @@ -494,12 +493,12 @@ const AppointmentScheduler = () => {
</div>
</label>
<div className="card-item__date">
<label className="card-item__dateTitle">
<span className="card-item__dateTitle">
Expires
</label>
<label className="card-item__dateItem">
</span>
<span className="card-item__dateItem">
{cardMonth || 'MM'}/{cardYear || 'YY'}
</label>
</span>
</div>
</div>
</div>
Expand Down
21 changes: 13 additions & 8 deletions frontend/src/Details.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
import styles from './Detail.module.css';
import { Link, useParams } from 'react-router-dom';
import { useParams } from 'react-router-dom'; // Removed unused 'Link'
import 'bootstrap/dist/css/bootstrap.min.css';
import axios from 'axios';
import { BASE_URL } from './config';
Expand Down Expand Up @@ -60,15 +60,19 @@ const Detail = () => {
<h5 className="mt-2 mb-0">Dr. {doctor.name}</h5>
<span>{doctor.education}</span>
<div className="px-4 mt-1">
<p className={styles.fonts} align="justify">
<p className={styles.fonts} style={{ textAlign: 'justify' }}>
{doctor.description}
</p>
<p align="left">Email: {doctor.email}</p>
<p align="left">Hospital: {doctor.hospital}</p>
<p align="left">Specialization: {doctor.specialization}</p>
<p align="left">Experience: {doctor.experience}</p>
<p align="left">Fees: {doctor.fees} INR</p>
<p align="left">Address: {doctor.location} </p>
<p style={{ textAlign: 'left' }}>Email: {doctor.email}</p>
<p style={{ textAlign: 'left' }}>Hospital: {doctor.hospital}</p>
<p style={{ textAlign: 'left' }}>
Specialization: {doctor.specialization}
</p>
<p style={{ textAlign: 'left' }}>
Experience: {doctor.experience}
</p>
<p style={{ textAlign: 'left' }}>Fees: {doctor.fees} INR</p>
<p style={{ textAlign: 'left' }}>Address: {doctor.location}</p>
</div>
</div>
</div>
Expand All @@ -77,4 +81,5 @@ const Detail = () => {
</div>
);
};

export default Detail;
Loading

0 comments on commit 3297a0a

Please sign in to comment.