Merge pull request #13260 from cone56/next

Addon-backgrounds: Fix grid offset always using default value
This commit is contained in:
Michael Shilman 2020-11-29 20:42:56 +08:00 committed by GitHub
commit bfc0ed02cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,8 +33,8 @@ export const withGrid = (StoryFn: StoryFunction, context: StoryContext) => {
const isLayoutPadded = parameters.layout === undefined || parameters.layout === 'padded';
// 16px offset in the grid to account for padded layout
const defaultOffset = isLayoutPadded ? 16 : 0;
const offsetX = gridParameters.offsetX || isInDocs ? 20 : defaultOffset;
const offsetY = gridParameters.offsetY || isInDocs ? 20 : defaultOffset;
const offsetX = gridParameters.offsetX ?? (isInDocs ? 20 : defaultOffset);
const offsetY = gridParameters.offsetY ?? (isInDocs ? 20 : defaultOffset);
const gridStyles = useMemo(() => {
const selector =