generated from owl-corp/python-template
-
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.
- Loading branch information
Showing
2 changed files
with
37 additions
and
24 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 |
---|---|---|
@@ -1,39 +1,42 @@ | ||
import styled from "styled-components"; | ||
|
||
const CardContainer = styled.div` | ||
const CardContainer = styled.div<{ $seamless?: boolean; }>` | ||
border: 3px solid ${({ theme }) => theme.borderColor}; | ||
border-top: ${({ $seamless }) => $seamless ? "0" : ""}; | ||
padding: 16px; | ||
position: relative; | ||
background-color: ${({ theme }) => theme.cardBackgroundColor}; | ||
text-align: left; | ||
box-shadow: 10px 10px 0 ${({ theme }) => theme.cardShadow}; | ||
margin-top: ${({ $seamless }) => $seamless ? "0px" : "30px"}; | ||
`; | ||
|
||
const CardTitle = styled.div` | ||
const CardTitle = styled.div<{ $seamless?: boolean; }>` | ||
position: absolute; | ||
top: -16px; | ||
left: 16px; | ||
background-color: ${({ theme }) => theme.cardBackgroundColor}; | ||
background: linear-gradient(0deg, ${({ theme }) => theme.cardBackgroundColor} 0%, ${({ theme }) => theme.cardBackgroundColor} 45%, ${({ theme }) => theme.backgroundColor} 45%); | ||
${({ $seamless, theme }) => $seamless ? "" : `background: linear-gradient(0deg, ${theme.cardBackgroundColor} 0%, ${theme.cardBackgroundColor} 45%, ${theme.backgroundColor} 45%)`}; | ||
padding: 0 8px; | ||
font-weight: bold; | ||
z-index: 1; | ||
font-size: 1.2em; | ||
`; | ||
|
||
interface CardProps { | ||
title: string; | ||
children: React.ReactNode; | ||
title: string; | ||
children: React.ReactNode; | ||
seamless?: boolean; | ||
} | ||
|
||
const Card: React.FC<CardProps> = ({ title, children }: CardProps) => { | ||
return ( | ||
<CardContainer> | ||
<CardTitle>{title}</CardTitle> | ||
{children} | ||
</CardContainer> | ||
); | ||
const Card: React.FC<CardProps> = ({ title, children, seamless }: CardProps) => { | ||
return ( | ||
<CardContainer $seamless={seamless}> | ||
<CardTitle $seamless={seamless}>{title}</CardTitle> | ||
{children} | ||
</CardContainer> | ||
); | ||
}; | ||
|
||
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