mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:29:45 +00:00
Routing, contact-page
This commit is contained in:
1 parent
da7b415c1a
commit
4a00dbefc4
10 files changed
+121
-18
No files matched your search
@@ -1,11 +1,9 @@
|
|||||||
import logo from './logo.svg';
|
import logo from './logo.svg';
|
||||||
import './App.css';
|
import './App.css';
|
||||||
import Header from './components/Header/Header';
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
<Header/>
|
|
||||||
<header className="App-header">
|
<header className="App-header">
|
||||||
<img src={logo} className="App-logo" alt="logo" />
|
<img src={logo} className="App-logo" alt="logo" />
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 323 KiB |
@@ -1,10 +1,11 @@
|
|||||||
import './header.scss';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import logo from '../../assets/scb.svg'
|
import logo from '../../assets/scb.svg'
|
||||||
|
import './Navbar.scss';
|
||||||
|
|
||||||
function Header() {
|
function Navbar() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="header">
|
<div className="navbar">
|
||||||
<div className="logo-container">
|
<div className="logo-container">
|
||||||
<img src={logo} className="logo" alt="SCB logo"/>
|
<img src={logo} className="logo" alt="SCB logo"/>
|
||||||
</div>
|
</div>
|
||||||
@@ -21,9 +22,9 @@ function Header() {
|
|||||||
<a href="">
|
<a href="">
|
||||||
ПРОЕКТЫ
|
ПРОЕКТЫ
|
||||||
</a>
|
</a>
|
||||||
<a href="">
|
<Link to={`/contact`}>
|
||||||
КОНТАКТЫ
|
КОНТАКТЫ
|
||||||
</a>
|
</Link>
|
||||||
<a href="https://ictis.sfedu.ru">
|
<a href="https://ictis.sfedu.ru">
|
||||||
ИКТИБ
|
ИКТИБ
|
||||||
</a>
|
</a>
|
||||||
@@ -32,4 +33,4 @@ function Header() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Header;
|
export default Navbar;
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
$primary-bg-color: #343434;
|
$primary-bg-color: #343434;
|
||||||
$primary-text-color: white;
|
$primary-text-color: white;
|
||||||
|
|
||||||
.header {
|
.navbar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
|
max-height: 60px;
|
||||||
padding: 1em 10%;
|
padding: 1em 10%;
|
||||||
background: $primary-bg-color;
|
background: $primary-bg-color;
|
||||||
|
|
||||||
@@ -14,11 +15,11 @@ $primary-text-color: white;
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.logo-container {
|
.logo-container {
|
||||||
width: 25%;
|
height: 100%;
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.bar {
|
.bar {
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import { useRouteError } from 'react-router-dom'
|
||||||
|
|
||||||
|
export default function ErrorPage() {
|
||||||
|
const error = useRouteError()
|
||||||
|
console.error(error)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="align-items-center bg-white d-flex flex-column flex-grow-1 justify-content-center"
|
||||||
|
id="error-page"
|
||||||
|
>
|
||||||
|
<h1 className="mt-0">Oops!</h1>
|
||||||
|
<p>Sorry, an unexpected error has occurred.</p>
|
||||||
|
<p>
|
||||||
|
<i>{error.statusText || error.message}</i>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
+22
-3
@@ -1,13 +1,32 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom/client';
|
import ReactDOM from 'react-dom/client';
|
||||||
import './index.css';
|
import { createHashRouter, RouterProvider, Outlet } from 'react-router-dom';
|
||||||
import App from './App';
|
|
||||||
|
import Root from './routes/Root';
|
||||||
|
import ErrorPage from './error-page';
|
||||||
|
import Contact from './routes/Contact';
|
||||||
import reportWebVitals from './reportWebVitals';
|
import reportWebVitals from './reportWebVitals';
|
||||||
|
import './index.scss';
|
||||||
|
|
||||||
|
const router = createHashRouter([
|
||||||
|
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
element: <Root />,
|
||||||
|
errorElement: <ErrorPage />,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "/contact",
|
||||||
|
element: <Contact />,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||||
root.render(
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<App />
|
<RouterProvider router={router} />
|
||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -14,4 +14,4 @@ body {
|
|||||||
code {
|
code {
|
||||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||||
monospace;
|
monospace;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import Navbar from '../components/Navbar/Navbar';
|
||||||
|
|
||||||
|
function Contact() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<header className='header'>
|
||||||
|
<h1>Студенческое конструкторское бюро<br />
|
||||||
|
"Компьютерное инновационное творчество"</h1>
|
||||||
|
</header>
|
||||||
|
<div className="contact">
|
||||||
|
<p>Контактное лицо: Кутковой Владимир Сергеевич</p>
|
||||||
|
</div>
|
||||||
|
<form className="form">
|
||||||
|
<label htmlFor="topic-input">Тема</label>
|
||||||
|
<input type="text" name="topic" id="topic-input" />
|
||||||
|
<label htmlFor="email">Почта</label>
|
||||||
|
<input type="text" name="email-input" id="email-input" />
|
||||||
|
<label htmlFor="message">Сообщение</label>
|
||||||
|
<input type="text" name="message-input" id="message-input" />
|
||||||
|
</form>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Contact;
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { Outlet } from "react-router-dom";
|
||||||
|
|
||||||
|
import Navbar from '../components/Navbar/Navbar';
|
||||||
|
import './Root.scss';
|
||||||
|
|
||||||
|
function Root() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Navbar />
|
||||||
|
<div id="page">
|
||||||
|
<Outlet />
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Root;
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
$primary-bg-color: #343434;
|
||||||
|
$secondary-bg-color: white;
|
||||||
|
$primary-text-color: white;
|
||||||
|
|
||||||
|
#page {
|
||||||
|
margin-top: calc(60px + 2em);
|
||||||
|
|
||||||
|
.header {
|
||||||
|
height: 25vh;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
color: $primary-text-color;
|
||||||
|
background: $primary-bg-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
background: $secondary-bg-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user