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

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