Skip to content

Commit

Permalink
Fix the icon styled component and update the demo gif in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rick-nu committed Mar 22, 2022
1 parent e2203e5 commit 0238c9a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ deployments are successful. All in one overview. This is all done via **webhooks

## Example

![Dashboard demonstration](docs/images/dashboard.png)
![Dashboard demonstration](docs/images/dashboard.gif)

# :warning: version 3 :warning:

Expand Down
Binary file added docs/images/dashboard.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/dashboard.png
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ deployments are successful. All in one overview. This is all done via **webhooks

The time that deployments were scary is over, lets make them FUN!

![dashboard example](images/dashboard.png)
![dashboard example](images/dashboard.gif)
21 changes: 13 additions & 8 deletions frontend/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,27 @@ type Props = {
title?: string;
};

type SpanProps = {
state?: State;
};

const Span = styled.span<SpanProps>`
${(props) =>
props.state &&
css`
color: ${stateColor[props.state]};
`}
`;

const Icon = ({ icon, state, title }: Props): ReactElement => {
const classes = ['icon'];

if (['autorenew'].includes(icon)) {
classes.push('spin');
}

const Span = styled.span`
${state &&
css`
color: ${stateColor[state]};
`}
`;

return (
<Span className={classes.join(' ')} title={title || ''}>
<Span state={state} className={classes.join(' ')} title={title || ''}>
{icon}
</Span>
);
Expand Down

0 comments on commit 0238c9a

Please sign in to comment.