Skip to content

Commit

Permalink
Merge pull request #5 from aline-camargo/refactoring
Browse files Browse the repository at this point in the history
arrumando nome das tags e refatorando
  • Loading branch information
aline-camargo authored Dec 16, 2019
2 parents 79dc331 + a87940b commit 6ff8846
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 64 deletions.
18 changes: 18 additions & 0 deletions .firebase/hosting.YnVpbGQ.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
404.html,1576449258965,b7bab6b83fa074653ff28c8d2a64135d3434575f70a12ab3d3ba8080461b9537
asset-manifest.json,1576449282045,3dbee8a42cddb604b77eda6e3a2b5084f32a1b6e9c22a5d41522f57cd8ecbe8d
index.html,1576449282045,9f49774f726cd21e794aeee7a2a068eabe1f0daceecb37138564db61c05fd712
manifest.json,1576449258965,0958a5e0c831126100c8c2d06a6bbaa665a3900f21aaff4130238a6f5a113aa1
precache-manifest.8fea6fd5faa3d138de95e5328dd6220b.js,1576449282045,9021ec62ebb6e6360e757c68c0438ee3db2db21328e3c3f47f2c9ca1fa1f02c2
robots.txt,1576449258965,9486af852ce71d8ddbb9bc5bd6f7a3e45740f8c66ee724d1ae2bcc4dd7d3ded0
service-worker.js,1576449282045,9ac9887713cc6db56cfe892b1115b815d21dca8fc689a5542b2896fe8169b328
static/css/2.1782e1af.chunk.css,1576449282077,7c03b2a60c0d33ba616274cc019d1106d4229c45b250212350dbdd5ffc87e30d
static/css/2.1782e1af.chunk.css.map,1576449282077,60ae9a276975176ae868b67392a1765d21d7558f41d96207ab65937e95c1d7be
static/css/main.18ee9d4f.chunk.css,1576449282045,c8395b3490a80e49bbea7e91b6f7b546b35b4639fe75986478ea9e4743e21fb1
static/css/main.18ee9d4f.chunk.css.map,1576449282077,4c6685bba5cdc4ce0f9a8dbd25c109ee41c1e1da2d7dc399415922abb186a236
static/js/2.b5ad3f65.chunk.js,1576449282077,680fb1baf71381c0537ed6f0572f7c528a04d80851b3bab71b8d39d78fad626f
static/js/2.b5ad3f65.chunk.js.LICENSE,1576449282077,344b56f1ce8d1a571be956b7f3a43b6aec5ddfcf1d47b33acbe550606151b354
static/js/2.b5ad3f65.chunk.js.map,1576449282077,19346c339d07e40707f3d8bf101b736a3988864998a71cb580802825ff11b3f2
static/js/main.46da3ee9.chunk.js,1576449282045,6519a583375f8958fc6b45e81378fb3057f5d43250086d886484919c5181a559
static/js/main.46da3ee9.chunk.js.map,1576449282077,041ab63cd64d6910d8809b5ce7b5cc351b9c591ff4c27caef8b8ebb272411b58
static/js/runtime-main.398d5181.js,1576449282077,3ec02545d7ef1d57ab795cf5864b16260be46134cee03b5d181727d60850b866
static/js/runtime-main.398d5181.js.map,1576449282077,27ec7576d5eb447a174aad017051dc022edd6662135261d8c02a6f90e3399809
4 changes: 4 additions & 0 deletions .firebase/hosting.cHVibGlj.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
404.html,1576001854260,b7bab6b83fa074653ff28c8d2a64135d3434575f70a12ab3d3ba8080461b9537
manifest.json,1576000606328,0958a5e0c831126100c8c2d06a6bbaa665a3900f21aaff4130238a6f5a113aa1
index.html,1576449010675,f4dbda5ae9bfa515c5cd1fa11bf3f56340b8a31567332bc4817999ef857b88e7
robots.txt,1576000606332,9486af852ce71d8ddbb9bc5bd6f7a3e45740f8c66ee724d1ae2bcc4dd7d3ded0
2 changes: 1 addition & 1 deletion firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"indexes": "firestore.indexes.json"
},
"hosting": {
"public": "public",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "burguer-queen",
"version": "0.1.0",
"private": true,
"homepage": "https://lab-burguer-queen.firebaseapp.com",
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.26",
"@fortawesome/free-regular-svg-icons": "^5.12.0",
Expand Down
39 changes: 19 additions & 20 deletions src/components/MenuArea/MenuArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,26 @@ const MenuArea = (props) => {

return (
<main className={css(styles.main)}>
<div className={css(styles.ul)}>
<Tabs
id='#cafe'
title= 'Café da manhã'
onClick={handleClick}
active={true}
<div className={css(styles.ul)}>
<Tabs
id='#cafe'
title= 'Café da manhã'
onClick={handleClick}
active={true}
/>
<Tabs
id='#almoco'
title= 'Almoço e Jantar'
onClick={handleClick}
active={false}
/>
</div>
<TabContent
show={showItems}
onClickItem={props.onClickItem}
onClickBurguer={props.onClickBurguer}
onChange={props.onChange}
/>
<Tabs
id='#almoco'
title= 'Almoço e Jantar'
onClick={handleClick}
active={false}
/>
</div>
<TabContent
show={showItems}
onClick={props.onClick}
onChange={props.onChange}
functionOk={props.functionOk}
functionCancel={props.functionCancel}
/>
</main>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/headerList.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { StyleSheet, css } from 'aphrodite/no-important';

const HeaderList = () => {
const HeaderList = () => {
return (
<div className={css(styles.navList, styles.big)} id="navbarNav">
<ul className={css(styles.navbar)}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import HeaderList from './headerList';
const Navbar = () => {
const handleClick = (e) => {
const listDisplay = e.currentTarget.nextElementSibling.nextElementSibling.style;
if (listDisplay.display === 'none') {
if (!listDisplay.display || listDisplay.display === 'none') {
listDisplay.display = 'block';
// maxHeight: '200px';
// transition: 'max-height 1s ease-in-out';
Expand Down
38 changes: 19 additions & 19 deletions src/components/OrderResume/OrderResume.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ const ResumeArea = (props) => {
const [ table, setTable ] = useState('');

const handleSubmit = () => {
const notification = (props) => {
store.addNotification({
title: props.title,
message: props.message,
type: props.type,
insert: "top",
container: "top-center",
animationIn: ["animated", "fadeInDown"],
animationOut: ["animated", "fadeOutUp"],
dismiss: {
duration: 1500,
}
});
}

db.collection('new-order').add({
client: client,
Expand All @@ -20,35 +34,21 @@ const ResumeArea = (props) => {
time: new Date().getTime(),
})
.then(() =>{
store.addNotification({
notification({
title: "Pedido enviado com sucesso!",
message: "Obrigada!",
type: "success",
insert: "top",
container: "top-center",
animationIn: ["animated", "fadeInDown"],
animationOut: ["animated", "fadeOutUp"],
dismiss: {
duration: 1500,
}
});
})
setClient('');
setTable('');
props.onUpdate([]);
})
.catch(error => {
store.addNotification({
title: "Falha no envio.",
notification({
title: "Falha no envio",
message: error,
type: "danger",
insert: "top",
container: "top-center",
animationIn: ["animated", "fadeInDown"],
animationOut: ["animated", "fadeOutUp"],
dismiss: {
duration: 2000,
}
});
})
});
}

Expand Down
8 changes: 3 additions & 5 deletions src/components/Tabs/tabContent.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useEffect, useState} from 'react';
import { StyleSheet, css } from 'aphrodite/no-important';
import { db } from '../../util/firebaseConfig';
// import firebase from 'firebase';
import ItemsButton from '../buttons/itemsButtons';
import BurguerButton from '../buttons/burguerItem';

Expand Down Expand Up @@ -38,7 +37,7 @@ const TabContent = (props) => {
price={item.price}
id={item.id}
key={item.id}
onClick={props.onClick}
onClick={props.onClickItem}
/>
})
}
Expand All @@ -53,10 +52,9 @@ const TabContent = (props) => {
key={item.id}
extras={item.extras}
flavour={item.flavour}
onClick={props.onClick}
onClick={props.onClickBurguer}
functionOk={props.onClickItem}
onChange={props.onChange}
functionOk={props.functionOk}
functionCancel={props.functionCancel}
/>
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/buttons/burguerItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const BurguerButton = (props) => {
<p>{props.price}</p>
</button>
<div className={css(styles.options)}>
<h3 className={css(styles.header)}>{props.title} {props.price}</h3>
<h3 className={css(styles.header)}>{props.title} {props.price}</h3>
<Filedset
name={'flavour' + props.id}
title='Sabor'
Expand Down
1 change: 0 additions & 1 deletion src/components/fieldset/fieldset.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { StyleSheet, css } from 'aphrodite/no-important';
import './style.css';

const Filedset = (props) => {
// console.log(props.onChange)
return (
<fieldset className={css(styles.container)}>
<legend className={css(styles.legend)}>{props.title}:</legend>
Expand Down
23 changes: 8 additions & 15 deletions src/pages/newOrder.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const NewOrder = () => {

const handleBurguerClick = (e) => {
const optionsStyle = e.currentTarget.nextElementSibling.style;
if (optionsStyle.display === 'none') {
if (!optionsStyle.display || optionsStyle.display === 'none') {
optionsStyle.display = 'flex';
} else {
optionsStyle.display = 'none';
Expand Down Expand Up @@ -62,30 +62,23 @@ const NewOrder = () => {
}
}

const handleClick = (e) => {
if (e.currentTarget.textContent.includes('Hambúrguer')) {
handleBurguerClick(e)
} else {
saveItems(e)
}
};

return (
<main>
<Navbar />
<>
<header>
<Navbar />
</header>
<div className={css(styles.container)}>
<MenuArea
onClick={handleClick}
onClickItem={saveItems}
onClickBurguer={handleBurguerClick}
onChange={onChangeRadio}
functionOk={saveItems}
functionCancel={handleBurguerClick}
/>
<ResumeArea
resume={order}
onUpdate={updateItems}
/>
</div>
</main>
</>
);
};

Expand Down

0 comments on commit 6ff8846

Please sign in to comment.