This repository has been archived by the owner on Feb 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 767
Glasgow Class 6 - Christina Mifsud - React - Hotel React #611
Open
christina-mifsud
wants to merge
11
commits into
CodeYourFuture:master
Choose a base branch
from
christina-mifsud:christina
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
11 commits
Select commit
Hold shift + click to select a range
a7ee988
Exercise 1-3
christina-mifsud a722aa6
Exercise 4-6
christina-mifsud 81d8e3c
Exercise 7
christina-mifsud 1818c0d
Exercise 8-10
christina-mifsud 4b5677f
Exercise 11-12
christina-mifsud 96f132a
Exercise 13-14
christina-mifsud a730df1
Level 15 - WIP
christina-mifsud 4be4dec
Exercise 15-16
christina-mifsud 08c0174
Exercise 18-19
christina-mifsud e98a76e
Updated Bookings.js
christina-mifsud 2014af6
Collaboration Note
christina-mifsud 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 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 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 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 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 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,22 @@ | ||
import React from "react"; | ||
|
||
const footerArray = [ | ||
"123 Fake Street, London, E1 4UD", | ||
"[email protected]", | ||
"0123 456789", | ||
]; | ||
|
||
function Footer() { | ||
const footerAddress = footerArray.map((item, index) => { | ||
return ( | ||
<> | ||
<ul className="footer"> | ||
<li key={index}>{item}</li> | ||
</ul> | ||
</> | ||
); | ||
}); | ||
return <>{footerAddress}</>; | ||
} | ||
|
||
export default Footer; |
This file contains 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,15 @@ | ||
import React from "react"; | ||
|
||
function Header() { | ||
return ( | ||
<> | ||
<header className="App-header">CYF Hotel</header> | ||
<img | ||
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAACOElEQVR4nO2Yz0tVQRTHPyllZroQlGjlJvofXLbKwMCFWgshly3d6a42aUG5a9m+VrkrBRUfQgrlwlWh6EYRMYNCUBFvDJwX0zjvNjP3zauX84EDl/vOjzkz33vnvoFELs+Ap9Qhd4EJ4IfYONBLHTEFZIa9pY4k0gysa4Nfl3uu8f+ERLaBHbEtS7yKKcdP1FpiLhLpAa4CrXLtGx8VV4nEiveikk7zJOKCHr/tUbdqOs+TSAswAmzK7KrrK4aPimmVHLc96joTotM2YAzYtcSqe6PiU+26VpQm1xx12g48AvYtxU3bF18VE/35+JNOm4AnwHfLQDeAh2Iblt9VjJJHZ4Tn64zOTZ2WGbcM7DPwALio+anrYeCLxf8AmASue9QNpk2SlnmsDWQVuA805sQ3is+qpZFD4CXQRQRuAK+AY+AbcFPuX5LZVrN0wSNfA9AHfLQ0ciy1VM3CXJb38YlRRA26WtwBFi2NnMg+oJ6zINSMvrEkfufwKgzhFjBrqffac3V/cc9INA10E59u4L1RezAk0byW4Dm154VWfy4kwVctQQe1p1OrvxeSQF/Cv0VWZAyVgm1vjFIknyxGA5W+cWL7eJMaIK0AUSRUsszuQiSfLEYDtSRLDZBWoBBZ2olJOzHpU4L0LfQ7aSf2IDvXO/GRFlzpIDYm7capnTfLOf+aQm0FuKbVGHA80V4KPTE7jdDEkFZjxsH/tMgBb490r8upiH0yVqA/ZwVUzQ/VPp1OJP43fgLjrG5cINjubQAAAABJRU5ErkJggg==" | ||
alt="Hotel Logo" | ||
></img> | ||
</> | ||
); | ||
} | ||
|
||
export default Header; |
This file contains 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,23 @@ | ||
import React, { useState } from "react"; | ||
import RestaurantButton from "./RestaurantButton"; | ||
|
||
const numberPizzas = 0; | ||
|
||
function Order({ orderType }) { | ||
const [orders, setOrders] = useState(numberPizzas); | ||
|
||
function orderOne() { | ||
setOrders(orders + 1); | ||
} | ||
|
||
return ( | ||
<> | ||
<li> | ||
{orderType}: {orders} | ||
<RestaurantButton setOrders={orderOne} /> | ||
</li> | ||
</> | ||
); | ||
} | ||
|
||
export default Order; |
This file contains 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 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, { useState } from "react"; | ||
|
||
function RestaurantButton({ setOrders }) { | ||
return ( | ||
<> | ||
<button className="btn btn-primary" onClick={setOrders}> | ||
Adddddddddd | ||
</button> | ||
</> | ||
); | ||
} | ||
|
||
export default RestaurantButton; |
This file contains 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 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,7 @@ | ||
import React from "react"; | ||
|
||
function SearchButton() { | ||
return <button className="btn btn-primary">Search</button>; | ||
} | ||
|
||
export default SearchButton; |
This file contains 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,32 @@ | ||
import React, { useState } from "react"; | ||
import moment from "moment"; | ||
|
||
function SearchResultRow({ booking }) { | ||
const [isRowSelected, SetIsRowSelected] = useState(); | ||
|
||
const handleClick = (rowId) => { | ||
SetIsRowSelected(!isRowSelected); | ||
}; | ||
|
||
let rowStyle = {}; | ||
|
||
if (isRowSelected) { | ||
rowStyle = { backgroundColor: "green" }; | ||
} | ||
|
||
return ( | ||
<tr onClick={handleClick} style={rowStyle} key={booking.id}> | ||
<td>{booking.id}</td> | ||
<td>{booking.title}</td> | ||
<td>{booking.firstName}</td> | ||
<td>{booking.surname}</td> | ||
<td>{booking.email}</td> | ||
<td>{booking.roomId}</td> | ||
<td>{booking.checkInDate}</td> | ||
<td>{booking.checkOutDate}</td> | ||
<td>{moment(booking.checkOutDate).diff(booking.checkInDate, "days")} </td> | ||
</tr> | ||
); | ||
} | ||
|
||
export default SearchResultRow; |
This file contains 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,31 @@ | ||
import React, { useState } from "react"; | ||
import SearchResultRow from "./SearchResultRow"; | ||
|
||
function SearchResults({ bookingsArray }) { | ||
return ( | ||
<> | ||
<table className="table"> | ||
<thead> | ||
<tr> | ||
<th scope="col">ID</th> | ||
<th scope="col">Title</th> | ||
<th scope="col">First Name</th> | ||
<th scope="col">Surname</th> | ||
<th scope="col">Email</th> | ||
<th scope="col">Room ID</th> | ||
<th scope="col">Check-In Date</th> | ||
<th scope="col">Check-Out Date</th> | ||
<th scope="col">Nights</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{bookingsArray.map((booking) => ( | ||
<SearchResultRow booking={booking} key={booking.id} /> | ||
))} | ||
</tbody> | ||
</table> | ||
</> | ||
); | ||
} | ||
|
||
export default SearchResults; |
This file contains 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,73 @@ | ||
import React from "react"; | ||
|
||
function TouristInfoCards() { | ||
return ( | ||
<> | ||
<div className="card-container"> | ||
<div className="card"> | ||
<img | ||
src="https://a.cdn-hotels.com/gdcs/production95/d16/cc514640-8f0f-11e8-9bad-0242ac110002.jpg" | ||
className="card-img-top" | ||
alt="Glasgow View" | ||
/> | ||
<div className="card-body"> | ||
<h1>Glasgow</h1> | ||
<p> | ||
As Scotland’s largest city, Glasgow is famed for its culture, | ||
shopping and people. Spend your day exploring a wide range of | ||
fascinating free museums and galleries, and taking advantage of | ||
tips from friendly local people on the city’s hidden gems — then | ||
choose from 130+ weekly musical events for a special night out. | ||
</p> | ||
<a href="www.peoplemakeglasgow.com" className="btn btn-primary"> | ||
More Information | ||
</a> | ||
</div> | ||
</div> | ||
<div className="card"> | ||
<img | ||
src="https://cdn.britannica.com/42/116342-050-5AC41785/Manchester-Eng.jpg" | ||
className="card-img-top" | ||
alt="Manchester View" | ||
/> | ||
<div className="card-body"> | ||
<h1>Manchester</h1> | ||
<p> | ||
Famed for its soccer team and music scene, which has produced the | ||
likes of The Smiths and Oasis, this centre for sports and the arts | ||
is a down-to-earth and friendly city. The so-called Capital of the | ||
North has overcome industrial decline and bombing to become a | ||
confident and cosmopolitan city of over two million people. | ||
</p> | ||
<a href="www.visitmanchester.com" className="btn btn-primary"> | ||
More Information | ||
</a> | ||
</div> | ||
</div> | ||
<div className="card"> | ||
<img | ||
src="https://s27363.pcdn.co/wp-content/uploads/2020/05/Best-Things-to-do-in-London-1200x900.jpg.optimal.jpg | ||
" | ||
className="card-img-top" | ||
alt="London View" | ||
/> | ||
<div className="card-body"> | ||
<h1>London</h1> | ||
<p> | ||
London is layered with history, where medieval and Victorian | ||
complement a rich and vibrant modern world. The Tower of London | ||
and Westminster neighbour local pubs and markets, and time-worn | ||
rituals like the changing of the guards take place as commuters | ||
rush to catch the Tube. | ||
</p> | ||
<a href="www.visitlondon.com" className="btn btn-primary"> | ||
More Information | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default TouristInfoCards; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
consider destructuring the booking object instead of calling it every time