Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaplanh/appointment_app
https://github.com/kaplanh/appointment_app
bootstrap5-grid conditional-css-import conditional-rendering filter map props-drilling react react-bootsrap react-bootstrap-form react-event-handlers react-icon responsive-design semantic-commits toggle usestate-hook
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kaplanh/appointment_app
- Owner: kaplanh
- Created: 2023-07-15T12:51:21.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-14T23:44:11.000Z (9 months ago)
- Last Synced: 2024-02-15T20:25:29.748Z (9 months ago)
- Topics: bootstrap5-grid, conditional-css-import, conditional-rendering, filter, map, props-drilling, react, react-bootsrap, react-bootstrap-form, react-event-handlers, react-icon, responsive-design, semantic-commits, toggle, usestate-hook
- Language: JavaScript
- Homepage: https://appointment-app-v1.netlify.app/
- Size: 620 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Appointment App
[:point_right: Click here to see on browser](https://appointment-app-v1.netlify.app/)
![appointment](https://github.com/kaplanh/Appointment_app/assets/101884444/63923413-ba65-4e73-a9b5-0ab6a696bcab)
---
| **What's used in this app ?** | **How use third party libraries** | **Author** |
| --------------------------------------------------------------------------------------- | ------------------------------------------ | -------------------------------------------------------------------------------- |
| [lifting state up](https://react.dev/learn/sharing-state-between-components) | | [Take a look at my portfolio](https://kaplanh.github.io/Portfolio_with_CssFlex/) |
| [useState() Hook](https://react.dev/learn#using-hooks) | | [Visit me on Linkedin](https://www.linkedin.com/in/kaplan-h/) |
| [react-events](https://react.dev/learn#responding-to-events) | | |
| [React-Conditional rendering](https://react.dev/learn#conditional-rendering) | | |
| [React-Bootstrap](https://react-bootstrap.netlify.app/) | npm i / yarn add react-bootstrap bootstrap | |
| [React-icons](https://react-icons.github.io/react-icons/) | npm i / yarn add react-icons | |
| [props-drilling](https://react.dev/learn#sharing-data-between-components) | | |
| [Semantic-Commits](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716) | | |
| Deploy with [Netlify](https://app.netlify.com/teams/kaplanh/sites) | | |---
## How To Run This Project π
### π» Install React π
```bash
yarn create react-app . or npx create-react-app .
```### π» Install Sass π
```bash
yarn add sass or npm i sass
```## π΄ Delete these files and delete the importsπ
- App.test.js
- reportWebVitals.js
- setupTests.js
- favicon.ico
- logo192.png
- logo512.png
- manifest.json
- robots.txt### π» Start the project π
```bash
yarn start or npm start
```OR
- Clone the Repo
```sh
git clone
```- Install NPM packages
```sh
npm install or yarn
```- Run the project
```sh
npm start or yarn start
```- Open the project on your browser
```sh
http://localhost:3000/
```- ### Enjoy! π
---
## Project Skeleton
```
Appointment App (folder)
|
|----public (folder)
β βββ index.html
|----src (folder)
| |--- components (folder)
β β βββ AddModal.jsx
β β βββ AppointmentList.jsx
β β βββ Doctors.jsx
β β
| |--- helpers (folder)
| | |ββ data.js
β β
β |--- pages (folder)
| | βββ Home.jsx
| |
β β--- App.js
β β--- App.css
β |--- index.js
β
β
|-- .gitignore
|ββ package-lock.json
βββ package.json
|ββ README.md
|ββ yarn.lock```
---
### At the end of the project, the following topics are to be covered;
- Lifting state up
````jsx
// src/Home.jsx
import Doctors from "../components/Doctors";
import AppointmentsList from "../components/AppointmentsList";
import { appointmentData } from "../helpers/data";
import { useState } from "react";const Home = () => {
const [appointments, setAppointments] = useState(appointmentData);
return (
WELLCOME TO OUR HOSPITAL
);
};export default Home;
// src/Doctors.jsx
const Doctors = ({apps,setApps}) => {
const [show, setShow] = useState(false);
const [drName, setDrName] = useState("");
// const handleImgClick = () => {
// setShow(true)
// }
return (// src/AppointmentList.jsx
const AppointmentList = ({ apps, setApps }) => {
console.log(apps);const handleDelete = (id) => {
setApps(apps.filter((item) => item.id !== id));
};const handleDoubleClick = (id) => {
setApps(
apps.map((item) =>
item.id === id ? { ...item, consulted: !item.consulted } : item
)
);
};
console.log(apps);
return (
``````
````
- conditional rendering + cconditional Css
```jsx
i {apps.length < 1 && (
)}{apps.map(({ id, patient, consulted, doctor, day }) => (
handleDoubleClick(id)}
>
{patient}
{doctor}
{day}
handleDelete(id)}
/>
))}
```- tiklananin id sine gΓΆre objenin icindeki boolean degeri degiline cevirme toggle yapma
```jsx
setApps(
apps.map((item) =>
item.id === id ? { ...item, consulted: !item.consulted } : item
)
);
};
```- tiklananin id sine gΓΆre filter ile silme
```jsx
const handleDelete = (id) => {{
setApps(apps.filter((item) => item.id !== id));
};
```- Css ::after
```css
.consulted::after {
content: "CONSULTED";
background-color: rgb(166, 18, 189);
color: white;
font-size: 2rem;
border-radius: 1rem;
position: absolute;
left: 50%;
top: 50%;
padding: 0.5rem;
transform: translate(-50%, -50%);
}
```- Semantic Commit Messages
See how a minor change to your commit message style can make you a better programmer.Format: ():
is optional
- Example
```
feat: add hat wobble
^--^ ^------------^
| |
| +-> Summary in present tense.
|
+-------> Type: chore, docs, feat, fix, refactor, style, or test.
```- More Examples:
- `feat`: (new feature for the user, not a new feature for build script)
- `fix`: (bug fix for the user, not a fix to a build script)
- `docs`: (changes to the documentation)
- `style`: (formatting, missing semi colons, etc; no production code change)
- `refactor`: (refactoring production code, eg. renaming a variable)
- `test`: (adding missing tests, refactoring tests; no production code change)
- `chore`: (updating grunt tasks etc; no production code change)---
## Feedback and Collaboration
I value your feedback and suggestions. If you have any comments, questions, or ideas for improvement regarding this project or any of my other projects, please don't hesitate to reach out.
I'm always open to collaboration and welcome the opportunity to work on exciting projects together.
Thank you for visiting my project. I hope you have a wonderful experience exploring it, and I look forward to connecting with you soon!β Happy Coding β