This repository was archived by the owner on Feb 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 761
Glasgow - Class 6 --- Rahma - Appolin - Nasir --- React - Hotel Group Project #596
Open
ali-nasir-ali
wants to merge
64
commits into
CodeYourFuture:master
Choose a base branch
from
ali-nasir-ali:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
74af1f2
made ahead file
ali-nasir-ali e0d41eb
header component with style
RahmaB1 0257298
Added the TouristInfoCards component
AppolinFotso 70f92f1
Updated the TouristInfoCards component
AppolinFotso 7dcfbee
5-hard coded table
RahmaB1 4da9cb5
Merge pull request #1 from ali-nasir-ali/1---header-component
ali-nasir-ali 3109c9c
worked on search
ali-nasir-ali 3253a15
Merge pull request #2 from ali-nasir-ali/2---search
ali-nasir-ali fa9a338
Merge branch 'master' into 3--TouristInfoCards
ali-nasir-ali f381ce9
Merge pull request #3 from ali-nasir-ali/3--TouristInfoCards
ali-nasir-ali f61fb11
Added images for TouristInfoCards
AppolinFotso cd3fa43
done footer component
ali-nasir-ali 5375053
Added Style to TouristInfoCards
AppolinFotso 2f99fdd
try to fix the header
ali-nasir-ali 8547239
done footer eror
ali-nasir-ali 5537041
Merge pull request #5 from ali-nasir-ali/4---Footer
ali-nasir-ali 88711ab
trying to fix header
ali-nasir-ali 88628f3
Merge branch 'master' into 5---table-to-show-hotel-bookings---component
ali-nasir-ali 2034cf5
Merge pull request #6 from ali-nasir-ali/5---table-to-show-hotel-book…
ali-nasir-ali 95a0f6e
Added FakeBookings file to Bookings component
AppolinFotso 4eb8e6c
Used props in SearchResults to populate the table
AppolinFotso 99617b9
Merge pull request #7 from ali-nasir-ali/6--Using_props_to_pass_fakeB…
ali-nasir-ali 71d5def
fixed footer css
ali-nasir-ali 2a406b7
added favicon
ali-nasir-ali da02c93
8-done
RahmaB1 e0b95d9
Merge pull request #8 from ali-nasir-ali/8--2--render-restaurant-comp…
ali-nasir-ali 3d3eeb5
Added orders state variable to Restaurant component
AppolinFotso 773d44b
7
RahmaB1 925d1bc
Merge pull request #10 from ali-nasir-ali/7-calculate-number-of-nights
ali-nasir-ali ca4a042
Merge pull request #9 from ali-nasir-ali/9--Adding-the-state-variable…
ali-nasir-ali e31faf4
orders tallyho
ali-nasir-ali 7900e86
Merge pull request #11 from ali-nasir-ali/9---preparing-to-add-pizza
ali-nasir-ali 4272e77
11-extract-add-button
RahmaB1 eeaa590
Merge pull request #12 from ali-nasir-ali/11-extract-add-button
ali-nasir-ali 4c63c28
Created Order component
AppolinFotso b2cfaf0
Added RestaurantButton to Order component
AppolinFotso 650ddc0
Merge pull request #13 from ali-nasir-ali/12--extra-pizza-order-to-it…
ali-nasir-ali 6996d85
added more items, fixed adding error
ali-nasir-ali 90641f1
Merge pull request #14 from ali-nasir-ali/13---Render-more-orders
ali-nasir-ali ae06bd3
Added event handler and some style
AppolinFotso ca2b9e4
17 - Storing the search input in a state
RahmaB1 5921bfe
Added EachRowInSearchResults component and a state variable
AppolinFotso 456f8cd
Merge pull request #16 from ali-nasir-ali/15--Highlight-booking-row-w…
AppolinFotso 67a0447
Merge pull request #15 from ali-nasir-ali/17-storing-the-search-input…
RahmaB1 f5b6942
Added onSubmit event handler on the form
AppolinFotso 036ceed
Merge pull request #17 from ali-nasir-ali/18--Triggering-search-when-…
AppolinFotso 52a6712
added api capabilities
ali-nasir-ali 45d081e
Merge pull request #18 from ali-nasir-ali/16---load-booking-romotly
ali-nasir-ali 5d78cb2
testing the search parameter, not working now
ali-nasir-ali be87d0d
its working now
ali-nasir-ali 61dbdc1
Merge pull request #19 from ali-nasir-ali/19---implementing-search-fu…
ali-nasir-ali d708716
update 20
RahmaB1 14f8d90
update
RahmaB1 8ae5853
update
RahmaB1 4c74e23
update
RahmaB1 5c11cf0
update passing props
RahmaB1 18d14cc
update
RahmaB1 cd9e33e
Merge pull request #21 from ali-nasir-ali/20---3----Display-a-custome…
RahmaB1 5234e91
Added some functionality to show prile button and customerProfile com…
AppolinFotso be53476
Merge pull request #22 from ali-nasir-ali/21--Display-a-customer-prof…
AppolinFotso 1f36aa3
Added the error message when url not working
AppolinFotso 16cd452
Merge pull request #23 from ali-nasir-ali/23--display-error-message
AppolinFotso 1a4cad0
added the loading wheel for when api taking time
ali-nasir-ali 0fdc503
Merge pull request #24 from ali-nasir-ali/22---Show-a-loading-message
ali-nasir-ali File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
Binary file not shown.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import React, { useState, useEffect } from "react"; | ||
| import "./App.css"; | ||
|
|
||
| function CustomerProfile(props) { | ||
| const [customer, setCustomer] = useState({}); | ||
| useEffect(() => { | ||
| fetch(`https://cyf-react.glitch.me/customers/${props.customerId}`) | ||
| .then((response) => response.json()) | ||
| .then((data) => setCustomer(data)); | ||
| }, [props.customerId]); | ||
| return ( | ||
| <div className={props.view}> | ||
| <div className="profile-container"> | ||
| <p className="profile">{props.customerProfile}</p> | ||
| <p>ID: {props.customerId}</p> | ||
| <p>Email: {customer.email}</p> | ||
| <p>VIP: {customer.vip ? "Yes" : "No"}</p> | ||
| <p>Tel: {customer.phoneNumber}</p> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default CustomerProfile; |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import react, { useState } from "react"; | ||
|
|
||
| function EachRowInSearchResults(props) { | ||
| const [switchMe, setSwitchMe] = useState("off"); | ||
|
|
||
| function handleClick() { | ||
| if (switchMe === "off") { | ||
| setSwitchMe("on"); | ||
| } else { | ||
| setSwitchMe("off"); | ||
| } | ||
| } | ||
|
|
||
| function handleShowProfile() { | ||
| props.setCustomerId(props.booking.id); | ||
| props.setCustomerProfile("Customer Profile"); | ||
| if (props.view === "viewOff") { | ||
| props.setView("viewOn"); | ||
| } else { | ||
| props.setView("viewOff"); | ||
| } | ||
| } | ||
|
|
||
| return ( | ||
| <tr className={switchMe} onClick={handleClick}> | ||
| <th scope="row">{props.booking.id}</th> | ||
| <td>{props.booking.title}</td> | ||
| <td>{props.booking.firstName}</td> | ||
| <td>{props.booking.surname}</td> | ||
| <td>{props.booking.email}</td> | ||
| <td>{props.booking.roomId}</td> | ||
| <td>{props.booking.checkInDate}</td> | ||
| <td>{props.booking.checkOutDate}</td> | ||
| <td>{props.numberOfNights}</td> | ||
| <td> | ||
| <button onClick={handleShowProfile} className="btn btn-primary"> | ||
| Show Profile | ||
| </button> | ||
| </td> | ||
| </tr> | ||
| ); | ||
| } | ||
|
|
||
| export default EachRowInSearchResults; | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import React from "react"; | ||
|
|
||
| // address | ||
| const props = ["123 Fake Street, London, E1 4UD", "hello@fakehotel.com", "0123 456789"]; | ||
|
|
||
| const Footer = () => { | ||
| return ( | ||
| <footer className="footer"> | ||
| <ul> | ||
| {props.map((props) => ( | ||
| <p key={props}>{props}</p> | ||
| ))} | ||
| </ul> | ||
| </footer> | ||
| ); | ||
| }; | ||
| // footer export | ||
| export default Footer; |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import React from "react"; | ||
| import "./App.css"; | ||
|
|
||
| function Heading() { | ||
| return ( | ||
| <> | ||
| <header className="App-header">CYF Hotel</header> | ||
| <img | ||
| className="hotel-logo" | ||
| src="https://img.freepik.com/free-vector/golden-elegant-logo-template-with-ornaments_23-2148212128.jpg?w=900&t=st=1686937700~exp=1686938300~hmac=96cba09c7292154b8447b7c54e0d24116ed3c8fc0a2ec07ffc4ac28cab762b20" | ||
| ></img> | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| export default Heading; |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import React, { useState } from "react"; | ||
| import RestaurantButton from "./RestaurantButton"; | ||
|
|
||
| function Order(props) { | ||
| const [orders, setOrders] = useState(0); | ||
| function orderOne() { | ||
| setOrders(orders + 1); | ||
| } | ||
| return ( | ||
| <p> | ||
| {props.orderType}: {orders} <RestaurantButton orderOne={orderOne} /> | ||
| </p> | ||
| ); | ||
| } | ||
|
|
||
| export default Order; |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import React from "react"; | ||
|
|
||
| const RestaurantButton = ({ orderOne }) => { | ||
| return ( | ||
| <> | ||
| <button className="btn btn-primary" onClick={orderOne}> | ||
| Add | ||
| </button> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default RestaurantButton; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
destructuring the object here would be nice, you dont have to type
props.booking.on every line