diff --git a/src/App.jsx b/src/App.jsx index bdfe690..c7cd3db 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -2,11 +2,9 @@ import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; import { Home, Layout, List, ManageList } from './views'; -import { useAuth } from './api'; +import { useAuth, useShoppingListData, useShoppingLists } from '@api'; -import { useShoppingListData, useShoppingLists } from './api'; - -import { useStateWithStorage } from './utils'; +import { useStateWithStorage } from '@utils'; export function App() { /** diff --git a/src/api/firebase.js b/src/api/firebase.js index 916a7db..ce3bff5 100644 --- a/src/api/firebase.js +++ b/src/api/firebase.js @@ -14,7 +14,7 @@ import { } from 'firebase/firestore'; import { useEffect, useState } from 'react'; import { db } from './config'; -import { getDaysBetweenDates, getFutureDate } from '../utils'; +import { getDaysBetweenDates, getFutureDate } from '@utils'; import { calculateEstimate } from '@the-collab-lab/shopping-list-utils'; /** diff --git a/src/api/index.js b/src/api/index.js index cfb8131..db155c4 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,2 +1,2 @@ export * from './firebase'; -export { useAuth } from './useAuth'; +export * from './useAuth'; diff --git a/src/components/NavBar/NavBar.jsx b/src/components/NavBar/NavBar.jsx index 120967d..614d344 100644 --- a/src/components/NavBar/NavBar.jsx +++ b/src/components/NavBar/NavBar.jsx @@ -1,7 +1,7 @@ import { useState } from 'react'; -import NavBarContent from './NavBarContent'; +import { NavBarContent } from '@components'; -export function NavBar({ user, lists, listPath }) { +const NavBar = ({ user, lists, listPath }) => { const [isNavOpen, setIsNavOpen] = useState(false); return ( @@ -78,4 +78,6 @@ export function NavBar({ user, lists, listPath }) { ); -} +}; + +export default NavBar; diff --git a/src/components/NavBar/NavBarContent.jsx b/src/components/NavBar/NavBarContent.jsx index 6021077..473cfd7 100644 --- a/src/components/NavBar/NavBarContent.jsx +++ b/src/components/NavBar/NavBarContent.jsx @@ -1,10 +1,9 @@ import { useTranslation } from 'react-i18next'; -import { SignOut } from '../../api/useAuth.jsx'; -import { NavigationLink } from './NavigationLink.jsx'; +import { SignOut } from '@api'; import { useNavigate } from 'react-router-dom'; -import { ButtonWithIcon } from '../ButtonWithIcon.jsx'; +import { ButtonWithIcon, NavigationLink } from '@components'; -export default function NavLinks({ listPath, lists, setIsNavOpen }) { +const NavBarContent = ({ listPath, lists, setIsNavOpen }) => { const navigate = useNavigate(); const { t } = useTranslation(); @@ -60,4 +59,6 @@ export default function NavLinks({ listPath, lists, setIsNavOpen }) { /> ); -} +}; + +export default NavBarContent; diff --git a/src/components/NavBar/NavigationLink.jsx b/src/components/NavBar/NavigationLink.jsx index 9f836c6..df5775a 100644 --- a/src/components/NavBar/NavigationLink.jsx +++ b/src/components/NavBar/NavigationLink.jsx @@ -1,6 +1,6 @@ import { NavLink } from 'react-router-dom'; -export function NavigationLink({ text, destination, handleClick, icon }) { +const NavigationLink = ({ text, destination, handleClick, icon }) => { return ( ); -} +}; + +export default NavigationLink; diff --git a/src/components/NavBar/index.js b/src/components/NavBar/index.js deleted file mode 100644 index 46466d5..0000000 --- a/src/components/NavBar/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export * from './NavBar'; -export * from './NavigationLink'; -// export * from './ButtonWithIcon'; -export * from './NavLinks'; diff --git a/src/components/ButtonWithIcon.jsx b/src/components/custom-components/ButtonWithIcon.jsx similarity index 65% rename from src/components/ButtonWithIcon.jsx rename to src/components/custom-components/ButtonWithIcon.jsx index 50d78e7..0e294c7 100644 --- a/src/components/ButtonWithIcon.jsx +++ b/src/components/custom-components/ButtonWithIcon.jsx @@ -1,4 +1,4 @@ -export function ButtonWithIcon({ text, handleClick, icon }) { +const ButtonWithIcon = ({ text, handleClick, icon }) => { return (