Commit cfbb6a71 authored by Vignesh Mohankumar's avatar Vignesh Mohankumar Committed by GitHub

fix: light mode cards for /about (#5605)

* fix: light mode cards for /about

* transparent
parent 61f03af2
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { useIsDarkMode } from 'state/user/hooks'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
const StyledCard = styled.div` const StyledCard = styled.div<{ isDarkMode: boolean }>`
display: flex; display: flex;
background: linear-gradient(180deg, rgba(19, 22, 27, 0.54) 0%, #13161b 100%); background: ${({ isDarkMode }) =>
isDarkMode ? 'linear-gradient(180deg, rgba(19, 22, 27, 0.54) 0%, #13161b 100%)' : 'transparent'};
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
text-decoration: none; text-decoration: none;
...@@ -12,6 +14,7 @@ const StyledCard = styled.div` ...@@ -12,6 +14,7 @@ const StyledCard = styled.div`
height: 400px; height: 400px;
border-radius: 24px; border-radius: 24px;
transition: ${({ theme }) => `${theme.transition.duration.medium} ${theme.transition.timing.ease} background-color`}; transition: ${({ theme }) => `${theme.transition.duration.medium} ${theme.transition.timing.ease} background-color`};
border: 1px solid ${({ theme, isDarkMode }) => (isDarkMode ? 'transparent' : theme.backgroundOutline)};
&:hover { &:hover {
background-color: ${({ theme }) => theme.backgroundModule}; background-color: ${({ theme }) => theme.backgroundModule};
...@@ -41,6 +44,7 @@ const Card = ({ ...@@ -41,6 +44,7 @@ const Card = ({
to: string to: string
external?: boolean external?: boolean
}) => { }) => {
const isDarkMode = useIsDarkMode()
return ( return (
<StyledCard <StyledCard
as={external ? 'a' : Link} as={external ? 'a' : Link}
...@@ -48,6 +52,7 @@ const Card = ({ ...@@ -48,6 +52,7 @@ const Card = ({
href={external ? to : undefined} href={external ? to : undefined}
target={external ? '_blank' : undefined} target={external ? '_blank' : undefined}
rel={external ? 'noopenener noreferrer' : undefined} rel={external ? 'noopenener noreferrer' : undefined}
isDarkMode={isDarkMode}
> >
<CardTitle>{title}</CardTitle> <CardTitle>{title}</CardTitle>
<CardDescription>{description}</CardDescription> <CardDescription>{description}</CardDescription>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment