Skip to content

Commit

Permalink
feat(skill): add props such as borderColor, backgroundColor,
Browse files Browse the repository at this point in the history
borderRadius #164
  • Loading branch information
woorim960 committed Oct 2, 2022
1 parent 7a4ca4f commit ec6d7bf
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
14 changes: 13 additions & 1 deletion src/lib/common/types/ComponentTypes/SkillType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface SkillPropsType {
/**
* If this value is set to True, you can hide the title. (default: false)
*/
isHiddenTitle?: string;
isHiddenTitle?: boolean;
/**
* Enter the name of the icon you searched on the following site. (default: 'ion:logo-javascript') {@link https://icon-sets.iconify.design/}
*/
Expand All @@ -35,4 +35,16 @@ export interface SkillPropsType {
* Skill padding style (defualt: '0px')
*/
padding?: string;
/**
* Skill background color style (default: 'white')
*/
backgroundColor?: string;
/**
* Skill border color style (default: 'white')
*/
borderColor?: string;
/**
* Skill border-radius style (default: '12px')
*/
borderRadius?: string;
}
23 changes: 21 additions & 2 deletions src/lib/components/Skill/Skill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import { SkillPropsType } from '../../common/types/ComponentTypes/SkillType';
* @props iconColor: Icon color style (default: '#F0DB4F')
* @props margin: Skill margin style (defualt: '0px')
* @props padding: Skill padding style (defualt: '0px')
* @props backgroundColor: Skill background color style (default: 'white')
* @props borderColor: Skill border color style (default: 'white')
* @props borderRadius: Skill border-radius style (default: '12px')
*/
const Skill = ({
title,
Expand All @@ -25,9 +28,18 @@ const Skill = ({
iconColor,
margin,
padding,
backgroundColor,
borderColor,
borderRadius,
}: SkillPropsType) => {
return (
<Container margin={margin} padding={padding}>
<Container
margin={margin}
padding={padding}
backgroundColor={backgroundColor}
borderColor={borderColor}
borderRadius={borderRadius}
>
<Icon icon={`${iconName?.toLowerCase()}`} fontSize={iconSize} color={iconColor} />
<Name titleSize={titleSize} titleColor={titleColor} isHiddenTitle={isHiddenTitle}>
{title}
Expand All @@ -48,13 +60,20 @@ Skill.defaultProps = {
iconColor: '#F0DB4F',
margin: '0px',
padding: '0px',
backgroundColor: 'white',
borderColor: 'white',
borderRadius: '12px',
};

const Container = styled.div<SkillPropsType>`
const Container = styled.span<SkillPropsType>`
display: flex;
flex-direction: row;
align-items: center;
margin: ${({ margin }) => margin};
padding: ${({ padding }) => padding};
background-color: ${({ backgroundColor }) => backgroundColor};
border: 1px solid ${({ borderColor }) => borderColor};
border-radius: ${({ borderRadius }) => borderRadius};
`;

const Name = styled.span<SkillPropsType>`
Expand Down

0 comments on commit ec6d7bf

Please sign in to comment.