-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
fcc56c4
commit 009387e
Showing
5 changed files
with
156 additions
and
100 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,68 +1,64 @@ | ||
.wizard-container { | ||
max-width: 600px; | ||
margin: 0 auto; | ||
padding: 20px; | ||
} | ||
.tyk-stepper { | ||
.steps-container { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.steps-container { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
.step { | ||
display: flex; | ||
margin-bottom: 20px; | ||
|
||
.step { | ||
display: flex; | ||
margin-bottom: 20px; | ||
} | ||
|
||
} | ||
.step-indicator { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
margin-right: 20px; | ||
} | ||
|
||
.step-indicator { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
margin-right: 20px; | ||
} | ||
.step-number { | ||
width: 30px; | ||
height: 30px; | ||
border-radius: 50%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
margin-bottom: 10px; | ||
border: 1px solid var(--color-secondary-dark); | ||
} | ||
|
||
.step-number { | ||
width: 30px; | ||
height: 30px; | ||
border-radius: 50%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
margin-bottom: 10px; | ||
border: 1px solid var(--color-secondary-dark); | ||
} | ||
.step-line { | ||
width: 1px; | ||
flex-grow: 1; | ||
background-color: var(--color-secondary-dark); | ||
} | ||
|
||
.step-line { | ||
width: 1px; | ||
flex-grow: 1; | ||
background-color: var(--color-secondary-dark); | ||
} | ||
.step.completed .step-number { | ||
color: var(--color-success-base); | ||
border-color: var(--color-success-base); | ||
} | ||
|
||
.step.completed .step-number { | ||
color: var(--color-success-base); | ||
border-color: var(--color-success-base); | ||
} | ||
.step-content { | ||
flex-grow: 1; | ||
} | ||
|
||
.step-content { | ||
flex-grow: 1; | ||
} | ||
.step-content h3 { | ||
margin: 0 0 5px 0; | ||
} | ||
|
||
.step-content h3 { | ||
margin: 0 0 5px 0; | ||
} | ||
.step-content p { | ||
margin: 0 0 10px 0; | ||
} | ||
|
||
.step-content p { | ||
margin: 0 0 10px 0; | ||
} | ||
.step-component { | ||
margin-top: 10px; | ||
padding: 15px; | ||
} | ||
|
||
.step-component { | ||
margin-top: 10px; | ||
padding: 15px; | ||
} | ||
|
||
.navigation-buttons { | ||
display: flex; | ||
justify-content: right; | ||
margin-top: 20px; | ||
.navigation-buttons { | ||
display: flex; | ||
justify-content: right; | ||
margin-top: 20px; | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from "react"; | ||
import Button from "../../Button"; | ||
|
||
const NavigationButtons = ({ | ||
currentStep, | ||
isLastStep, | ||
isDisableFinish, | ||
handleBack, | ||
handleNext, | ||
onFinish, | ||
finishBtnText, | ||
}) => { | ||
return ( | ||
<div className="navigation-buttons"> | ||
{currentStep >= 1 && ( | ||
<Button theme="secondary" onClick={handleBack}> | ||
Back | ||
</Button> | ||
)} | ||
| ||
<Button | ||
theme="primary" | ||
onClick={isLastStep ? onFinish : handleNext} | ||
disabled={isDisableFinish && isLastStep} | ||
> | ||
{isLastStep ? finishBtnText : "Continue"} | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default NavigationButtons; |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from "react"; | ||
|
||
const StepContent = ({ step, index, currentStep, children }) => { | ||
const isStepComplete = index < currentStep; | ||
|
||
return ( | ||
<div | ||
className={`step ${index === currentStep ? "active" : ""} ${ | ||
isStepComplete ? "completed" : "" | ||
}`} | ||
> | ||
{children} | ||
<div className="step-content"> | ||
<h3>{step.title}</h3> | ||
<p>{step.description}</p> | ||
{index === currentStep && ( | ||
<div className="step-component">{step.component}</div> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StepContent; |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from "react"; | ||
import Icon from "../../Icon"; | ||
|
||
const StepIndicator = ({ index, currentStep, stepsLength }) => { | ||
const isStepComplete = index < currentStep; | ||
const isShowStepLine = index < stepsLength - 1; | ||
|
||
return ( | ||
<div className="step-indicator"> | ||
<div className={`step-number`}> | ||
{isStepComplete ? <Icon type="check" /> : index + 1} | ||
</div> | ||
{isShowStepLine && <div className="step-line"></div>} | ||
</div> | ||
); | ||
}; | ||
|
||
export default StepIndicator; |