Use next/image for all <img> tags
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import React from "react";
|
||||
import Image from "next/image";
|
||||
import styled from "styled-components";
|
||||
import colors from "@theme/colors";
|
||||
import { Event } from "@models/Event";
|
||||
@@ -21,10 +22,6 @@ const StyledTextSection = styled(TextSection)`
|
||||
p {
|
||||
color: ${colors.orange1};
|
||||
}
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -47,9 +44,13 @@ const EventPageView: React.FC<EventPageViewProps> = ({ event }) => {
|
||||
<p>
|
||||
{event.description_fi}
|
||||
</p>
|
||||
<div>
|
||||
<img src={event.image || event.tags[0].icon} alt={event.title_fi} />
|
||||
</div>
|
||||
<Image
|
||||
src={event.image || event.tags[0].icon}
|
||||
alt={event.title_fi}
|
||||
layout="responsive"
|
||||
width={0}
|
||||
height={0}
|
||||
/>
|
||||
</h1>
|
||||
<div>
|
||||
<Content source={event.content_fi} escapeHtml={false} />
|
||||
|
||||
Reference in New Issue
Block a user