mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:49:45 +00:00
Рефактор: распределение компонентов и страниц по папкам
This commit is contained in:
1 parent
d96a8c564f
commit
8d43bec068
16 files changed
+41
-25
No files matched your search
@@ -0,0 +1,25 @@
|
|||||||
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
|
function UsersWP({ contacts }) {
|
||||||
|
return (
|
||||||
|
<div id="UsersWP">
|
||||||
|
{contacts.length ? (
|
||||||
|
<ul className="nav nav-pills nav-fill flex-column">
|
||||||
|
{contacts.map(contact => (
|
||||||
|
<li key={contact.id} className="nav-item text-start">
|
||||||
|
<Link className="nav-link" to={`contacts/${contact.id}`}>
|
||||||
|
{contact.name ? <>{contact.name}</> : <i>No Name</i>}{' '}
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
) : (
|
||||||
|
<p>
|
||||||
|
<i>No contacts</i>
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default UsersWP;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './UsersWP';
|
||||||
File renamed without changes.
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './AboutUs';
|
||||||
File renamed without changes.
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './Contact';
|
||||||
File renamed without changes.
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './ErrorPage';
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import Page from "./Page";
|
import Page from "../Page/Page";
|
||||||
|
|
||||||
function Labs() {
|
function Labs() {
|
||||||
return (
|
return (
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './Labs';
|
||||||
File renamed without changes.
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './Page';
|
||||||
File renamed without changes.
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './Projects';
|
||||||
+3
-19
@@ -1,7 +1,8 @@
|
|||||||
import { Outlet, Link, useLoaderData } from "react-router-dom";
|
import { Outlet, useLoaderData } from "react-router-dom";
|
||||||
|
|
||||||
import { getContacts } from "../../api";
|
import { getContacts } from "../../api";
|
||||||
import Navbar from '../../components/Navbar';
|
import Navbar from '../../components/Navbar';
|
||||||
|
import UsersWP from "../../components/UsersWP";
|
||||||
import './Root.styles.scss';
|
import './Root.styles.scss';
|
||||||
|
|
||||||
async function loader() {
|
async function loader() {
|
||||||
@@ -17,24 +18,7 @@ function Root() {
|
|||||||
<div id="page">
|
<div id="page">
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
|
<UsersWP contacts={ contacts } />
|
||||||
<div id="test">
|
|
||||||
{contacts.length ? (
|
|
||||||
<ul className="nav nav-pills nav-fill flex-column">
|
|
||||||
{contacts.map(contact => (
|
|
||||||
<li key={contact.id} className="nav-item text-start">
|
|
||||||
<Link className="nav-link" to={`contacts/${contact.id}`}>
|
|
||||||
{contact.name ? <>{contact.name}</> : <i>No Name</i>}{' '}
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
) : (
|
|
||||||
<p>
|
|
||||||
<i>No contacts</i>
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -1,7 +1,7 @@
|
|||||||
export { Root, loader } from './Root';
|
export { Root, loader } from './Root';
|
||||||
export { default as ErrorPage} from './ErrorPage';
|
export { default as ErrorPage} from './ErrorPage/ErrorPage';
|
||||||
export { default as Main } from './Main';
|
export { default as Main } from './Main';
|
||||||
export { default as AboutUs } from './AboutUs';
|
export { default as AboutUs } from './AboutUs/AboutUs';
|
||||||
export { default as Labs } from './Labs';
|
export { default as Labs } from './Labs/Labs';
|
||||||
export { default as Projects } from './Projects';
|
export { default as Projects } from './Projects/Projects';
|
||||||
export { default as Contact } from './Contact';
|
export { default as Contact } from './Contact/Contact';
|
||||||
Reference in new issue
Block a user