1- import projects from "../utils/projects" ;
1+ import { mainProjects , miniProjects } from "../utils/projects" ;
22import "./Projects.css" ;
33import { Link , useLocation , useNavigate } from "react-router-dom" ;
44import { useEffect , useRef , useState } from "react" ;
55
66export default function Projects ( ) {
77 const location = useLocation ( ) ;
8+
9+ const isMini = location . pathname . includes ( "mini-projects" ) ;
10+ const projects = isMini ? miniProjects : mainProjects ;
811 const [ animating , setAnimating ] = useState ( false ) ;
912 const [ hideOverlay , setHideOverlay ] = useState ( false ) ;
1013 const [ fsStyle , setFsStyle ] = useState < any > ( { } ) ;
@@ -18,7 +21,7 @@ export default function Projects() {
1821 const navigate = useNavigate ( ) ;
1922
2023 useEffect ( ( ) => {
21- if ( transitionProject ) {
24+ if ( transitionProject && ! isMini ) {
2225 setAnimating ( true ) ;
2326 setHideOverlay ( false ) ;
2427 setFsStyle ( { } ) ;
@@ -65,7 +68,7 @@ export default function Projects() {
6568 </ div >
6669 ) }
6770 < div className = "projects-header" >
68- < h1 > My Projects</ h1 >
71+ < h1 > { isMini ? "Mini" : "My" } Projects</ h1 >
6972 < Link to = "/" >
7073 < h3 > Back to home</ h3 >
7174 </ Link >
@@ -87,7 +90,9 @@ export default function Projects() {
8790 : undefined
8891 }
8992 onClick = { ( ) => {
90- navigate ( "/projects/" + project . id ) ;
93+ navigate (
94+ ( isMini ? "/mini-projects/" : "/projects/" ) + project . id
95+ ) ;
9196 } }
9297 >
9398 < img
@@ -101,6 +106,22 @@ export default function Projects() {
101106 </ div >
102107 </ div >
103108 ) ) }
109+
110+ < div
111+ className = { `project-card` }
112+ onClick = { ( ) => {
113+ navigate ( `/${ isMini ? "projects" : "mini-projects" } ` ) ;
114+ } }
115+ >
116+ < div className = "mini-projects" >
117+ < h1 > { isMini ? "Main" : "Mini" } Projects</ h1 >
118+ < h2 >
119+ { isMini
120+ ? "Larger, high effort projects with a greater degree of polish"
121+ : "Small or fun projects that didn't quite make the main cut!" }
122+ </ h2 >
123+ </ div >
124+ </ div >
104125 </ div >
105126 </ div >
106127 ) ;
0 commit comments