Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMalfait committed Jun 18, 2024
1 parent 3ab7d03 commit f8a2c02
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';
import React, { useState } from 'react';
import styled from '@emotion/styled';
import Image from 'next/image';
import { usePathname } from 'next/navigation';

import { ArticleContent } from '@/app/_components/ui/layout/articles/ArticleContent';
Expand Down Expand Up @@ -111,7 +112,7 @@ const StyledImageContainer = styled.div<{ loaded: string }>`
`}
`;

const StyledImage = styled(img)<{ loaded: string }>`
const StyledImage = styled(Image)<{ loaded: string }>`
opacity: ${({ loaded }) => (loaded === 'true' ? 1 : 0)};
transition: opacity 250ms ease-in-out;
`;
Expand Down Expand Up @@ -148,6 +149,7 @@ export default function DocsContent({ item }: { item: FileContent }) {
style={{ objectFit: 'cover' }}
onLoad={() => setImageLoaded(true)}
loaded={imageLoaded.toString()}
unoptimized
/>
)}
</StyledImageContainer>
Expand Down

0 comments on commit f8a2c02

Please sign in to comment.