This commit is contained in:
ifraimka1 committed 2024-02-14 11:15:57 +03:00
1 parent f9764adef7
commit 72f6ce54b0
37 files changed
+236 -39

No files matched your search

Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Executable
+21
View File
@@ -0,0 +1,21 @@
import * as WPAPI from 'wpapi';
const wp = new WPAPI(
process.env.NODE_ENV === 'development'
? {
endpoint: reactPress.api.rest_url,
username: 'admin',
password: 'testapi',
}
: { endpoint: reactPress.api.rest_url, nonce: reactPress.api.nonce }
);
export async function getContacts(q = '') {
try {
const users = await wp.users().search(q);
return users;
} catch (error) {
console.error(error);
return [];
}
}
Regular → Executable
View File
File mode changed.

Before

Width:  |  Height:  |  Size: 323 KiB

After

Width:  |  Height:  |  Size: 323 KiB

Regular → Executable
View File
File mode changed.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Regular → Executable
View File
File mode changed.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
View File
File mode changed.
Regular → Executable
View File
File mode changed.
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
+1 -1
View File
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { createHashRouter, RouterProvider, Outlet } from 'react-router-dom';
import { createHashRouter, RouterProvider } from 'react-router-dom';
import Root from './routes/Root';
import ErrorPage from './error-page';
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
+25
View File
@@ -0,0 +1,25 @@
function Contact() {
return (
<>
<header className='header'>
<h1>Студенческое конструкторское бюро<br />
"Компьютерное инновационное творчество"</h1>
</header>
<div className="content">
<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>
</div>
</>
);
}
export default Contact;
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
+25
View File
@@ -1,17 +1,42 @@
import { Outlet } from "react-router-dom";
//import { getContacts } from "../api";
import Navbar from '../components/Navbar/Navbar';
import './Root.scss';
// async function loader() {
// const contacts = await getContacts();
// return { contacts };
// }
function Root() {
// const { contacts } = useLoaderData();
return (
<>
<Navbar />
<div id="page">
<Outlet />
</div>
{/* <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> */}
</>
);
}
//export { loader };
export default Root;
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.