Skip to content

Commit

Permalink
Merge pull request #31 from DushanSenadheera/dev
Browse files Browse the repository at this point in the history
add results section
  • Loading branch information
DushanSenadheera authored Apr 27, 2024
2 parents 3cfc01e + a511b66 commit 04ed738
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 65 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

clone the repositary
```bash
git clone []
git clone https://github.com/DushanSenadheera/project_rover.git
```
Navigate to the project directory
```bash
Expand All @@ -21,10 +21,14 @@ Install the dependencies
```bash
npm install
```
Run the application
```bash
./localhost.sh
```
### How to run application using Docker?

```bash
./dockerComposer.sh
./dockerComposer.sh
```
### ROVER API Documentation
[ROVER API Documentation](https://documenter.getpostman.com/view/28662859/2sA3BoaBaB#intro)
3 changes: 3 additions & 0 deletions client/src/components/Carousel/Carousel.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.Carousel {
/* Add your styles here */
}
19 changes: 19 additions & 0 deletions client/src/components/Carousel/CarouselContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Carousel } from "@mantine/carousel";
import bg from "../../assets/bg.png";
import bg2 from "../../assets/bg2.png";

export default function CarouselContent() {
return (
<Carousel withIndicators height={400}>
<Carousel.Slide>
<img src={bg} alt="bg" />
</Carousel.Slide>
<Carousel.Slide>
<img src={bg2} alt="bg" />
</Carousel.Slide>
<Carousel.Slide>
<img src={bg} alt="bg" />
</Carousel.Slide>
</Carousel>
);
}
120 changes: 58 additions & 62 deletions client/src/pages/Results/Results.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import "./Results.scss";
import { Carousel } from "@mantine/carousel";
import { Accordion } from "@mantine/core";
import bg from "../../assets/bg.png";
import { useEffect, useState } from "react";
import axios from "axios";
import Loading from "../../components/Loading/Loading";
import Cards from "../../components/Card/Cards";
import CarouselContent from "../../components/Carousel/CarouselContent";

const groceries = [
{
Expand All @@ -32,72 +31,69 @@ export default function Results() {
const items = groceries.map((item) => (
<Accordion.Item key={item.value} value={item.value}>
<Accordion.Control icon={item.emoji}>{item.value}</Accordion.Control>
<Accordion.Panel>{item.description}</Accordion.Panel>
<Accordion.Panel>
<div>
<CarouselContent />
<h1>Galle</h1>
<small>Southern Province, Sri Lanka</small>
<p>{item.description}</p>
</div>
</Accordion.Panel>
</Accordion.Item>
));
// const [loading, setLoading] = useState(true);
const [loading, setLoading] = useState(true);

// useEffect(() => {
// axios
// .get("http://localhost:3000/api/location")
// .then(function (res) {
// const locations = res.data.location;
// console.log(locations);
// setLoading(false);
// })
// .catch(function (error) {
// console.log(error);
// setLoading(false);
// });
// }, []);
useEffect(() => {
axios
.get("http://localhost:3000/api/location")
.then(function (res) {
const locations = res.data.location;
console.log(locations);
setLoading(false);
})
.catch(function (error) {
console.log(error);
setLoading(false);
});
}, []);

// if (loading) {
// return <Loading />;
// } else {
return (
<div>
<div className="results-content">
<h1>Galle</h1>
<small>Southern Province, Sri Lanka</small>
<Carousel withIndicators height={400}>
<Carousel.Slide>
<img src={bg} alt="bg" />
</Carousel.Slide>
<Carousel.Slide>
<img src={bg} alt="bg" />
</Carousel.Slide>
<Carousel.Slide>
<img src={bg} alt="bg" />
</Carousel.Slide>
</Carousel>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsam qui
porro quis magnam assumenda veniam perferendis tempora tempore autem
incidunt, ad suscipit, dolorem unde sed corporis eligendi et veritatis
repellat?
</p>
<div className="plan">
<h1>Travel Plan</h1>
<Accordion defaultValue="Apples">{items}</Accordion>
</div>
<div className="stay">
<h1>Stay</h1>
<div className="stay-content">
<Cards />
<Cards />
<Cards />
if (loading) {
return <Loading />;
} else {
return (
<div>
<div className="results-content">
<h1>Galle</h1>
<small>Southern Province, Sri Lanka</small>
<CarouselContent />
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsam qui
porro quis magnam assumenda veniam perferendis tempora tempore autem
incidunt, ad suscipit, dolorem unde sed corporis eligendi et
veritatis repellat?
</p>
<div className="plan">
<h1>Travel Plan</h1>
<Accordion defaultValue="Apples">{items}</Accordion>
</div>
</div>
<div className="stay">
<h1>Eat</h1>
<div className="stay-content">
<Cards />
<Cards />
<Cards />
<div className="stay">
<h1>Stay</h1>
<div className="stay-content">
<Cards />
<Cards />
<Cards />
</div>
</div>
<div className="stay">
<h1>Eat</h1>
<div className="stay-content">
<Cards />
<Cards />
<Cards />
</div>
</div>
</div>
</div>
</div>
);
);
}
}
// }
2 changes: 1 addition & 1 deletion model/src/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from sklearn.metrics.pairwise import linear_kernel
from math import radians, cos, sin, asin, sqrt

# Assuming df is your DataFrame and it has been defined and loaded with data
# Assuming df is DataFrame and it has been defined and loaded with data
df = pd.read_csv('../model/data/southern.csv')

# Combine the 'Location', 'Category', 'Budget', and 'Duration' columns into a single 'Features' column
Expand Down

0 comments on commit 04ed738

Please sign in to comment.