Skip to content

Commit

Permalink
add utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatyana-js committed Dec 24, 2024
1 parent 53f9e84 commit d04344a
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="en" class="h-100">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
Expand Down
11 changes: 6 additions & 5 deletions frontend/src/components/App.jsx → frontend/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import 'bootstrap/dist/css/bootstrap.min.css';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { Container, Navbar } from 'react-bootstrap';
import PageNotFound from './PageNotFound.jsx';
import MainPage from './MainPage.jsx';
import LoginPage from './LoginPage.jsx';
import PageNotFound from './pages/PageNotFound.jsx';
import MainPage from '../components/MainPage.jsx';
import LoginPage from './pages/LoginPage.jsx';
import router from './utils/routes.js';

const App = () => {
return (
Expand All @@ -17,8 +18,8 @@ const App = () => {
</Navbar>
<Routes>
<Route path="*" element={<PageNotFound />} />
<Route path="/" element={<MainPage />} />
<Route path="/login" element={<LoginPage />} />
<Route path={router.main} element={<MainPage />} />
<Route path={router.login} element={<LoginPage />} />
</Routes>
</div>
</BrowserRouter>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/сhatComponents/MessageField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const MessageField = () => {
<p className="m-0">
<b># general</b>
</p>
<span className="text-muted">1 сообщение</span>
<span className="text-muted">0 сообщений</span>
</div>
<div id="messages-box" className="chat-messages overflow-auto px-5 ">{}</div>
<MessageForm />
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/init.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import i18next from 'i18next';
import { I18nextProvider, initReactI18next } from 'react-i18next';
import { Provider } from 'react-redux';
import store from './slices/index.js';
import App from './components/App';
import store from './store/index.js';
import App from './App.jsx';
import resources from './locales/index.js';

const init = async () => {
Expand All @@ -21,7 +21,6 @@ const init = async () => {
<App />
</I18nextProvider>
</Provider>

);
};

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions frontend/src/index.jsx → frontend/src/store/store.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ReactDOM from 'react-dom/client';
import init from './init.jsx';
import './index.css';
import init from '../init.jsx';
import '../index.css';

const app = async () => {
const root = ReactDOM.createRoot(document.querySelector('#root'));
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/utils/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
login: '/login',
main: '/',
};

0 comments on commit d04344a

Please sign in to comment.