fix: update about preview on hover (#5607)

This commit is contained in:
Vignesh Mohankumar 2022-12-09 10:30:46 -05:00 committed by GitHub
parent 19028c1d82
commit 53860dd8e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 33 deletions

@ -1,55 +1,37 @@
import styled from 'styled-components/macro'
const StyledStep = styled.div`
const StyledStep = styled.div<{ selected: boolean }>`
cursor: pointer;
display: flex;
gap: 36px;
padding: 24px 0;
color: ${({ theme, selected }) => (selected ? theme.textPrimary : theme.textSecondary)};
font-size: 36px;
line-height: 44px;
&:not(:last-of-type) {
border-bottom: ${({ theme }) => `1px solid ${theme.backgroundOutline}`};
}
`
const StepTitle = styled.div`
color: ${({ theme }) => theme.textPrimary};
font-size: 36px;
line-height: 44px;
font-weight: 600;
`
const StepDescription = styled.div`
color: ${({ theme }) => theme.textSecondary};
font-size: 24px;
line-height: 36px;
`
const StepIndex = styled.div`
color: ${({ theme }) => theme.textPrimary};
font-size: 36px;
line-height: 44px;
const StepIndex = styled.span`
margin-right: 36px;
`
const Step = ({
index,
title,
description,
expanded,
onClick,
onSelect,
selected,
}: {
index: number
title: string
description: string
onClick: () => void
expanded?: boolean
onSelect: () => void
selected: boolean
}) => {
return (
<StyledStep onClick={onClick}>
<StyledStep onClick={onSelect} onMouseEnter={onSelect} selected={selected}>
<StepIndex>{index + 1}</StepIndex>
<div>
<StepTitle>{title}</StepTitle>
{expanded && <StepDescription>{description}</StepDescription>}
</div>
{title}
</StyledStep>
)
}

@ -175,12 +175,11 @@ export default function About() {
<StepList>
{STEPS.map((step, index) => (
<Step
expanded={selectedStepIndex === index}
onClick={() => setSelectedStepIndex(index)}
selected={selectedStepIndex === index}
onSelect={() => setSelectedStepIndex(index)}
index={index}
key={step.title}
title={step.title}
description={step.description}
/>
))}
</StepList>