Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improview #40

Merged
merged 10 commits into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions components/PrismicScript.js

This file was deleted.

3 changes: 2 additions & 1 deletion components/post/slices/ImageWithCaption/DefaultImage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import Image from 'next/image'
import Caption from './Caption'

/**
Expand All @@ -12,7 +13,7 @@ const DefaultImage = ({ slice }) => {
return (
<div className="post-part single container">
<div className={`block-img ${slice.slice_label}`}>
<img src={imageUrl} alt={imageAlt} />
<Image src={imageUrl} alt={imageAlt} layout="fill" objectFit="cover"/>
<Caption caption={caption} />
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion components/post/slices/ImageWithCaption/FullWidthImage.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import React from 'react'
import Image from "next/image"
import Caption from './Caption'

/**
* Full width image component
*/
const FullWidthImage = ({ slice }) => {
const imageUrl = slice.primary.image.url
const imageAlt = slice.primary.image.imageAlt
const caption = slice.primary.caption

return (
<div
className="blog-header single"
style={{ backgroundImage: `url(${imageUrl})` }}
>
<Image src={imageUrl} alt={imageAlt} layout="fill" objectPosition="top" objectFit="cover"/>
<div className="wrapper">
<Caption caption={caption} />
</div>
Expand Down
21 changes: 12 additions & 9 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
const path = require("path");

module.exports = {
target: "serverless",
webpack(config) {
config.resolve.modules.push(path.resolve("./"));
return config;
}
};
const path = require('path')

module.exports = {
target: 'serverless',
webpack (config) {
config.resolve.modules.push(path.resolve('./'))
return config
},
images: {
domains: ['images.prismic.io']
}
}
Loading