Skip to content

Commit

Permalink
fix: provide fallback for theme obj (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kait Moreno committed Oct 26, 2018
1 parent a3e281e commit 1fe7960
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/components/Spinner/components/LoadingSpinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const horizontalStyles = css`
width: ${spacingScale(2)};
`;

export function LoadingSpinner(props) {
export function LoadingSpinner({ theme = {}, ...props }) {
return (
<SpinnerSVG
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -44,22 +44,13 @@ export function LoadingSpinner(props) {
<linearGradient id="gradient" x1="0%" y1="0%" x2="0%" y2="100%">
<stop
offset="0%"
stopColor={transparentize(
0.85,
props.theme.brandColor || SPINNER_COLOR
)}
stopColor={transparentize(0.85, theme.brandColor || SPINNER_COLOR)}
/>
<stop
offset="33%"
stopColor={transparentize(
0.85,
props.theme.brandColor || SPINNER_COLOR
)}
/>
<stop
offset="100%"
stopColor={props.theme.brandColor || SPINNER_COLOR}
stopColor={transparentize(0.85, theme.brandColor || SPINNER_COLOR)}
/>
<stop offset="100%" stopColor={theme.brandColor || SPINNER_COLOR} />
</linearGradient>
</defs>
<circle
Expand Down

0 comments on commit 1fe7960

Please sign in to comment.