Skip to content
This repository was archived by the owner on Feb 9, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fef7b0c
Exercise 1 to 3
Junitalama Jun 14, 2023
21492f0
Update App.css
Junitalama Jun 14, 2023
d388ab2
Update App.css
Junitalama Jun 14, 2023
25576fa
updated
Junitalama Jun 14, 2023
18950dd
Update TouristInfoCards.js
Junitalama Jun 14, 2023
6560f38
Update App.css
Junitalama Jun 14, 2023
eb3ff79
Update App.css
Junitalama Jun 14, 2023
c946f1d
Update TouristInfoCards.js
Junitalama Jun 14, 2023
26b54d3
Update App.css
Junitalama Jun 14, 2023
1dfa988
Update App.css
Junitalama Jun 14, 2023
cc961b1
Update App.css
Junitalama Jun 14, 2023
e42ed6c
updated exercise 7
Junitalama Jun 15, 2023
97d86a0
exercise 8
Junitalama Jun 15, 2023
2f391bf
FORMATTED
Junitalama Jun 26, 2023
123de22
Update TouristInfoCards.js
Junitalama Jun 26, 2023
8b696f8
level 2
Junitalama Jun 27, 2023
bd96a2e
15
Junitalama Jun 28, 2023
c821b78
search bar done
Junitalama Jul 7, 2023
c158c75
added cuctomer profile components
Junitalama Jul 7, 2023
839b935
added usestate for search
Junitalama Jul 7, 2023
6e6ae66
added new column and button to show customer profile
Junitalama Jul 7, 2023
dd1ee0b
added styling for show profile buuton
Junitalama Jul 7, 2023
0e83935
styling done for show profile
Junitalama Jul 7, 2023
b914cc1
added props in customerprofile component
Junitalama Jul 7, 2023
3b77b70
updated and display customer profile
Junitalama Jul 7, 2023
3e16fc3
exercise 21
Junitalama Jul 7, 2023
fad679e
updated formatting
Junitalama Jul 7, 2023
6f62c07
formatting
Junitalama Jul 7, 2023
46fe0f5
formatting
Junitalama Jul 7, 2023
87a7bf4
formatting
Junitalama Jul 7, 2023
5fe4c35
loading and error done
Junitalama Jul 10, 2023
c8c6cef
formatted
Junitalama Jul 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"moment": "^2.29.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "^5.0.1"
Expand Down
128 changes: 101 additions & 27 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,40 +1,19 @@
.App {
text-align: left;
}

.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 80px;
body {
background-color:aliceblue;
}

.App-header {
background-color: #222;
height: 50px;
padding: 20px;
background-color: black;
height: 60px;
color: white;
text-align: left;
font-family: Arial, Helvetica, sans-serif;
font-size: 1em;
font-weight: bold;
margin-bottom: 2rem;
}

.App-title {
font-size: 1.5em;
font-size: 10px;
}

.App-content {
padding-top: 20px;
font-size: large;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.search {
padding: 5px 0 20px 0;
}
Expand All @@ -53,5 +32,100 @@ tr {
}

.card {
display: flex;
flex-direction: row;
row-gap: 50px;
justify-content: space-around;
background-color: aliceblue;
}

.logo {
height: 70px;
width: 100px;
}

header {
display: flex;
flex-direction: row;
}

h2 {
font-weight: bold;
font-size: 30px;
text-align: flex-start;
color: plum;
}
.card-img-top {
height: 25rem;
width: 28rem;
}

.card-title{
color: white;
background-color: black;
font-size: 1rem;
}

.card-text {
display: flex;
flex-direction: column;
justify-content: space-between;
font-size: 1rem;
background-color: beige;
}
.card-body {
width: 18rem;
}

.btn-primary {
background-color: brown;
}

.welcome{
display: flex;
flex-direction: column;
font-size: 2rem;
}

.welcome-img{
display: flex;
max-width: auto;
height: 25rem;
border: 2px solid brown;
margin: 0rem 4rem 1rem 4rem;


}

.welcome-text{
text-align: center;
color: blueviolet;
}

.table {
background-color: black;

}

th{
color: brown;
}

td{
color: beige;
}

@media only screen and (max-width: 600px) {
.card {
flex-direction: column;
}
.welcome-img{
margin: 0;

}
.table {
width: 40%;
font-size: 10px;;
}

}
18 changes: 14 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
import React from "react";

import Heading from "./Heading";
import TouristInfoCard from "./TouristInfoCards";
import Bookings from "./Bookings";
import Restaurant from "./Restaurant"
import "./App.css";
import Footer from "./Footer";

const App = () => {
return (
<div className="App">
<header className="App-header">CYF Hotel</header>
const address = [
"123 Fake Street, London, E1 4UD",
"hello@fakehotel.com",
"0123 456789",
]
return (<div className="App">
<Heading />
<TouristInfoCard />
<Bookings />
<Restaurant />
<Footer props = {address} />
</div>
);
};
Expand Down
6 changes: 3 additions & 3 deletions src/Bookings.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import Search from "./Search.js";
// import SearchResults from "./SearchResults.js";
// import FakeBookings from "./data/fakeBookings.json";
import SearchResults from "./SearchResults.js";
import FakeBookings from "./data/fakeBookings.json";

const Bookings = () => {
const search = searchVal => {
Expand All @@ -12,7 +12,7 @@ const Bookings = () => {
<div className="App-content">
<div className="container">
<Search search={search} />
{/* <SearchResults results={FakeBookings} /> */}
<SearchResults results = {FakeBookings}/>
</div>
</div>
);
Expand Down
17 changes: 17 additions & 0 deletions src/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import react from "react";

const Footer = ({ props }) => {
return (
<div>
<footer>
<ul>
{props.map((prop) => {
return <li key={prop}>{prop}</li>;
})}
</ul>
</footer>
</div>
);
};

export default Footer;
10 changes: 10 additions & 0 deletions src/Heading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";
const Heading = () => {
const name = "CYF HOTEL"
return <header className="App-header">
<div><img src ="https://freesvg.org/img/1548468101.png" className = "logo"alt = "hotel-logo"></img></div>
<div><h2>{name}</h2></div>
</header>
}

export default Heading;
3 changes: 2 additions & 1 deletion src/Search.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import SearchButton from "./SearchButton";

const Search = () => {
return (
Expand All @@ -17,7 +18,7 @@ const Search = () => {
className="form-control"
placeholder="Customer name"
/>
<button className="btn btn-primary">Search</button>
<SearchButton />
</div>
</form>
</div>
Expand Down
7 changes: 7 additions & 0 deletions src/SearchButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";

const SearchButton = () => {
return <button className = "btn btn-primary">search</button>
}

export default SearchButton;
44 changes: 44 additions & 0 deletions src/SearchResults.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React from "react";
import moment from "moment";

const SearchResults = (props) => {
return (
<table class="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">Stay nights</th>
</tr>
</thead>
<tbody>
{props.results.map((result, index) => {
return (
<tr key={index}>
<th scope="row">{result.id}</th>
<td>{result.title}</td>
<td>{result.firstName}</td>
<td>{result.surname}</td>
<td>{result.email}</td>
<td>{result.roomId}</td>
<td>{result.checkInDate}</td>
<td>{result.checkOutDate}</td>
<td>{moment(result.checkOutDate).diff(
moment(result.checkInDate),
"days"
)}</td>
</tr>
);
})}
</tbody>
</table>
);
};

export default SearchResults;
38 changes: 38 additions & 0 deletions src/TouristInfoCards.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from "react";

const TouristInfoCard = () =>{
return <div class = "welcome">
<img src = "https://cache.marriott.com/content/dam/marriott-renditions/LONCH/lonch-suite-0167-hor-clsc.jpg?output-quality=70&interpolation=progressive-bilinear&downsize=572px:*" className = "welcome-img" alt="hotel-img"></img>
<p class = "welcome-text">Explore The World With Us!!!</p>
<div class="card">
<div>
<img src="https://peoplemakeglasgow.com/imager/general/45177/East-End-Glasgow-Cathedral-Image-Block_8dc3bdbc8660ad389ec95cdf9b15d797.jpg" class="card-img-top" alt="glasgow-pic"></img>
<div class="card-body">
<h5 class="card-title">Glasgow</h5>
<p class="card-text">You’re guaranteed to find accommodation in Glasgow which suits your taste and budget. Whether you’re looking for something uniquely Glaswegian, a trendy hotel, a vibrant hostel or a comfortable city centre apartment, you can be assured of a warm welcome.</p>
<a href="https://peoplemakeglasgow.com/" class="btn btn-primary">MORE INFO</a>
</div></div>
<div>
<img src="https://eu-assets.simpleview-europe.com/manchester2016/imageresizer/?image=%2Fdbimgs%2FManOne-03%284%29.jpg&action=Background_Overlay" class="card-img-top" alt="glasgow-pic"></img>
<div class="card-body">
<h5 class="card-title">Manchester</h5>
<p class="card-text">Manchester city centre is jam-packed with unique and eclectic restaurants, bars, shops, museums, galleries, hotels and places to stay whilst the surrounding Greater Manchester boroughs offer a patch-work of visitor experiences including quaint market towns, traditional pubs and beautiful green spaces and waterways to be explored on foot or bike. The city region is easily navigated, with great transport links both in and around Greater Manchester..</p>
<a href="https://www.visitmanchester.com/" class="btn btn-primary">MORE INFO</a>
</div></div>
<div>
<img src="https://cdn-lnp.dataweavers.io/-/media/images/london/visit/things-to-do/sightseeing/london-attractions/coca-cola-london-eye/the-london-eye-2-640x360.jpg?rev=95097c3d2aab47109d7b0e944c804d1b?mw=640&hash=EA6D4D5963997B5F368154E65A7FA187" class="card-img-top" alt="glasgow-pic"></img>
<div class="card-body">
<h5 class="card-title">London</h5>
<p class="card-text">Welcome to London! Discover the best of London with Visit London, the official guide to England’s exciting capital. Find things to do in London, from iconic sightseeing spots and fun-filled days out to top restaurants, theatre and unmissable London events. If you’re not able to visit just yet, plan ahead to make the most of your next visit.</p>
<a href="https://www.visitlondon.com/" class="btn btn-primary">MORE INFO</a>
</div>
</div>
</div>
</div>




}

export default TouristInfoCard;