-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: Move homepage to about page
- Update 'App' route to use a wildcard in the 'homepage' path. - Rename the 'HomePage' component and stylesheet to 'AboutPage'. - Update classnames in 'AboutPage' to match the new naming convention.
- Loading branch information
Showing
4 changed files
with
64 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React, { useEffect } from 'react'; | ||
|
||
import profileImage from '../../assets/images/profile/profile.png'; | ||
import homepageDotsImage from '../../assets/images/bg/homepage-dots-img.png'; | ||
import '../../styles/pages/AboutPage.scss'; | ||
|
||
const AboutPage: React.FC = () => { | ||
useEffect(() => { | ||
const $aboutPage = document.querySelector<HTMLDivElement>('#aboutPage'); | ||
if ($aboutPage) { | ||
$aboutPage.style.display = 'flex'; // ?overrides the {display: none} on 'aboutPage.scss'. This is to prevent the aboutPage from showing before animation is applied. | ||
$aboutPage.classList.add('blend-in-out'); | ||
} | ||
}); | ||
|
||
return ( | ||
<section id="aboutPage" className="aboutPage container"> | ||
<div className="aboutPage__about"> | ||
<h1 className="aboutPage__about-title text-hue-rotate"> | ||
i'm arthur! your dev | ||
<span className="emoji">👋</span> | ||
</h1> | ||
<p className="aboutPage__about-p"> | ||
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Esse, | ||
suscipit et? Quo facere fugiat deserunt expedita pariatur consequuntur | ||
quos possimus quidem repellat ipsam sequi, mollitia perspiciatis | ||
suscipit id ipsa voluptates. | ||
</p> | ||
</div> | ||
<div className="aboutPage__images"> | ||
<img | ||
src={homepageDotsImage} | ||
alt="an abstract dotted figure" | ||
className="image-layer figure rotate-hue-rotate" | ||
/> | ||
<img | ||
src={profileImage} | ||
alt="my profile" | ||
className="image-layer profile" | ||
/> | ||
</div> | ||
</section> | ||
); | ||
}; | ||
|
||
export default AboutPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,18 @@ | ||
import React, { useEffect } from 'react'; | ||
import React from 'react'; | ||
import { Routes, Route, Outlet } from 'react-router-dom'; | ||
|
||
import profileImage from '../../assets/images/profile/profile.png'; | ||
import homepageDotsImage from '../../assets/images/bg/homepage-dots-img.png'; | ||
import '../../styles/pages/HomePage.scss'; | ||
import AboutPage from './AboutPage.tsx'; | ||
import LineCount from '../UI/LineCount.tsx'; | ||
|
||
const HomePage = () => { | ||
useEffect(() => { | ||
const $homepage = document.querySelector<HTMLDivElement>('#homepage'); | ||
if ($homepage) { | ||
$homepage.style.display = 'flex'; // ?overrides the {display: none} on 'HomePage.scss'. This is to prevent the homepage from showing before animation is applied. | ||
$homepage.classList.add('blend-in-out'); | ||
} | ||
}); | ||
|
||
return ( | ||
<section id="homepage" className="homepage container"> | ||
<div className="homepage__about"> | ||
<h1 className="homepage__about-title text-hue-rotate"> | ||
i'm arthur! your dev | ||
<span className="emoji">👋</span> | ||
</h1> | ||
<p className="homepage__about-p"> | ||
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Esse, | ||
suscipit et? Quo facere fugiat deserunt expedita pariatur consequuntur | ||
quos possimus quidem repellat ipsam sequi, mollitia perspiciatis | ||
suscipit id ipsa voluptates. | ||
</p> | ||
</div> | ||
<div className="homepage__images"> | ||
<img | ||
src={homepageDotsImage} | ||
alt="an abstract dotted figure" | ||
className="image-layer figure rotate-hue-rotate" | ||
/> | ||
<img | ||
src={profileImage} | ||
alt="my profile" | ||
className="image-layer profile" | ||
/> | ||
</div> | ||
</section> | ||
); | ||
}; | ||
const HomePage: React.FC = () => ( | ||
<> | ||
<LineCount /> | ||
<Routes> | ||
<Route path="/" element={<Outlet />}> | ||
<Route path="/" element={<AboutPage />} /> | ||
</Route> | ||
</Routes> | ||
</> | ||
); | ||
|
||
export default HomePage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters