Skip to content

Commit

Permalink
made price comparison display error page if nothing found
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-0101 committed Feb 6, 2021
1 parent 9d8d695 commit 5193b11
Show file tree
Hide file tree
Showing 15 changed files with 452 additions and 203 deletions.
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
2 changes: 1 addition & 1 deletion client/.eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\index.js":"1","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\App.js":"2","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\index.js":"3","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\NavBar\\NavBar.jsx":"4","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\SiderNav\\SiderNav.jsx":"5","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\Context\\Context.js":"6","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\index.js":"7","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\homepage\\homepage.jsx":"8","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\Homepage\\Homepage.jsx":"9","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\SkeletonLoader\\SkeletonLoader.jsx":"10","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\ComparisonSearch\\ComparisonSearch.jsx":"11","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\PriceComparison\\PriceComparison.jsx":"12","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\history.js":"13"},{"size":292,"mtime":1609994624068,"results":"14","hashOfConfig":"15"},{"size":858,"mtime":1612324991517,"results":"16","hashOfConfig":"15"},{"size":278,"mtime":1611720099694,"results":"17","hashOfConfig":"15"},{"size":941,"mtime":1611720163277,"results":"18","hashOfConfig":"15"},{"size":1749,"mtime":1611874538637,"results":"19","hashOfConfig":"15"},{"size":441,"mtime":1612323975442,"results":"20","hashOfConfig":"15"},{"size":141,"mtime":1611721109679,"results":"21","hashOfConfig":"15"},{"size":144,"mtime":1610425363792,"results":"22","hashOfConfig":"15"},{"size":9508,"mtime":1612330796897,"results":"23","hashOfConfig":"15"},{"size":1690,"mtime":1610928988860,"results":"24","hashOfConfig":"15"},{"size":1235,"mtime":1612326055879,"results":"25","hashOfConfig":"15"},{"size":7751,"mtime":1612332319252,"results":"26","hashOfConfig":"15"},{"size":89,"mtime":1612324582106,"results":"27","hashOfConfig":"15"},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},"1ixu00z",{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"43","messages":"44","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"51","messages":"52","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\index.js",[],["55","56"],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\App.js",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\index.js",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\NavBar\\NavBar.jsx",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\SiderNav\\SiderNav.jsx",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\Context\\Context.js",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\index.js",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\homepage\\homepage.jsx",["57"],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\Homepage\\Homepage.jsx",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\SkeletonLoader\\SkeletonLoader.jsx",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\ComparisonSearch\\ComparisonSearch.jsx",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\PriceComparison\\PriceComparison.jsx",["58"],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\history.js",[],{"ruleId":"59","replacedBy":"60"},{"ruleId":"61","replacedBy":"62"},{"ruleId":"63","severity":1,"message":"64","line":1,"column":8,"nodeType":"65","messageId":"66","endLine":1,"endColumn":13},{"ruleId":"63","severity":1,"message":"67","line":71,"column":12,"nodeType":"65","messageId":"66","endLine":71,"endColumn":16},"no-native-reassign",["68"],"no-negated-in-lhs",["69"],"no-unused-vars","'react' is defined but never used.","Identifier","unusedVar","'data' is assigned a value but never used.","no-global-assign","no-unsafe-negation"]
[{"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\index.js":"1","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\App.js":"2","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\index.js":"3","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\NavBar\\NavBar.jsx":"4","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\SiderNav\\SiderNav.jsx":"5","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\Context\\Context.js":"6","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\index.js":"7","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\homepage\\homepage.jsx":"8","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\Homepage\\Homepage.jsx":"9","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\ComparisonSearch\\ComparisonSearch.jsx":"10","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\PriceComparison\\PriceComparison.jsx":"11","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\history.js":"12","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\SkeletonLoaders\\SkeletonLoader.jsx":"13","C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\SkeletonLoaders\\ComparisonSkeleton.jsx":"14"},{"size":292,"mtime":1609994624068,"results":"15","hashOfConfig":"16"},{"size":848,"mtime":1612505937558,"results":"17","hashOfConfig":"16"},{"size":366,"mtime":1612641661622,"results":"18","hashOfConfig":"16"},{"size":771,"mtime":1612650875607,"results":"19","hashOfConfig":"16"},{"size":1749,"mtime":1611874538637,"results":"20","hashOfConfig":"16"},{"size":441,"mtime":1612323975442,"results":"21","hashOfConfig":"16"},{"size":141,"mtime":1611721109679,"results":"22","hashOfConfig":"16"},{"size":144,"mtime":1610425363792,"results":"23","hashOfConfig":"16"},{"size":9511,"mtime":1612641439048,"results":"24","hashOfConfig":"16"},{"size":1233,"mtime":1612409147158,"results":"25","hashOfConfig":"16"},{"size":17943,"mtime":1612650220818,"results":"26","hashOfConfig":"16"},{"size":89,"mtime":1612324582106,"results":"27","hashOfConfig":"16"},{"size":1676,"mtime":1612644204066,"results":"28","hashOfConfig":"16"},{"size":5089,"mtime":1612645866848,"results":"29","hashOfConfig":"16"},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},"1ixu00z",{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\index.js",[],["59","60"],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\App.js",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\index.js",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\NavBar\\NavBar.jsx",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\SiderNav\\SiderNav.jsx",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\Context\\Context.js",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\index.js",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\homepage\\homepage.jsx",["61"],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\Homepage\\Homepage.jsx",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\ComparisonSearch\\ComparisonSearch.jsx",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\pages\\PriceComparison\\PriceComparison.jsx",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\history.js",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\SkeletonLoaders\\SkeletonLoader.jsx",[],"C:\\Users\\Nicola\\Desktop\\Code\\priceBattler\\client\\src\\components\\SkeletonLoaders\\ComparisonSkeleton.jsx",[],{"ruleId":"62","replacedBy":"63"},{"ruleId":"64","replacedBy":"65"},{"ruleId":"66","severity":1,"message":"67","line":1,"column":8,"nodeType":"68","messageId":"69","endLine":1,"endColumn":13},"no-native-reassign",["70"],"no-negated-in-lhs",["71"],"no-unused-vars","'react' is defined but never used.","Identifier","unusedVar","no-global-assign","no-unsafe-negation"]
28 changes: 24 additions & 4 deletions client/package-lock.json

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

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"axios": "^0.21.1",
"babel-plugin-import": "^1.13.3",
"customize-cra": "^1.0.0",
"history": "^5.0.0",
"history": "^4.0.0-0",
"less": "^4.0.0",
"less-loader": "^7.2.1",
"react": "^17.0.1",
Expand Down
7 changes: 3 additions & 4 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Router, Switch, Route } from 'react-router-dom';
import { BrowserRouter, Switch, Route } from 'react-router-dom';
import { NavBar } from './components';
import { Layout } from 'antd';

Expand All @@ -15,18 +15,17 @@ const { Content } = Layout;
function App() {
return (
<Layout style={{ height: 'auto' }}>
<Router history={history}>
<BrowserRouter history={history}>
<NavBar />
<Layout>
{/* <SiderNav /> */}
<Content style={{ background: '#fff' }}>
<Switch>
<Route path='/' exact render={(props) => <Homepage />} />
<Route path='/search' render={(props) => <PriceComparison />} />
</Switch>
</Content>
</Layout>
</Router>
</BrowserRouter>
</Layout>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const ComparisonSearch = ({ history }) => {
}
};


return (
<>
<Row justify="center" align="middle" style={{height: '200px',margin: '5% 0 5% 0', textAlign: 'center'}}>
Expand Down
16 changes: 5 additions & 11 deletions client/src/components/NavBar/NavBar.jsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
import React from 'react';
import '../../App.css';
// import { AppContext } from "../Context/Context";
import { Layout, Menu } from 'antd';
import { ShoppingCartOutlined } from '@ant-design/icons';

const { Header } = Layout;

const NavBar = () => {
// const { toggleDisplay } = useContext(AppContext);

// const handleToggleChange = (e) => {
// toggleDisplay();
// };

return (
<>
<Layout theme='light'>
<Header theme='light' style={{ background: '#fff' }} >
<div className='logo' />
Price Flame
<Menu
mode='horizontal'
defaultSelectedKeys={['1']}
style={{ float: 'right' }}
// mode='horizontal'
style={{ float: 'right'}}
theme='light'
>
<Menu.Item key='1'><ShoppingCartOutlined style={{fontSize: '24px'}} /></Menu.Item>
<Menu.Item key='1'>
<ShoppingCartOutlined style={{fontSize: '24px', verticalAlign: 'middle', border:0}} />
</Menu.Item>
</Menu>
</Header>
</Layout>
Expand Down
Loading

0 comments on commit 5193b11

Please sign in to comment.