Skip to content

Commit

Permalink
Animate icon button (#156)
Browse files Browse the repository at this point in the history
* Animate icon button

* Bump version
  • Loading branch information
Mrtenz authored Oct 13, 2021
1 parent b3b6525 commit 56fb9b0
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mycrypto/ui",
"version": "1.4.2",
"version": "1.4.3",
"description": "The shared UI component library used across all MyCrypto products.",
"repository": "MyCryptoHQ/ui",
"keywords": [
Expand Down
5 changes: 5 additions & 0 deletions src/assets/icons/blog.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/atoms/Icon.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ import { Icon } from './Icon';
</Story>
</Canvas>

## Blog

<Canvas>
<Story name="Blog" args={{ width: 25, type: 'blog' }}>
{(props) => <Icon {...props} />}
</Story>
</Canvas>

## Caret

<Canvas>
Expand Down
2 changes: 2 additions & 0 deletions src/atoms/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { BoxProps } from '.';
import { Box } from '.';
import alert from '../assets/icons/alert.svg';
import arrow from '../assets/icons/arrow.svg';
import blog from '../assets/icons/blog.svg';
import caret from '../assets/icons/caret.svg';
import checkmark from '../assets/icons/checkmark.svg';
import copy from '../assets/icons/copy.svg';
Expand Down Expand Up @@ -33,6 +34,7 @@ import twitter from '../assets/logos/twitter.svg';
export const icons = {
alert,
arrow,
blog,
caret,
checkmark,
copy,
Expand Down
1 change: 0 additions & 1 deletion src/atoms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export * from './Container';
export * from './Breadcrumb';
export * from './Panel';
export * from './FooterSeparator';
export * from './IconButton';
export * from './Copyable';

export { default as Spinner } from './Spinner';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
import { IconButton } from './IconButton';

<Meta
title="atoms/IconButton"
title="molecules/IconButton"
component={IconButton}
parameters={{ actions: { argTypesRegex: '^on.*' } }}
/>
Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions src/atoms/IconButton.tsx → src/molecules/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { FunctionComponent } from 'react';
import type { ButtonProps } from 'rebass/styled-components';

import { Button } from './Button';
import type { IconType } from './Icon';
import { Icon } from './Icon';
import { Button, Icon } from '../atoms';
import type { IconType } from '../atoms';

export interface IconButtonProps {
icon: IconType;
Expand Down
1 change: 1 addition & 0 deletions src/molecules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from './HeaderButton';
export * from './Breadcrumbs';
export * from './DonateButton';
export * from './SubscribeInput';
export * from './IconButton';
6 changes: 5 additions & 1 deletion src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,11 @@ export const theme = {
fontSize: 2,
fontFamily: 'body',
padding: '8px',
boxShadow: '0px 3px 6px rgba(0, 0, 0, 0.07)'
boxShadow: '0px 3px 6px rgba(0, 0, 0, 0.07)',
transition: 'transform 0.3s ease 0s',
'&:hover': {
transform: 'scale(1.05)'
}
}
},
variants: {
Expand Down

0 comments on commit 56fb9b0

Please sign in to comment.