-
Notifications
You must be signed in to change notification settings - Fork 70
PTBC9-project1-Patrick #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
867726a
e7babe7
9f71a7a
56e4f54
4a0440e
b3ee3da
3c418f0
2eaee35
b10a393
c446539
d2109b1
a12fa30
3d9762d
24ddbcf
4a6db3b
69add4b
cf13fb7
63f32fe
b5b6592
7427e73
295dc3e
ea8f049
3d69343
ce7aba4
2df0c0f
d455ac6
c34c1ba
c2f214b
4607a72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,15 @@ Open [http://localhost:3000](http://localhost:3000) to view it in your browser. | |
|
|
||
| The page will reload when you make changes.\ | ||
| You may also see any lint errors in the console. | ||
|
|
||
| ### User stories | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. really nice user stories and wireframe |
||
|
|
||
| Kayla - A working woman in her 40s wanting to find a place to host her husband's 50th birthday at someplace special. She likes asian food and is adventerous when it comes to trying new things. She wants to determine whether initmatesuppers is a good place to host her husband's 50th birthday party and if she decides she likes the place, she will contact intimatesuppers for further enquiries. | ||
|
|
||
| Mike - A working adult who has found out about initmatesuppers from a friend, he wants to know more about how this private dining operates. He wants to determine if he can host his family there for dinner with 3 children below 5 years old for his family's Christmas dinner on the 25th of December. | ||
|
|
||
| Celina - The owner of intimatesuppers, she gets asked many questions about similar topics. She would like a place where she can refer potential customers to view information about the private dining and see answers to frequently asked questions. | ||
|
|
||
| ### Wireframe | ||
|
|
||
| https://www.figma.com/file/uBQ9qzYkmOFW529FQ53qDu/Bootcamp-Project-1-Idea?type=design&node-id=0%3A1&mode=design&t=p8Z5vPbbR15g5LX6-1 | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,18 +2,76 @@ | |
| text-align: center; | ||
| } | ||
|
|
||
| .App-logo { | ||
| height: 40vmin; | ||
| pointer-events: none; | ||
| .row { | ||
| margin-left: 0; | ||
| margin-right: 0; | ||
| } | ||
|
|
||
| .App-header { | ||
| background-color: #282c34; | ||
| min-height: 100vh; | ||
| .collapsed, | ||
| .navbar-toggler { | ||
| margin-right: 20px; | ||
| } | ||
|
|
||
| .dropdown-item { | ||
| text-align: center; | ||
| } | ||
|
|
||
| .navbar-brand { | ||
| margin-left: 20px; | ||
| } | ||
|
|
||
| .welcome { | ||
| height: 50vh; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .section-text-container { | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: center; | ||
| align-items: center; | ||
| height: 100%; | ||
| padding: 20px; | ||
| } | ||
|
|
||
| .welcome-msg { | ||
| background-color: #ffffff; | ||
| border-radius: 15px; | ||
| padding: 30px 50px; | ||
| } | ||
|
|
||
| .about { | ||
| padding-left: 3%; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is 3% padding? I think using percentages here can be confusing. I would rather use pixels |
||
| padding-right: 3%; | ||
| } | ||
|
|
||
| .curr-menu { | ||
| min-height: 600px; | ||
| } | ||
|
|
||
| .car-item { | ||
| background-size: cover; | ||
| background-position: center; | ||
| } | ||
|
|
||
| .car-caption { | ||
| background-color: rgba(0, 0, 0, 0.5); | ||
| padding: 10px 40px; | ||
| } | ||
|
|
||
| .date-container { | ||
| width: 100%; | ||
| display: flex; | ||
| justify-content: center; | ||
| font-size: calc(10px + 2vmin); | ||
| color: white; | ||
| } | ||
| .date-col { | ||
| width: 50%; | ||
| } | ||
|
|
||
| .follow { | ||
| background-color: #a6a6a6; | ||
| padding: 30px 0; | ||
| margin-bottom: -10px; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,113 @@ | ||
| //React Components | ||
| import React from "react"; | ||
| import logo from "./logo.png"; | ||
| import OurNav from "./Components/OurNav.js"; | ||
| import About from "./Components/About.js"; | ||
| import ImgDivider from "./Components/ImgDivider.js"; | ||
| import CurrMenu from "./Components/CurrMenu.js"; | ||
| import { Link } from "react-router-dom"; | ||
| import FAQ from "./Components/FAQ.js"; | ||
| import Follow from "./Components/Follow.js"; | ||
|
|
||
| //Images | ||
| import backgroundWide1 from "./images/backgroundWide1.jpg"; | ||
| import rendangCrostini from "./images/rendangCrostini.jpg"; | ||
|
|
||
| //CSS | ||
| import "./App.css"; | ||
|
|
||
| class App extends React.Component { | ||
| componentDidMount = () => { | ||
| // get id from URL | ||
| if (window.location.href.includes("#")) { | ||
| const urlList = window.location.href.split("#"); | ||
| const id = urlList[urlList.length - 1]; | ||
|
|
||
| document.querySelector(`#${id}`).scrollIntoView(); | ||
| } | ||
| }; | ||
|
|
||
| moveTo = (id) => { | ||
| document.querySelector(`#${id}`).scrollIntoView(); | ||
| }; | ||
|
Comment on lines
+21
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice hack you found here. However, for react, we don't want to directly select the DOM elements. Since we work with a shadow DOM, we want to work on that one instead. To do that, we can use a reference, short https://stackoverflow.com/questions/43441856/how-to-scroll-to-an-element |
||
|
|
||
| currDates = ( | ||
| <div className="section-text-container"> | ||
| <h1>Our Current Menu</h1> | ||
| <p> | ||
| It's the festive season! checkout our upcoming menu{" "} | ||
| {window.innerWidth < 992 ? "below the dates" : "to the left"} | ||
| </p> | ||
| <h3>Dinner dates:</h3> | ||
| <div className="date-container"> | ||
| <div className="date-col"> | ||
| <h4>Nov:</h4> | ||
| <p>8 to 11 (Wed to Sat)</p> | ||
| <p>15 to 18 (Wed to Sat)</p> | ||
| <p>22 to 25 (Wed to Sat)</p> | ||
|
Comment on lines
+44
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoding this is fine for now. Later it would be good to make this dynamic! Maybe have a calendar of sorts, and print the Wed to Saturday dates there for whichever months you are listing here. Maybe you could also make it the whole year with a collapsible to show everything beyond the current 2 months? You can probably achieve this with the library |
||
| </div> | ||
| <div className="date-col"> | ||
| <h4>Dec:</h4> | ||
| <p>6 to 9 (Wed to Sat)</p> | ||
| <p>13 to 16 (Wed to Sat)</p> | ||
| <p>22 & 23 (Fri & Sat)</p> | ||
| <p>29 & 30 (Fri & Sat)</p> | ||
| </div> | ||
| </div> | ||
| <p> | ||
| $148/pax, BYOB no corkage charges! Reservations in groups of 6 to 12 pax | ||
| from 7pm till 10.30pm | ||
| </p> | ||
| <p> | ||
| for 8pax or more, additional mains will be served as indicated in the | ||
| menu | ||
| </p> | ||
|
|
||
| <Link to="/project1-bootcamp/book" className="btn btn-dark"> | ||
| Book Now! | ||
| </Link> | ||
| </div> | ||
| ); | ||
|
|
||
| render() { | ||
| return ( | ||
| <div className="App"> | ||
| <header className="App-header"> | ||
| <img src={logo} className="App-logo" alt="logo" /> | ||
| <p> | ||
| Edit <code>src/App.js</code> and save to reload. | ||
| </p> | ||
| </header> | ||
| <div className="App container-fluid p-0 m-0"> | ||
| <div className="row"> | ||
| <OurNav /> | ||
| </div> | ||
| <div className="row"> | ||
| <div | ||
| className="col-12 welcome" | ||
| style={{ | ||
| backgroundImage: `url(${backgroundWide1})`, | ||
| backgroundSize: "cover", | ||
| backgroundPosition: "center", | ||
| }} | ||
| ></div> | ||
| </div> | ||
| <div className="row" id="about"> | ||
| <div className="col-lg-6 p-0"> | ||
| <About /> | ||
| </div> | ||
| <ImgDivider img={rendangCrostini} /> | ||
| </div> | ||
| <div className="row" id="curr-menu"> | ||
| <div className="col-lg-6 col-sm-12 d-lg-none p-0"> | ||
| {this.currDates} | ||
| </div> | ||
| <div className="col-lg-6 p-0"> | ||
| <CurrMenu /> | ||
| </div> | ||
| <div className="col-lg-6 col-sm-12 d-lg-block d-none p-0"> | ||
| {this.currDates} | ||
| </div> | ||
| </div> | ||
| <div className="row" id="faq"> | ||
| <FAQ /> | ||
| </div> | ||
|
|
||
| <div id="follow" className="follow"> | ||
| <Follow /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| //React Components | ||
| import React from "react"; | ||
|
|
||
| class About extends React.Component { | ||
| render() { | ||
| return ( | ||
| <div className="section-text-container about"> | ||
| <h1>About Us</h1> | ||
| <p> | ||
| Welcome to our home in Upper Thomson where I, Celina and my Hubs, Kok | ||
| will cook for you! Our food is inspired by the big bold flavours of | ||
| Asia, and fueled by our passion for cooking and creating. | ||
| </p> | ||
| <p> | ||
| Each menu is designed to highlight specific regions in Asia like | ||
| Indonesia, South Asia, Indochina and North Asia. The process starts | ||
| with researching the cuisine, then cooking, adapting and reinventing | ||
| the dish to a version we like. There is a large variety and abundance | ||
| of fresh Asian herbs and spices in our local markets and it’s a joy | ||
| finding new ways of using them. We focus on dishes less common among | ||
| the local restaurants, so that your experience here can be a | ||
| refreshing, food adventure! | ||
| </p> | ||
| <p> | ||
| We host intimatesuppers in our home near Old Upper Thomson Road, among | ||
| the lush greenery of Pierce Reservoir. Guests can sit out on our patio | ||
| to enjoy their drinks before dinner begins. | ||
| </p> | ||
| <p>We hope to see you here soon!</p> | ||
| </div> | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| export default About; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| //React components | ||
| import React from "react"; | ||
| import Carousel from "react-bootstrap/Carousel"; | ||
|
|
||
| //images | ||
| import festMenu from "../images/current-menu/festive-menu.png"; | ||
| import bruleePork from "../images/current-menu/brulee-pork-belly.jpg"; | ||
| import yellowCurryBakedFish from "../images/current-menu/yellow-curry-baked-fish.jpg"; | ||
| import asianTrifle from "../images/current-menu/asian-trifle.jpg"; | ||
|
|
||
| class CurrMenu extends React.Component { | ||
| currMenuTitleList = [ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice use of a data structure. Since this is all static information though, I would define it outside of the component so it doesn't need to get redefined on every re-render |
||
| { | ||
| image: festMenu, //image item here | ||
| caption: false, | ||
| }, | ||
| { | ||
| image: bruleePork, //image item here | ||
| caption: true, | ||
| title: "Brulee Pork Belly", | ||
| description: | ||
| "Plump pork belly with brule skin, served with homemade kimchi.", | ||
| }, | ||
| { | ||
| image: yellowCurryBakedFish, //image item here | ||
| caption: true, | ||
| title: "yellow Curry Baked Fish", | ||
| description: | ||
| "This fish is backed to lock in the flavours and moisture resulting in a juicy and flavourful fish each time.", | ||
| }, | ||
| { | ||
| image: asianTrifle, //image item here | ||
| caption: true, | ||
| title: "Asian Trifle", | ||
| description: "Our unique asian style trifle to finish of the meal.", | ||
| }, | ||
| ]; | ||
| render() { | ||
| return ( | ||
| <Carousel interval={10000}> | ||
| {this.currMenuTitleList.map((object, index) => ( | ||
| <Carousel.Item key={index}> | ||
| <div | ||
| className="curr-menu car-item" | ||
| style={{ backgroundImage: `url(${object.image})` }} | ||
| ></div> | ||
|
Comment on lines
+43
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not use |
||
| {object.caption && ( | ||
| <Carousel.Caption className="car-caption"> | ||
| <h3>{object.title}</h3> | ||
| <p>{object.description}</p> | ||
| </Carousel.Caption> | ||
| )} | ||
| </Carousel.Item> | ||
| ))} | ||
| </Carousel> | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| export default CurrMenu; | ||
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.
Please also include how to install your dependencies to get the project going