Skip to content

Commit

Permalink
Add index.js files in homogeneous units (components and pages)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamIvan-ark committed Jan 14, 2024
1 parent cffb711 commit 4847304
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
10 changes: 6 additions & 4 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import {
import 'react-toastify/dist/ReactToastify.css';

import { hooks } from './providers';
import MainPage from './pages/MainPage';
import LoginPage from './pages/LoginPage';
import NotFoundPage from './pages/NotFoundPage';
import SignupPage from './pages/SignupPage';
import {
MainPage,
LoginPage,
NotFoundPage,
SignupPage,
} from './pages';

const ConditionalRoute = ({ children, redirectWhenAuthIsExist, redirectTo }) => {
const auth = hooks.useAuth();
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { default as LoginForm } from './LoginForm';
export { default as Navbar } from './Navbar';
export { default as SignupForm } from './SignupForm';
export { default as Chat } from './chat/Chat';
3 changes: 1 addition & 2 deletions frontend/src/pages/LoginPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { Link } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { Image } from 'react-bootstrap';

import LoginForm from '../components/LoginForm';
import Navbar from '../components/Navbar';
import { LoginForm, Navbar } from '../components';
import totaImg from '../assets/img/Tota-with-flag.jpg';

const LoginPage = () => {
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/pages/MainPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Spinner } from 'react-bootstrap';
import { useDispatch } from 'react-redux';
import { useTranslation } from 'react-i18next';

import Navbar from '../components/Navbar';
import Chat from '../components/chat/Chat';
import { Navbar, Chat } from '../components';
import { hooks } from '../providers';
import { fetchChatData } from '../api/serverApi';
import { serverRoutes } from '../utils/routes';
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/SignupPage.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Image } from 'react-bootstrap';
import SignupForm from '../components/SignupForm';
import Navbar from '../components/Navbar';

import { SignupForm, Navbar } from '../components';
import totaImg from '../assets/img/Tota-celebrating.jpg';

const SignupPage = () => (
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { default as LoginPage } from './LoginPage';
export { default as MainPage } from './MainPage';
export { default as NotFoundPage } from './NotFoundPage';
export { default as SignupPage } from './SignupPage';

0 comments on commit 4847304

Please sign in to comment.