Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/components/InstallationWizard/Step/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export const Step = (props: StepProps) => {
props.onSkip();
};

const handleHeaderClick = () => {
if (props.status === "completed") {
props.onGoToStep(props.stepIndex);
}
};

const isActive = props.status === "active";

return (
Expand All @@ -49,6 +55,7 @@ export const Step = (props: StepProps) => {
<s.Header
status={props.status}
transitionDuration={transitionDuration}
onClick={handleHeaderClick}
>
<s.NumberContainer
isActive={isActive}
Expand All @@ -72,7 +79,7 @@ export const Step = (props: StepProps) => {
transitionClassName={NUMBER_TRANSITION_CLASS_NAME}
transitionDuration={transitionDuration}
>
{props.number}
{props.stepIndex + 1}
</s.Number>
</CSSTransition>
</s.NumberContainer>
Expand Down
6 changes: 5 additions & 1 deletion src/components/InstallationWizard/Step/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const Container = styled.div<ContainerProps>`
transition: height ${transitionDuration}ms ease-out;
}
`;
}};
}}

height: ${({ status, contentHeight }) =>
status === "active"
Expand Down Expand Up @@ -102,6 +102,10 @@ export const Header = styled.div<HeaderProps>`
}};

transition: color ${({ transitionDuration }) => transitionDuration}ms ease-out;

cursor: ${({ status }) => {
return status === "completed" ? "pointer" : "initial";
}};
`;

export const NumberContainer = styled.div<NumberContainerProps>`
Expand Down
3 changes: 2 additions & 1 deletion src/components/InstallationWizard/Step/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ export interface StepData {

export interface StepProps {
data: StepData;
number: number;
stepIndex: number;
status: StepStatus;
transitionDuration?: number;
onSkip: () => void;
onGoToStep: (stepIndex: number) => void;
}

export interface ContainerProps {
Expand Down
13 changes: 9 additions & 4 deletions src/components/InstallationWizard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ export const InstallationWizard = () => {
};

const goToNextStep = () => {
if (currentStep < steps.length - 1) {
setCurrentStep(currentStep + 1);
}
setCurrentStep(currentStep + 1);
};

const handleSkipStep = () => {
Expand All @@ -166,6 +164,12 @@ export const InstallationWizard = () => {
}
};

const handleGoToStep = (stepIndex: number) => {
if (stepIndex < currentStep) {
setCurrentStep(stepIndex);
}
};

const handleFinishButtonClick = () => {
window.sendMessageToDigma({
action: actions.FINISH
Expand Down Expand Up @@ -219,8 +223,9 @@ export const InstallationWizard = () => {
<Step
key={step.title}
onSkip={handleSkipStep}
onGoToStep={handleGoToStep}
data={step}
number={i + 1}
stepIndex={i}
status={getStepStatus(i, currentStep)}
transitionDuration={TRANSITION_DURATION}
/>
Expand Down
3 changes: 1 addition & 2 deletions src/components/InstallationWizard/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export const Footer = styled.div`
}};
`;

// postcss-styled-components-disable-next-line
export const FooterContent = styled.div<{
transitionClassName: string;
transitionDuration: number;
Expand All @@ -117,7 +116,7 @@ export const FooterContent = styled.div<{
transition: opacity ${transitionDuration}ms ease-out;
}
`;
}};
}}
`;

export const SectionDescription = styled.span`
Expand Down
2 changes: 2 additions & 0 deletions src/components/RecentActivity/RecentActivityTable/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ export const ListSuffix = styled(Suffix)`
font-size: 12px;
`;

// postcss-styled-components-disable-next-line
export const SpanLink = styled(Link)`
${({ theme }) => getCodeFont(theme.codeFont)}

font-size: 12px;
line-height: 14px;

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/FloatingIconButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const getIconColor = (

switch (theme.mode) {
case "light":
return "#7891D0";
return "#7891d0";
case "dark":
case "dark-jetbrains":
return "#b9c2eb";
Expand Down