Skip to content

Commit

Permalink
Feature/tag colors (#67)
Browse files Browse the repository at this point in the history
* build: Updated storybook

* feat(tag): Green and gray theme

* fix: Link export
  • Loading branch information
hachiojidev authored Nov 25, 2020
1 parent 28cbb64 commit 60e6e41
Show file tree
Hide file tree
Showing 7 changed files with 698 additions and 484 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
"@commitlint/config-conventional": "^11.0.0",
"@pancakeswap-libs/eslint-config-pancake": "0.1.0",
"@rollup/plugin-typescript": "^6.0.0",
"@storybook/addon-a11y": "^6.0.28",
"@storybook/addon-actions": "^6.0.28",
"@storybook/addon-essentials": "^6.0.28",
"@storybook/addon-links": "^6.0.28",
"@storybook/react": "^6.0.28",
"@storybook/addon-a11y": "^6.1.5",
"@storybook/addon-actions": "^6.1.5",
"@storybook/addon-essentials": "^6.1.5",
"@storybook/addon-links": "^6.1.5",
"@storybook/react": "^6.1.5",
"@types/react": "^16.9.52",
"@types/react-router-dom": "^5.1.6",
"@types/styled-components": "^5.1.4",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Flex/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import Flex from "./index";
import Text from "../Text";
import Link from "../Link";
import { Link } from "../Link";

export default {
title: "Flex",
Expand Down
1 change: 1 addition & 0 deletions src/components/Tag/StyledTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const StyledTag = styled.div<ThemedProps>`
height: 28px;
line-height: 1.5;
padding: 0 8px;
svg {
fill: ${getColor};
}
Expand Down
32 changes: 20 additions & 12 deletions src/components/Tag/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,38 @@ export const Default: React.FC = () => {
<Row>
<Tag>Core</Tag>
<Tag variant="pink">Community</Tag>
<Tag variant="green">Available</Tag>
<Tag variant="gray">Gray</Tag>
</Row>
<Row>
<Tag startIcon={<CommunityIcon />}>Core</Tag>
<Tag startIcon={<CoreIcon />} variant="pink">
<Tag outline>Core</Tag>
<Tag variant="pink" outline>
Community
</Tag>
<Tag startIcon={<CoreIcon />} endIcon={<CoreIcon />} variant="pink">
Start & End Icon
<Tag variant="green" outline>
Available
</Tag>
<Tag variant="gray" outline>
Gray
</Tag>
</Row>
<Row>
<Tag outline>Core</Tag>
<Tag variant="pink" outline>
Community
<Tag startIcon={<CommunityIcon />}>Start Icon</Tag>
<Tag startIcon={<CoreIcon />} variant="pink">
End Icon
</Tag>
<Tag startIcon={<CoreIcon />} endIcon={<CoreIcon />} variant="pink">
Start & End Icon
</Tag>
</Row>
<Row>
<Tag startIcon={<CommunityIcon />} outline>
Core
<Tag outline startIcon={<CommunityIcon />}>
Start Icon
</Tag>
<Tag startIcon={<CoreIcon />} variant="pink" outline>
Community
<Tag outline startIcon={<CoreIcon />} variant="pink">
End Icon
</Tag>
<Tag startIcon={<CoreIcon />} endIcon={<CoreIcon />} variant="pink" outline>
<Tag outline startIcon={<CoreIcon />} endIcon={<CoreIcon />} variant="pink">
Start & End Icon
</Tag>
</Row>
Expand Down
18 changes: 18 additions & 0 deletions src/components/Tag/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,30 @@ const purpleTheme = {
borderColorOutline: lightColors.secondary,
};

const greenTheme = {
background: lightColors.success,
color: "#FFFFFF",
colorOutline: lightColors.success,
borderColorOutline: lightColors.success,
};

const grayTheme = {
background: lightColors.textDisabled,
color: "#FFFFFF",
colorOutline: lightColors.textDisabled,
borderColorOutline: lightColors.textDisabled,
};

export const light: TagTheme = {
pink: pinkTheme,
purple: purpleTheme,
green: greenTheme,
gray: grayTheme,
};

export const dark: TagTheme = {
pink: pinkTheme,
purple: purpleTheme,
green: greenTheme,
gray: grayTheme,
};
2 changes: 2 additions & 0 deletions src/components/Tag/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { ReactNode } from "react";
export const variants = {
PINK: "pink",
PURPLE: "purple",
GREEN: "green",
GRAY: "gray",
} as const;

export type Variants = typeof variants[keyof typeof variants];
Expand Down
Loading

0 comments on commit 60e6e41

Please sign in to comment.