Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
Dont change delay when running chromatic
Browse files Browse the repository at this point in the history
  • Loading branch information
jgzuke committed Nov 18, 2019
1 parent 0698241 commit 8431303
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Loaders/LoadingSpinner.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @jsx jsx */
import React from "react";
import * as CSS from "csstype";
import isChromatic from "storybook-chromatic/isChromatic";
import { jsx, keyframes } from "@emotion/core";
import { colors } from "../colors";

Expand Down Expand Up @@ -74,7 +75,7 @@ export const LoadingSpinner: React.FC<Props> = ({
const pixelSize = SIZE_MAP[size];

const mountTime = React.useRef(Date.now());
const mountDelay = -(mountTime.current % 540);
const mountDelay = isChromatic() ? 0 : -(mountTime.current % 540);

return (
<svg
Expand Down
4 changes: 4 additions & 0 deletions typings/storybook-chromatic__isChromatic/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "storybook-chromatic/isChromatic" {
const isChromatic: () => boolean;
export default isChromatic;
}

0 comments on commit 8431303

Please sign in to comment.