55 Icon ,
66 Image ,
77 Link ,
8+ Skeleton ,
89 Text ,
910 VStack ,
1011} from "@chakra-ui/react" ;
@@ -23,9 +24,14 @@ type GetStartedLinkProps = {
2324
2425export const GetStartedLink = ( props : GetStartedLinkProps ) => {
2526 const t = useTranslations ( "GetStartedModule" ) ;
27+ const [ imageLoaded , setImageLoaded ] = useState ( false ) ;
2628 const { href, badges, heading, imageSource, imageAlt } = props ;
2729 const [ isElementHovered , setIsElementHovered ] = useState ( false ) ;
2830
31+ const handleImageLoad = ( ) => {
32+ setImageLoaded ( true ) ;
33+ } ;
34+
2935 return (
3036 < Link
3137 textDecoration = { "none" }
@@ -79,23 +85,28 @@ export const GetStartedLink = (props: GetStartedLinkProps) => {
7985 />
8086 </ Text >
8187 </ VStack >
82- < Box
83- maxWidth = { { base : "100%" , lg : "80%" } }
84- maxHeight = { { base : "125px" , lg : "none" } }
85- overflow = { { base : "hidden" , lg : "visible" } }
86- >
87- < Image
88- borderTopLeftRadius = { "lg" }
89- borderTopRightRadius = { "lg" }
90- boxShadow = { "lg" }
91- src = { imageSource }
92- alt = { imageAlt }
93- transition = { "transform 0.25s ease-in-out" }
94- transform = {
95- isElementHovered ? "translateY(0px)" : "translateY(10px)"
96- }
97- />
98- </ Box >
88+ < Skeleton loading = { ! imageLoaded } >
89+ < Box
90+ maxWidth = { { base : "100%" , lg : "80%" } }
91+ maxHeight = { { base : "125px" , lg : "none" } }
92+ overflow = { { base : "hidden" , lg : "visible" } }
93+ >
94+ < Image
95+ borderTopLeftRadius = { "lg" }
96+ borderTopRightRadius = { "lg" }
97+ boxShadow = { "lg" }
98+ src = { imageSource }
99+ alt = { imageAlt }
100+ transition = { "transform 0.25s ease-in-out" }
101+ onLoad = { handleImageLoad }
102+ transform = {
103+ isElementHovered ? "translateY(0px)" : "translateY(10px)"
104+ }
105+ width = { "100%" }
106+ height = { "100%" }
107+ />
108+ </ Box >
109+ </ Skeleton >
99110 </ VStack >
100111 </ NextLink >
101112 </ Link >
0 commit comments