Skip to content

Commit

Permalink
Fix UI regressions (#59)
Browse files Browse the repository at this point in the history
* Fix UI regressions
  • Loading branch information
terryyylim committed Sep 20, 2022
1 parent 93961d9 commit 86eadea
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ui/packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mlp-ui",
"version": "1.5.5",
"version": "1.6.2",
"private": true,
"license": "Apache-2.0",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gojek/mlp-ui",
"version": "1.5.5",
"version": "1.6.2",
"license": "Apache-2.0",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down
4 changes: 4 additions & 0 deletions ui/packages/lib/src/components/Toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import isEqual from "react-fast-compare";
let addToastHandler;
let removeAllToastsHandler;

let toastId = 0;

// Other components can add toasts directly
export const addToast = toast => {
addToastHandler(toast);
Expand All @@ -19,6 +21,8 @@ export const Toast = ({ toastLifeTimeMs = 15000 }) => {
const [toasts, setToasts] = useState([]);

const addToast = toast => {
// Toast id should be unique to prevent it from being cleared continuously
toast.id = `${toast.id}-${toastId++}`;
!toasts.find(t => isEqual(t, toast)) && setToasts(toasts.concat(toast));
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ export const StepsWizardHorizontal = ({
<EuiStepsHorizontal
steps={steps.map((step, idx) => ({
title: step.title,
isSelected: idx === currentStep,
isComplete: idx < currentStep,
status:
idx === currentStep
? "current"
: idx < currentStep
? "complete"
: "incomplete",
onClick: () => {
idx < currentStep && setCurrentStep(idx);
}
Expand Down

0 comments on commit 86eadea

Please sign in to comment.