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 all commits
Commits
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
Binary file added .DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions CYF-HOTEL-REACT/src/CustomerProfile.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react'

const CustomerProfile =(props) =>{
// if (props.customersProfile.vip === true)
return (
<div>
<p>Customer ID: { props.customersProfile.id}</p>
<p>Customer Email: { props.customersProfile.email}</p>
{props.customersProfile.vip && (<p>Customer Phone Number: { props.customersProfile.phoneNumber}</p>)}
</div>
)
}

export default CustomerProfile;
30 changes: 30 additions & 0 deletions CYF-HOTEL-REACT/src/Loading.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React, {useState} from 'react'
import ClipLoader from "react-spinners/ClipLoader";

const override = {
display: "block",
margin: "0 auto",
borderColor: "red",
};

function Loading() {

let [loading, setLoading] = useState(true);
let [color, setColor] = useState("#ffffff");

return (
<div className="sweet-loading">
<ClipLoader
color={color}
loading={loading}
cssOverride={override}
size={150}
aria-label="Loading Spinner"
data-testid="loader"
/>
</div>
)
}

export default Loading;

19 changes: 19 additions & 0 deletions CYF-HOTEL-REACT/src/Order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React, { useState } from 'react';
import RestaurantButton from './RestaurantButton';

function Order({orderType}) {
const [Orders, setOrders] = useState(0);

const orderOne = () => {
setOrders(Orders => Orders + 1);
};

return (
<li
className='li'>
{orderType}: {Orders} <RestaurantButton handleClick={orderOne} />
</li>
);
}

export default Order;
9 changes: 9 additions & 0 deletions CYF-HOTEL-REACT/src/RestaurantButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

function RestaurantButton({ handleClick }) {
return <button className='add' onClick={handleClick}>Add</button>;
}

export default RestaurantButton;


35 changes: 35 additions & 0 deletions CYF-HOTEL-REACT/src/Test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { useState } from "react";

const Test= ()=> {


const [showbutton,setShowbutton]= useState(true);
const [showalert,setShowalert]= useState(false);

const Alert =()=>{
return(
<div className="alert alert-warning alert-dismissible fade show" role="alert">
<p>this is my alert </p>
<button className="btn-close" aria-label="Close" onClick={handleclick}> close </button>
</div>)
}

const handleclick =()=> {

setShowbutton(!showbutton);
setShowalert(!showalert);

};

return(
<>
{
showbutton ? (<button className="btn btn-primary" onClick= {handleclick}>test </button> ): ( <Alert/> )
}

</>
);

}

export default Test;
File renamed without changes.
Binary file added cyf-hotel-react/5-stars.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Loading