mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:39:45 +00:00
Вынести PageHeader и PageContent в отдельные компоненты
This commit is contained in:
1 parent
74694e8faa
commit
1a83f701e8
10 files changed
+48
-42
No files matched your search
@@ -1,12 +1,14 @@
|
|||||||
|
import { PageContent, PageHeader } from "../components";
|
||||||
|
|
||||||
function AboutUs() {
|
function AboutUs() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<header className="header">
|
<PageHeader>
|
||||||
<h1>About us</h1>
|
<h1>About us</h1>
|
||||||
</header>
|
</PageHeader>
|
||||||
<div className="content">
|
<PageContent>
|
||||||
|
|
||||||
</div>
|
</PageContent>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
|
import { PageContent, PageHeader } from "../components";
|
||||||
|
|
||||||
function Contact() {
|
function Contact() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<header className='header'>
|
<PageHeader>
|
||||||
<h1>Студенческое конструкторское бюро<br />
|
<h1>Студенческое конструкторское бюро<br />
|
||||||
"Компьютерное инновационное творчество"</h1>
|
"Компьютерное инновационное творчество"</h1>
|
||||||
</header>
|
</PageHeader>
|
||||||
<div className="content">
|
<PageContent>
|
||||||
<div className="contact">
|
<div className="contact">
|
||||||
<p>Контактное лицо: Кутковой Владимир Сергеевич</p>
|
<p>Контактное лицо: Кутковой Владимир Сергеевич</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -17,7 +19,7 @@ function Contact() {
|
|||||||
<label htmlFor="message">Сообщение</label>
|
<label htmlFor="message">Сообщение</label>
|
||||||
<input type="text" name="message-input" id="message-input" />
|
<input type="text" name="message-input" id="message-input" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</PageContent>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-11
@@ -1,18 +1,10 @@
|
|||||||
import Page from "../Page/Page";
|
import { PageHeader } from "../components";
|
||||||
|
|
||||||
function Labs() {
|
function Labs() {
|
||||||
return (
|
return (
|
||||||
// <>
|
<PageHeader>
|
||||||
// <header className="header">
|
|
||||||
// <h1>Laboratories</h1>
|
|
||||||
// </header>
|
|
||||||
// <div className="content">
|
|
||||||
|
|
||||||
// </div>
|
</PageHeader>
|
||||||
// </>
|
|
||||||
<Page title="Laboratories">
|
|
||||||
|
|
||||||
</Page>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { HashLink } from 'react-router-hash-link';
|
|||||||
|
|
||||||
import { News, Projects, Labs, Partners, Gallery, ContactUs } from './components';
|
import { News, Projects, Labs, Partners, Gallery, ContactUs } from './components';
|
||||||
import { RootContext } from '../Root';
|
import { RootContext } from '../Root';
|
||||||
|
import { PageContent, PageHeader } from '../components';
|
||||||
|
|
||||||
import './Main.styles.scss';
|
import './Main.styles.scss';
|
||||||
|
|
||||||
@@ -20,22 +21,22 @@ function Main() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<header id="mainpageheader" ref={element => setRef(element)}>
|
<PageHeader id="mainpageheader" ref={element => setRef(element)}>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<h1>Думай иначе, будь креативным!</h1>
|
<h1>Думай иначе, будь креативным!</h1>
|
||||||
<h2>Студенческое конструкторское бюро<br />
|
<h2>Студенческое конструкторское бюро<br />
|
||||||
"Компьютерное инновационное творчество"</h2>
|
"Компьютерное инновационное творчество"</h2>
|
||||||
<HashLink smooth to="#contact-us" className="btn">Связаться с нами</HashLink>
|
<HashLink smooth to="#contact-us" className="btn">Связаться с нами</HashLink>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</PageHeader>
|
||||||
<div className="content">
|
<PageContent>
|
||||||
<News />
|
<News />
|
||||||
<Projects />
|
<Projects />
|
||||||
<Labs />
|
<Labs />
|
||||||
<Partners />
|
<Partners />
|
||||||
<Gallery />
|
<Gallery />
|
||||||
<ContactUs />
|
<ContactUs />
|
||||||
</div>
|
</PageContent>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
function Page({ title, children }) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<header className="header">
|
|
||||||
<h1>{title}</h1>
|
|
||||||
</header>
|
|
||||||
<div className="content">
|
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Page;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export { default } from './Page';
|
|
||||||
@@ -1,12 +1,14 @@
|
|||||||
|
import { PageContent, PageHeader } from "../components";
|
||||||
|
|
||||||
function Projects() {
|
function Projects() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<header className="header">
|
<PageHeader className="header">
|
||||||
<h1>Projects</h1>
|
<h1>Projects</h1>
|
||||||
</header>
|
</PageHeader>
|
||||||
<div className="content">
|
<PageContent className="content">
|
||||||
|
|
||||||
</div>
|
</PageContent>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
function PageContent({ children }) {
|
||||||
|
return (
|
||||||
|
<div className="content">
|
||||||
|
{ children }
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PageContent;
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { forwardRef } from "react";
|
||||||
|
|
||||||
|
const PageHeader = forwardRef(({ children, id }, ref) => {
|
||||||
|
return (
|
||||||
|
<header id={id} ref={ref} className="header">
|
||||||
|
{children}
|
||||||
|
</header>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
export default PageHeader;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export { default as PageHeader } from "./PageHeader";
|
||||||
|
export { default as PageContent } from "./PageContent";
|
||||||
Reference in new issue
Block a user