Skip to content

Commit

Permalink
Feat: Remove the '/iturres-reactive-portfolio/' prefix from all URL p…
Browse files Browse the repository at this point in the history
…aths

- src/App.tsx
- src/components/UI/AnimatedButton.tsx
- src/components/UI/FileTabsNavbar.tsx
- src/components/UI/Navbar.tsx
- src/components/pages/AboutPage.tsx
- src/components/pages/AccessPage.tsx
- src/components/pages/NotFoundPage.tsx

Since we are now using HashRouter, we don't need to use the
'/iturres-reactive-portfolio/' prefix in the paths anymore.
  • Loading branch information
ITurres committed Mar 2, 2024
1 parent 4540716 commit 2ca42d9
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import NotFoundPage from './components/pages/NotFoundPage.tsx';
const App: React.FC = () => (
<>
<Routes>
<Route path="/iturres-reactive-portfolio/" element={<AccessPage />} />
<Route path="/" element={<AccessPage />} />
<Route
path="/iturres-reactive-portfolio/homepage/*"
path="homepage/*"
element={<HomePage />}
/>
<Route path="/*" element={<NotFoundPage fromPath="/" />} />
Expand Down
15 changes: 3 additions & 12 deletions src/components/UI/AnimatedButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,13 @@ const AnimatedButton: React.FC = () => (
className="animated-button my-btn"
aria-label="navigates to expertise page"
>
<Link
to="/iturres-reactive-portfolio/homepage/expertise"
className="text-hue-rotate"
>
<Link to="/homepage/expertise" className="text-hue-rotate">
languages
</Link>
<Link
to="/iturres-reactive-portfolio/homepage/expertise"
className="text-hue-rotate"
>
<Link to="/homepage/expertise" className="text-hue-rotate">
frameworks
</Link>
<Link
to="/iturres-reactive-portfolio/homepage/expertise"
className="text-hue-rotate"
>
<Link to="/homepage/expertise" className="text-hue-rotate">
skills
</Link>
<a
Expand Down
8 changes: 4 additions & 4 deletions src/components/UI/FileTabsNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const FileTabsNavbar: React.FC = () => {

const paths = useMemo(
() => ({
homepage: '/iturres-reactive-portfolio/homepage',
projects: '/iturres-reactive-portfolio/homepage/projects',
contact: '/iturres-reactive-portfolio/homepage/contact',
expertise: '/iturres-reactive-portfolio/homepage/expertise',
homepage: '/homepage',
projects: '/homepage/projects',
contact: '/homepage/contact',
expertise: '/homepage/expertise',
}),
[],
);
Expand Down
10 changes: 5 additions & 5 deletions src/components/UI/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const Navbar: React.FC = () => {
</a>
</li>
<li style={{ '--elem': 4 } as CSSProperties}>
<Link to="/iturres-reactive-portfolio/">
<Link to="/">
<BiExit size={iconSize} className="text-hue-rotate" title="Exit" />
</Link>
</li>
Expand All @@ -97,7 +97,7 @@ const Navbar: React.FC = () => {
{windowWidth < minWith && (
<>
<li style={{ '--elem': 5 } as CSSProperties}>
<Link to="/iturres-reactive-portfolio/homepage">
<Link to="/homepage">
<SiAboutdotme
size={iconSize}
className="text-hue-rotate"
Expand All @@ -106,7 +106,7 @@ const Navbar: React.FC = () => {
</Link>
</li>
<li style={{ '--elem': 6 } as CSSProperties}>
<Link to="/iturres-reactive-portfolio/homepage/projects">
<Link to="/homepage/projects">
<FaProjectDiagram
size={iconSize}
className="text-hue-rotate"
Expand All @@ -115,7 +115,7 @@ const Navbar: React.FC = () => {
</Link>
</li>
<li style={{ '--elem': 7 } as CSSProperties}>
<Link to="/iturres-reactive-portfolio/homepage/contact">
<Link to="/homepage/contact">
<AiOutlineMail
size={iconSize}
className="text-hue-rotate"
Expand All @@ -124,7 +124,7 @@ const Navbar: React.FC = () => {
</Link>
</li>
<li style={{ '--elem': 8 } as CSSProperties}>
<Link to="/iturres-reactive-portfolio/homepage/expertise">
<Link to="/homepage/expertise">
<LuSquareStack
size={iconSize}
className="text-hue-rotate"
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/AboutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const AboutPage: React.FC = () => {
<AnimatedButton />

<Link
to="/iturres-reactive-portfolio/homepage/contact"
to="/homepage/contact"
className="aboutPage__cta"
title="This link will take you to the contact page."
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/AccessPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const AccessPage = () => {
}
}, 200);

$videoElement.current.addEventListener('ended', () => navigate('/iturres-reactive-portfolio/homepage'));
$videoElement.current.addEventListener('ended', () => navigate('/homepage'));
}
};

Expand Down
4 changes: 1 addition & 3 deletions src/components/pages/NotFoundPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ const AstronautStyleProps = {
const NotFoundPage: React.FC<NotFoundPageProps> = ({ fromPath }) => {
const isWildCardAtAccessPage = fromPath === '/';

const pathTo = isWildCardAtAccessPage
? '/iturres-reactive-portfolio/'
: '/iturres-reactive-portfolio/homepage';
const pathTo = isWildCardAtAccessPage ? '/' : '/homepage';

return (
<main className="not-found-page">
Expand Down

0 comments on commit 2ca42d9

Please sign in to comment.