Skip to content

Commit

Permalink
Use updated js-utils to handle Kinja images (#119)
Browse files Browse the repository at this point in the history
* update image transforms

* Update js-utils lock

* Add TypeScript types

Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
itsjustbrian and actions-user authored Jul 20, 2022
1 parent bd8329e commit 5b0a144
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.DS_Store
.storybook/build
.vscode
8 changes: 4 additions & 4 deletions dist/ColorScheme/ColorScheme.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ColorScheme/ColorScheme.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"devDependencies": {
"@babel/core": "^7.12.9",
"@quartz/eslint-config-react": "^1.1.5",
"@quartz/js-utils": "^1.1.1",
"@quartz/js-utils": "^2.0.0",
"@quartz/stylelint-config": "^1.2.0",
"@storybook/addon-a11y": "^6.1.10",
"@storybook/addon-actions": "^6.1.10",
Expand Down
2 changes: 1 addition & 1 deletion src/components/ColorScheme/ColorScheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export default function ColorScheme( props: {
*/
accent: string,

/**
/**
* The color used for borders of focused interactive elements, accented
* color blocks, article text links, certain headings, etc. on navigation.
* Defaults to `accent`.
Expand Down
6 changes: 3 additions & 3 deletions src/components/ResponsiveImage/ResponsiveImage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Image } from '..';
import { arrayFromRange, resizeWPImage } from '@quartz/js-utils';
import { arrayFromRange, resizeImage } from '@quartz/js-utils';

export default function ResponsiveImage( props: {
/**
Expand Down Expand Up @@ -85,7 +85,7 @@ export default function ResponsiveImage( props: {

// Map source widths to image URLs
const srcSet = srcWidths
.map( width => `${resizeWPImage( src, width, aspectRatio * width, true, quality )} ${width}w` )
.map( width => `${resizeImage( src, width, aspectRatio * width, true, quality )} ${width}w` )
.join();

// If no `sizes` prop was specified, assume the image has a fixed width
Expand All @@ -97,7 +97,7 @@ export default function ResponsiveImage( props: {
amp={amp}
className={className}
sizes={sizes || sizesDefault}
src={resizeWPImage( src, fallbackWidth, fallbackHeight )}
src={resizeImage( src, fallbackWidth, fallbackHeight )}
srcSet={srcSet}
fallbackWidth={fallbackWidth}
fallbackHeight={fallbackHeight}
Expand Down

0 comments on commit 5b0a144

Please sign in to comment.