Skip to content
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

Frontend #1

Merged
merged 12 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified frontend/bun.lockb
Binary file not shown.
9 changes: 9 additions & 0 deletions frontend/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
],
"@data/*": [
"data/*"
],
"@pages/*": [
"pages/*"
],
"@components/*": [
"components/*"
],
"@images/*": [
"images/*"
]
}
},
Expand Down
422 changes: 131 additions & 291 deletions frontend/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"react-dom": "^18.2.0",
"react-plotly.js": "^2.6.0",
"react-refresh": "^0.11.0",
"react-router-dom": "^6.22.3",
"resolve": "^1.20.0",
"resolve-url-loader": "^4.0.0",
"sass-loader": "^12.3.0",
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>ML Model</title>
<title>Команда А</title>
</head>

<body>
Expand Down
35 changes: 23 additions & 12 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
import "./styles/App.css"
import "bootstrap/dist/css/bootstrap.min.css"

import Predict from "components/Predict"
import ModelPlot from "components/ModelPlot"
import { BrowserRouter, Routes, Route } from "react-router-dom"

import { PublicRoutes } from "@data/routes"
import Error from "@pages/Error/Error"
import NavBar from "@components/NavBar"

export default function App() {
return (
<div className="App">

<br />
export default function App() {

<Predict />
return (
<BrowserRouter>
<div className="App">
<NavBar />

<br />
<br />
<br />
<br />

<ModelPlot />
</div>
<Routes>
{PublicRoutes.map((route) =>
<Route
key={route.path}
path={route.path}
errorElement={<Error />}
element={route.element}
exact
/>
)}
</Routes>
</div>
</BrowserRouter>
)
}
54 changes: 0 additions & 54 deletions frontend/src/components/ModelPlot.jsx

This file was deleted.

44 changes: 44 additions & 0 deletions frontend/src/components/NavBar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import "@components/styles/NavBar.css"
import img from "@images/yandex-logo.jpg"

import { Link } from "react-router-dom"
import { Container, Nav, Navbar, Offcanvas } from "react-bootstrap"


export default function NavBar() {
return (
<>
{
[false].map((expand) => (
<Navbar key={expand} expand={expand} className="bg-body-tertiary mb-3">
<Container fluid>
<Navbar.Brand as={Link} to="/">
<img id="home-icon" src={img} />
Команда А
</Navbar.Brand>

<Navbar.Toggle aria-controls={`offcanvasNavbar-expand-${expand}`} />
<Navbar.Offcanvas
id={`offcanvasNavbar-expand-${expand}`}
aria-labelledby={`offcanvasNavbarLabel-expand-${expand}`}
placement="end"
>
<Offcanvas.Header closeButton>
<Offcanvas.Title id={`offcanvasNavbarLabel-expand-${expand}`}>
предсказания
</Offcanvas.Title>
</Offcanvas.Header>
<Offcanvas.Body>
<Nav className="justify-content-end flex-grow-1 pe-3">
<Nav.Link as={Link} to="/predict_day/">на один день</Nav.Link>
<Nav.Link as={Link} to="/predict_interval/">на интервал</Nav.Link>
</Nav>
</Offcanvas.Body>
</Navbar.Offcanvas>
</Container>
</Navbar>
))
}
</>
);
}
48 changes: 0 additions & 48 deletions frontend/src/components/Predict.jsx

This file was deleted.

40 changes: 0 additions & 40 deletions frontend/src/components/PredictForm.jsx

This file was deleted.

5 changes: 5 additions & 0 deletions frontend/src/components/styles/NavBar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#home-icon {
width: 40px;
margin: 10px;
border-radius: 50%;
}
18 changes: 18 additions & 0 deletions frontend/src/data/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Home from "@pages/Home/Home"
import PredictDay from "@pages/PredictDay/PredictDay"
import PredictInterval from "@pages/PredictInterval/PredictInterval"

export var PublicRoutes = [
{
path: "/",
element: <Home />
},
{
path: "/predict_day/",
element: <PredictDay />
},
{
path: "/predict_interval/",
element: <PredictInterval />
},
]
Binary file added frontend/src/images/yandex-logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions frontend/src/pages/Error/Error.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import "@pages/Error/styles/Error.css"

export default function Error() {
return (
<div className="Error">
<h2>Error</h2>
</div>
)
}
14 changes: 14 additions & 0 deletions frontend/src/pages/Error/styles/Error.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.Error {
position: fixed;
top: 30%;
bottom: 30%;
right: 30%;
left: 30%;
display: flex;
text-align: center;
justify-content: center;
align-items: center;
font-size: xx-large;
background-color: rgb(181, 173, 173);
color: rgb(250, 244, 244);
}
25 changes: 25 additions & 0 deletions frontend/src/pages/Home/Home.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import ListGroup from 'react-bootstrap/ListGroup'


export default function Home() {
return (
<div className="Home">
<h2 className="text-center">
22. Предсказание стоимости акций на основе финансовых новостей
</h2>

<br />

<ListGroup horizontal>
<ListGroup.Item>Елизавета Мирова @elithie</ListGroup.Item>
<ListGroup.Item>Рощин Филипп @qwerty111ytrewq</ListGroup.Item>
<ListGroup.Item>Алан Насибуллин @Alan_Nasibullin</ListGroup.Item>
<ListGroup.Item>Евгений Поликанин @Nmmage</ListGroup.Item>
</ListGroup>

<br />

<h5 className="text-center">Куратор: Дмитрий Качкин</h5>
</div>
)
}
Loading
Loading