Merge branch 'addfiler' into main
This commit is contained in:
16157
kivi-cars/package-lock.json
generated
16157
kivi-cars/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@
|
|||||||
"@testing-library/jest-dom": "^5.16.2",
|
"@testing-library/jest-dom": "^5.16.2",
|
||||||
"@testing-library/react": "^12.1.3",
|
"@testing-library/react": "^12.1.3",
|
||||||
"@testing-library/user-event": "^13.5.0",
|
"@testing-library/user-event": "^13.5.0",
|
||||||
|
"nouislider": "^15.5.1",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"react-scripts": "5.0.0",
|
"react-scripts": "5.0.0",
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
work correctly both with client-side routing and a non-root public URL.
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
Learn how to configure a non-root public URL by running `npm run build`.
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
-->
|
-->
|
||||||
<title>React App</title>
|
<title>Kivi Cars</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
.App {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.App-logo {
|
|
||||||
height: 40vmin;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: no-preference) {
|
|
||||||
.App-logo {
|
|
||||||
animation: App-logo-spin infinite 20s linear;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.App-header {
|
|
||||||
background-color: #282c34;
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: calc(10px + 2vmin);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.App-link {
|
|
||||||
color: #61dafb;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes App-logo-spin {
|
|
||||||
from {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
83
kivi-cars/src/components/Filters.css
Normal file
83
kivi-cars/src/components/Filters.css
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
*{
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #02adba;
|
||||||
|
color: #fff;
|
||||||
|
height: 54px;
|
||||||
|
line-height: 54px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media only screen and (min-width: 601px) {
|
||||||
|
nav {
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
background-color: #02adba;
|
||||||
|
color: #fff;
|
||||||
|
height: 64px;
|
||||||
|
line-height: 64px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
width: 80%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filters-tab {
|
||||||
|
width: 100%;
|
||||||
|
height: 48;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filters-links{
|
||||||
|
margin-top: 2rem;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-grow: 1;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filters-links li {
|
||||||
|
text-align: center;
|
||||||
|
width: 7rem;
|
||||||
|
flex-grow: 1;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.filters {
|
||||||
|
display: inline-block;
|
||||||
|
border-bottom: 2px solid #02adba;
|
||||||
|
width: 5rem;
|
||||||
|
padding: 1rem 10rem;
|
||||||
|
white-space: nowrap;
|
||||||
|
margin-left: auto;
|
||||||
|
font-size: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filters a{
|
||||||
|
text-decoration: none;
|
||||||
|
color: #02adba;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filters a:visited {
|
||||||
|
color: #02adba;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cars-brands-models {
|
||||||
|
border: 2px solid blue;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
46
kivi-cars/src/components/Filters.js
Normal file
46
kivi-cars/src/components/Filters.js
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import React from "react";
|
||||||
|
import "./Filters.css";
|
||||||
|
import Cars from "./cars";
|
||||||
|
|
||||||
|
const Filters = () => {
|
||||||
|
|
||||||
|
const unsortedCars = Cars
|
||||||
|
const cars = unsortedCars.sort(unsortedCars.brand)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return(
|
||||||
|
<div>
|
||||||
|
<nav>
|
||||||
|
<h3 className="title">Filteri za pretrazivanje</h3>
|
||||||
|
</nav>
|
||||||
|
<div className="container">
|
||||||
|
<div className="filters-tabs">
|
||||||
|
<ul className="filters-links">
|
||||||
|
<li className="filters">
|
||||||
|
<a id="standard-filters" href="#">Filteri</a>
|
||||||
|
</li>
|
||||||
|
<li className="filters">
|
||||||
|
<a id="advanced-filters" href="#">Napredni filteri</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div className="container-standard">
|
||||||
|
<div className="cars-brands-models">
|
||||||
|
<label>Marka: </label>
|
||||||
|
<select name="brands" id="brands">
|
||||||
|
{cars.map(car => <option className="option-field" value={car.brand}>{car.brand}</option>)}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="container-advanced">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Filters
|
||||||
1547
kivi-cars/src/components/cars.js
Normal file
1547
kivi-cars/src/components/cars.js
Normal file
File diff suppressed because it is too large
Load Diff
4
kivi-cars/src/containers/App.css
Normal file
4
kivi-cars/src/containers/App.css
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
.App{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
import './App.css';
|
import './App.css';
|
||||||
|
import React from 'react';
|
||||||
|
import Filters from '../components/Filters';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
<h1>Hello</h1>
|
<Filters />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import './index.css';
|
import './index.css';
|
||||||
import App from './App';
|
import App from './containers/App';
|
||||||
import reportWebVitals from './reportWebVitals';
|
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<App />
|
<App />
|
||||||
</React.StrictMode>,
|
</React.StrictMode>,
|
||||||
document.getElementById('root')
|
document.getElementById('root')
|
||||||
);
|
);
|
||||||
|
|
||||||
// If you want to start measuring performance in your app, pass a function
|
|
||||||
// to log results (for example: reportWebVitals(console.log))
|
|
||||||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
|
||||||
reportWebVitals();
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
const reportWebVitals = onPerfEntry => {
|
|
||||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
||||||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
|
||||||
getCLS(onPerfEntry);
|
|
||||||
getFID(onPerfEntry);
|
|
||||||
getFCP(onPerfEntry);
|
|
||||||
getLCP(onPerfEntry);
|
|
||||||
getTTFB(onPerfEntry);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default reportWebVitals;
|
|
||||||
Reference in New Issue
Block a user