This commit is contained in:
maxnes3 2024-10-16 10:18:20 +04:00
parent 8fb12be7a6
commit 95c0590d67
20 changed files with 191 additions and 39 deletions

View File

@ -1,16 +1,15 @@
import { FC } from 'react';
import { LayoutRouteProps } from 'react-router-dom';
import classes from './styles.module.scss';
import { Navbar } from '@/widgets/navbar';
import { Footer } from '@/widgets/footer';
// import { Footer } from '@/widgets/footer';s
const Layout: FC<LayoutRouteProps> = ({ children }) => {
return (
<div className={classes.container}>
<Navbar />
<main>{children}</main>
<Footer />
</div>
<>
<Navbar />
<main>{children}</main>
{/* <Footer /> */}
</>
);
};

View File

@ -1,19 +0,0 @@
@use '../../shared/assets/styles/adaptive' as adaptive;
$adaptive: (
desktop: (
container: 1240px
),
laptop: (
container: 886px
),
mobile: (
container: 315px
),
);
.container {
position: relative;
margin: 0 auto;
@include adaptive.set-adaptive($adaptive, max-width, container);
}

View File

@ -1,5 +1,11 @@
import classes from './styles.module.scss';
const HomePage = () => {
return <></>;
return (
<div className={classes.home}>
<div className={classes.container}></div>
</div>
);
};
export default HomePage;

View File

@ -0,0 +1,13 @@
@use '../../shared/assets/styles/adaptive' as adaptive;
.home {
display: flex;
justify-content: center;
width: 100%;
height: 1000px;
.container {
padding: 15px;
@include adaptive.container;
}
}

17
src/shared/api/api.ts Normal file
View File

@ -0,0 +1,17 @@
import axios from 'axios';
import { PredictRequestType, PredictResponseType } from '../types/predict';
class Api {
readonly baseURL = `${import.meta.env.VITE_SERVER_URL}`;
predictPrice = async (data: PredictRequestType) => {
const response = await axios.post<PredictResponseType>(
`${this.baseURL}/predict_price`,
data,
);
return response.data;
};
}
const api = new Api();
export default api;

0
src/shared/api/index.ts Normal file
View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 115 KiB

View File

@ -3,13 +3,13 @@ $breakpoints: (
max: 1440px,
min: 1024.1px
),
laptop: (
table: (
max: 1024px,
min: 375.1px
min: 768.1px
),
mobile: (
max: 375px,
min: 0px
max: 768px,
min: 375px
),
);
@ -30,4 +30,20 @@ $breakpoints: (
}
}
}
}
$container: (
desktop: (
max: 1024px
),
table: (
max: 768px
),
mobile: (
max: 375px
),
);
@mixin container {
@include set-adaptive($container, width, max);
}

View File

@ -0,0 +1,5 @@
:root {
--primary-black: #000000;
--transparent-black: rgba(0, 0, 0, 0.8);
--primary-white: #ffffff;
}

View File

@ -1,2 +1,10 @@
@use './adaptive';
@use './fonts';
@use './fonts';
@use './colors';
body {
margin: 0;
padding: 0;
background-image: url('../icons/background.jpg');
background-size: cover;
}

View File

@ -1,5 +1,7 @@
import classes from './styles.module.scss';
const Button = () => {};
const Button = () => {
return <></>;
};
export default Button;

View File

@ -0,0 +1,7 @@
export type PredictRequestType = {
}
export type PredictResponseType = {
}

View File

@ -1,5 +1,7 @@
import classes from './styles.module.scss';
const Footer = () => {
return <></>;
return <footer className={classes.footer}>Просто шаблон</footer>;
};
export default Footer;
export default Footer;

View File

@ -1 +1 @@
export { default as Footer } from './footer.widget';
export { default as Footer } from './footer.widget';

View File

@ -0,0 +1,7 @@
.footer {
display: flex;
background-color: var(--primary-black);
width: 100%;
height: 100%;
justify-content: center;
}

View File

@ -0,0 +1,24 @@
import api from '@/shared/api/api';
import {
PredictRequestType,
PredictResponseType,
} from '@/shared/types/predict';
import { useState } from 'react';
import classes from './styles.module.scss';
const Form = () => {
const [request, setRequest] = useState<PredictRequestType>({});
const [response, setResponse] = useState<PredictResponseType>({});
const handleGetPredict = async () => {
const newResponse = await api.predictPrice(request);
};
return (
<form>
<div className={classes.}></div>
</form>
);
};
export default Form;

View File

@ -0,0 +1,27 @@
@use '../../shared/assets/styles/adaptive' as adaptive;
.navbar {
display: flex;
background-color: var(--transparent-black);
backdrop-filter: blur(10px);
width: 100%;
justify-content: center;
.container {
padding: 15px;
@include adaptive.container;
.logo {
display: flex;
flex-direction: row;
justify-content: start;
align-items: end;
gap: 8px;
color: var(--primary-white);
.title {
margin: 0;
}
}
}
}

View File

@ -1 +1 @@
export { default as Navbar } from './navbar.widget';
export { default as Navbar } from './navbar.widget';

View File

@ -1,5 +1,16 @@
import classes from './styles.module.scss';
const Navbar = () => {
return <></>;
return (
<nav className={classes.navbar}>
<div className={classes.container}>
<div className={classes.logo}>
<h2 className={classes.title}>Price Builder</h2>
<span>v1.0.0</span>
</div>
</div>
</nav>
);
};
export default Navbar;
export default Navbar;

View File

@ -0,0 +1,27 @@
@use '../../shared/assets/styles/adaptive' as adaptive;
.navbar {
display: flex;
background-color: var(--transparent-black);
backdrop-filter: blur(10px);
width: 100%;
justify-content: center;
.container {
padding: 15px;
@include adaptive.container;
.logo {
display: flex;
flex-direction: row;
justify-content: start;
align-items: end;
gap: 8px;
color: var(--primary-white);
.title {
margin: 0;
}
}
}
}