Skip to content

Commit

Permalink
๐Ÿ–‹๏ธ::add-common-button
Browse files Browse the repository at this point in the history
์ž์ฃผ์“ฐ์ด๋Š” ๋ฒ„ํŠผ ์ถ”๊ฐ€
  • Loading branch information
woojae05 committed Mar 23, 2022
1 parent 2943a17 commit dec0420
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 1 deletion.
30 changes: 30 additions & 0 deletions src/components/common/button/Button.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import styled, { css } from "styled-components";
import { lightTheme } from "styles/theme";

interface styleProps {
visible?: boolean;
width?: string;
}

export const Button = styled.button<styleProps>`
min-width:60px;
width:${(props) => props.width};
height:28px;
text-align:center;
border-radius:15px;
box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.1);
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-size: 12px;
line-height: 14px;
cursor:pointer;
${(props) =>
props.visible &&
css`
background-color:${lightTheme.blue};
color:#fff;
`
}
`
13 changes: 13 additions & 0 deletions src/components/common/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import IButton from "interface/common/button/IButton";
import * as Btn from "./Button.style";

const Button: React.FC<IButton> = ({ visible, children, width }) => {
return (
<Btn.Button visible={visible} width={width}>
{children}
</Btn.Button>
);
};

export default Button;
1 change: 1 addition & 0 deletions src/components/common/button/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./Button"
4 changes: 4 additions & 0 deletions src/interface/common/button/IButton.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default interface IButton {
visible?: boolean;
width?: string;
}
1 change: 1 addition & 0 deletions src/styles/globals.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const GlobalStyle = createGlobalStyle`
${reset}
* {
box-sizing: border-box;
color:${(props) => props.theme.title}
}
html{
height:100%;
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"stores":["/stroes/*"],
"styles":["/styles/*"],
"assets":["/assets/*"],
"util":["/util/*"]
"util":["/util/*"],
"interface":["/interface/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
Expand Down

0 comments on commit dec0420

Please sign in to comment.