generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reusable Card component implemented in both views
- Loading branch information
1 parent
8bc8d49
commit 76c0756
Showing
7 changed files
with
78 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* @summary A reusable Card component | ||
*/ | ||
import React from 'react'; | ||
import { CardWrapper } from './card.styles'; | ||
|
||
interface CardProps { | ||
children: React.ReactNode; | ||
width?: string; | ||
height?: string; | ||
justifyContent?: string; | ||
} | ||
|
||
function Card({ | ||
children, | ||
width = '500px', | ||
height = '500px', | ||
justifyContent = 'center', | ||
}: CardProps) { | ||
return ( | ||
<CardWrapper | ||
width={width} | ||
height={height} | ||
justifyContent={justifyContent} | ||
> | ||
{children} | ||
</CardWrapper> | ||
); | ||
} | ||
|
||
export default Card; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* @summary Styling for Card component | ||
*/ | ||
import styled from '@emotion/styled'; | ||
|
||
type CardWrapperProps = { | ||
width: string; | ||
height: string; | ||
justifyContent?: string; | ||
}; | ||
|
||
export const CardWrapper = styled.div<CardWrapperProps>` | ||
background-color: rgba(255, 255, 255, 0.8); | ||
height: ${(props) => props.height}; | ||
width: ${(props) => props.width}; | ||
padding-top: 0; | ||
justify-content: flex-start; | ||
align-items: center; | ||
display: flex; | ||
flex-direction: column; | ||
object-fit: scale-down; | ||
border-radius: 8px; | ||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); | ||
padding: 20px; | ||
text-align: center; | ||
position: relative; | ||
justify-content: ${(props) => props.justifyContent}; | ||
`; | ||
|
||
export default CardWrapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters