Commit 87e8368 1 parent 695dd1b commit 87e8368 Copy full SHA for 87e8368
File tree 3 files changed +33
-0
lines changed
3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 25
25
"react" : " ^18.2.0" ,
26
26
"react-dom" : " ^18.2.0" ,
27
27
"react-simple-typewriter" : " ^5.0.1" ,
28
+ "react-spinners" : " ^0.13.8" ,
28
29
"react-tsparticles" : " ^2.10.1" ,
29
30
"tabler-icons-react" : " ^1.56.0" ,
30
31
"typescript" : " 5.1.3"
Original file line number Diff line number Diff line change 1
1
// https://stackoverflow.com/questions/74965849/youre-importing-a-component-that-needs-usestate-it-only-works-in-a-client-comp
2
2
"use client" ; // This is a client component 👈🏽
3
+ import { PuffLoader } from "react-spinners" ;
3
4
4
5
// css styling
5
6
// import styles from "./page.module.css";
@@ -11,6 +12,8 @@ import { Skills } from "./components/Skills";
11
12
import { Contact } from "./components/Contact" ;
12
13
import { HeroImageBackground } from "./components/HeroImageBackground" ;
13
14
15
+ import { useState , useEffect } from "react" ;
16
+
14
17
const useStyles = createStyles ( ( theme ) => ( {
15
18
main : {
16
19
// minHeight: "100vh",
@@ -32,6 +35,30 @@ const useStyles = createStyles((theme) => ({
32
35
33
36
export default function Home ( ) {
34
37
const { classes } = useStyles ( ) ;
38
+ const [ loading , setLoading ] = useState ( true ) ;
39
+ useEffect ( ( ) => {
40
+ setLoading ( false ) ;
41
+ } , [ ] ) ;
42
+
43
+ if ( loading ) {
44
+ return (
45
+ < div
46
+ style = { {
47
+ display : "flex" ,
48
+ justifyContent : "center" ,
49
+ alignItems : "center" ,
50
+ height : "100vh" ,
51
+ } }
52
+ >
53
+ < PuffLoader
54
+ color = "#1db954"
55
+ size = { 100 }
56
+ loading = { loading }
57
+ aria-label = "Loading Spinner"
58
+ />
59
+ </ div >
60
+ ) ;
61
+ }
35
62
return (
36
63
< main className = { classes . main } >
37
64
< HeroImageBackground />
Original file line number Diff line number Diff line change @@ -2405,6 +2405,11 @@ react-simple-typewriter@^5.0.1:
2405
2405
resolved "https://registry.yarnpkg.com/react-simple-typewriter/-/react-simple-typewriter-5.0.1.tgz#cfdb896c868a55ed4d5f1f06d62b3a9d0f5ad9d7"
2406
2406
integrity sha512-vA5HkABwJKL/DJ4RshSlY/igdr+FiVY4MLsSQYJX6FZG/f1/VwN4y1i3mPXRyfaswrvI8xii1kOVe1dYtO2Row==
2407
2407
2408
+ react-spinners@^0.13.8 :
2409
+ version "0.13.8"
2410
+ resolved "https://registry.yarnpkg.com/react-spinners/-/react-spinners-0.13.8.tgz#5262571be0f745d86bbd49a1e6b49f9f9cb19acc"
2411
+ integrity sha512-3e+k56lUkPj0vb5NDXPVFAOkPC//XyhKPJjvcGjyMNPWsBKpplfeyialP74G7H7+It7KzhtET+MvGqbKgAqpZA==
2412
+
2408
2413
react-style-singleton@^2.2.1 :
2409
2414
version "2.2.1"
2410
2415
resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.2.1.tgz#f99e420492b2d8f34d38308ff660b60d0b1205b4"
You can’t perform that action at this time.
0 commit comments