Skip to content

Commit

Permalink
Merge pull request #6512 from hursittarcan/patch-6
Browse files Browse the repository at this point in the history
Migrated ActionCard.js to TS
  • Loading branch information
pettinarip authored May 31, 2022
2 parents a87a7c2 + 36251dd commit a1052fa
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/components/ActionCard.js → src/components/ActionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const ChildrenContainer = styled.div`
margin-top: 2rem;
`

const ImageWrapper = styled.div`
const ImageWrapper = styled.div<{
isRight: boolean | undefined
isBottom: boolean | undefined
}>`
display: flex;
flex-direction: row;
justify-content: ${(props) => (props.isRight ? `flex-end` : `center`)};
Expand Down Expand Up @@ -62,7 +65,18 @@ const Card = styled(Link)`
}
`

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

const ActionCard: React.FC<IProps> = ({
to,
alt,
image,
Expand All @@ -71,7 +85,7 @@ const ActionCard = ({
children,
className,
isRight,
isBottom = true,
isBottom = true
}) => {
const isImageURL = typeof image === "string" && image.includes("http")
return (
Expand Down

0 comments on commit a1052fa

Please sign in to comment.