Skip to content

Commit

Permalink
Fixed formatting ActionCard
Browse files Browse the repository at this point in the history
  • Loading branch information
hursittarcan authored May 31, 2022
1 parent ac38743 commit 36251dd
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions src/components/ActionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const ChildrenContainer = styled.div`
`

const ImageWrapper = styled.div<{
isRight: boolean | undefined
isBottom: boolean | undefined
isRight: boolean | undefined
isBottom: boolean | undefined
}>`
display: flex;
flex-direction: row;
Expand Down Expand Up @@ -66,47 +66,47 @@ const Card = styled(Link)`
`

export interface IProps {
to: string
alt?: string
image: string
title: string
description: string
className?: string
isRight?: boolean
isBottom?: boolean
to: string
alt?: string
image: string
title: string
description: string
className?: string
isRight?: boolean
isBottom?: boolean
}

const ActionCard: React.FC<IProps> = ({
to,
alt,
image,
title,
description,
children,
className,
isRight,
isBottom = true
}) => {
const isImageURL = typeof image === "string" && image.includes("http")
return (
<Card to={to} className={className} hideArrow={true}>
<ImageWrapper
isRight={isRight}
isBottom={isBottom}
className="action-card-image-wrapper"
>
{!isImageURL && <Image image={image} alt={alt} />}
{isImageURL && (
<img src={image} alt={alt} className="action-card-image" />
)}
</ImageWrapper>
<Content className="action-card-content">
<Title>{title}</Title>
<Description>{description}</Description>
{children && <ChildrenContainer>{children}</ChildrenContainer>}
</Content>
</Card>
)
to,
alt,
image,
title,
description,
children,
className,
isRight,
isBottom = true
}) => {
const isImageURL = typeof image === "string" && image.includes("http")
return (
<Card to={to} className={className} hideArrow={true}>
<ImageWrapper
isRight={isRight}
isBottom={isBottom}
className="action-card-image-wrapper"
>
{!isImageURL && <Image image={image} alt={alt} />}
{isImageURL && (
<img src={image} alt={alt} className="action-card-image" />
)}
</ImageWrapper>
<Content className="action-card-content">
<Title>{title}</Title>
<Description>{description}</Description>
{children && <ChildrenContainer>{children}</ChildrenContainer>}
</Content>
</Card>
)
}

export default ActionCard

0 comments on commit 36251dd

Please sign in to comment.