Code Monkey home page Code Monkey logo

gatsby-storyblok-image's People

Contributors

arkgor avatar chrisbrown-io avatar daniel-bejamas avatar dependabot[bot] avatar gurschitz avatar johnnywalker avatar thomkrupa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gatsby-storyblok-image's Issues

Getting null back from both functions

I am trying to use this for a fluid image however when I'm passing the image object it is returning null

import { getFixedGatsbyImage } from "gatsby-storyblok-image"

const TypeImages: FC<typeImagesProps> = ({ type }) => {
  // Extract the active type from context
  const { activeType, activeFragranceIndex } = useContext(ProductContext)
  if (!activeType || !activeType) return null

  const { type: typeName, image: typeImage } = type

  const image = getFixedGatsbyImage(typeImage, { width: 900 })

Add support for Cloudinary assets

All assets not coming directly from Storyblok are automatically rejected. We need to find a way to support also images from Cloudinary as it is a secondary asset manager possible to use in Storyblok.

.svg images not working

I found out .svg images are not handled properly. Most of the times the url of svg's is //a.storyblok.com/f/123321/x/12345678/xzy.svg
3rd part of the URL stands for size (?) and just "x" doesn't match with the current regex what breaks the image formatting

Blur Up Effect not working

Hi,
I came across this package recently, really glad I found it. However, I can't get the blur effect (on load) to work. Right now, the image is initially not showing at all. Once it's loaded, it shows. But no blur-up effect. I am using storybloks asset manager and I pretty much just copied your example:

import SbEditable from 'storyblok-react'
import Img from 'gatsby-image'
import { getFixedGatsbyImage } from 'gatsby-storyblok-image'
import { getFluidGatsbyImage } from 'gatsby-storyblok-image'

const FluidImage2 = ({ imgUrl }) => {
  const fluidProps = getFluidGatsbyImage(imgUrl, {
    maxWidth: 900,
    quality: 100,
  })

  return (
    <SbEditable content={imgUrl}>
      <Img
        fluid={fluidProps}
        style={{ width: '100%', height: '100%' }}
      />
    </SbEditable>
  )
}

Am I missing anything? Is there a setting or prop I am not aware of?

Thanks a lot!

The prop `fluid` or `fixed` is marked as required in `Image`, but their values are both `undefined`.

Hi I am having a this error

warning: Failed prop type: The prop fluid or fixed is marked as required in Image, but their values are both undefined.

import React from 'react';
import SbEditable from "storyblok-react"
import Img from "gatsby-image";
import { getFluidGatsbyImage } from 'gatsby-storyblok-image'
import { render } from "storyblok-rich-text-react-renderer"

const Program = ({ blok }) => {
    const img = blok.image
    const fluidProps = getFluidGatsbyImage(img, {
    maxHeight: 400
  })
    return (
             <SbEditable content={blok} key={blok._uid}>
    <Layout pageTitle="title">

      <PageHeader title={blok.pagetitle} />
    <section>
      <div>
        <div>
          <div>
            <div>
                <div>
                    <Img fluid={fluidProps} />
                </div>
                <div className="blog-one__content">
                  <h1>{blok.title}</h1>             
                  {render(blok.description)}
              </div> 
            </div>
          </div>
        </div>
      </div>
    </section>
</Layout>
            </SbEditable>
  );
}

export default Program;

Warning: Failed prop type: Invalid prop `fixed` supplied to `Image`

Hi there,

I'm experiencing issues with the fixed property not being recognized. However, the component is rendering just fine.

Console error:
Warning: Failed prop type: Invalid prop fixedsupplied toImage. in Image (at fixed_image.js:14)

Component:

import React from 'react'
import SbEditable from 'storyblok-react'
import Img from 'gatsby-image'
import { getFixedGatsbyImage } from 'gatsby-storyblok-image'

const FixedImage = ({ blok }) => {
  if (blok.image !== 'undefined' && blok.image !== '') {
    const fixedProps = getFixedGatsbyImage(blok.image, {
      width: 900
    });

    return (
      <SbEditable content={blok}>
        <Img fixed={fixedProps} />
      </SbEditable>
    )
  }
  return (
    <SbEditable content={blok}>
      <p>Please upload image</p>
    </SbEditable>
  )
}

export default FixedImage

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.