Skip to content

Commit

Permalink
fix: Add ref props
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeliwo committed Nov 6, 2019
1 parent 51985a1 commit 47fe111
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/components/Base/Base.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
import React, { FC } from 'react'
import React, { FC, Ref } from 'react'
import styled, { css } from 'styled-components'

type Props = {
type BaseProps = {
radius?: 's' | 'm'
className?: string
ref?: Ref<HTMLDivElement>
}

export const Base: FC<Props> = ({ radius = 'm', className = '', children }) => {
export const Base: FC<BaseProps> = ({ radius = 'm', ...props }) => {
const radiusMap = {
s: '6px',
m: '8px',
}

return (
<Wrapper radius={radiusMap[radius]} className={className}>
{children}
</Wrapper>
)
return <Wrapper radius={radiusMap[radius]} {...props} />
}

const Wrapper = styled.div<{ radius: string }>`
${({ radius }) => {
return css`
overflow: hidden;
border-radius: ${radius};
box-shadow: rgba(51, 51, 51, 0.3) 1px 1px 4px 0;
background-color: #fff;
Expand Down

0 comments on commit 47fe111

Please sign in to comment.