Skip to content

Update README/docs to omit picture() usage w/ Node/React #32

@aflansburg

Description

@aflansburg

adaptive/source/tree.ts only exports one method which is makePictureTree()

export const makePictureTree = (handle?: FileHandle, opts?: PictureOptions): Picture => {

However, README references a picture() method. I haven't delved too much into this so excuse my poor usage of the utility as far as options go but it appears I can do:

<GridList cellHeight={160} cols={3}>
      {hits
        .filter(hit => !hit.filename.toLowerCase().includes('heic'))
        .map(tile => {
          const options = {
            sizes: { fallback: '20vw' },
            resolutions: [540, 1080]
          };
          const tree = makePictureTree(tile.objectID, options);
          console.log(tree);
          const renderImage = imageObj => <img alt={tile.filename} {...imageObj} />;
          return (
            <GridListTile key={tile.image} cols={1} style={{ minHeight: 250 }}>
              <picture>{renderImage(tree.img)}</picture>
            </GridListTile>
          );
        })}
    </GridList>

Using Material UI GridList and Algolia React InstantSearch currently in a test project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions