Skip to content

Commit

Permalink
feat: Add Link component (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
RabbitDoge authored Oct 19, 2020
1 parent fc64dfc commit 339d0ef
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/components/Link/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react";
import Link from "./index";

export default {
title: "Link",
component: Link,
argTypes: {
fontSize: {
name: "fontSize",
table: {
type: { summary: "string", detail: "Fontsize in px or em" },
defaultValue: { summary: "16px" },
},
control: {
type: null,
},
},
},
};

export const Default: React.FC = () => {
return (
<div>
<Link href="/">Default</Link>
</div>
);
};
16 changes: 16 additions & 0 deletions src/components/Link/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import styled from "styled-components";
import Text from "../Text";

export interface Props {
fontSize?: string;
href: string;
}

const Link = styled(Text).attrs({ as: "a", bold: true })<Props>`
color: ${({ theme }) => theme.colors.iris};
&:hover {
text-decoration: underline;
}
`;

export default Link;
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export { default as Button } from "./components/Button";
export { default as ButtonMenu } from "./components/ButtonMenu";
export { default as ButtonMenuItem } from "./components/ButtonMenu/ButtonMenuItem";
export { default as Card } from "./components/Card";
export { default as Text } from "./components/Text";
export { default as Link } from "./components/Link";
export { default as ResetCSS } from "./ResetCSS";

export * from "./theme";

0 comments on commit 339d0ef

Please sign in to comment.