From 8090756eec5da26073799762ac5fd9990de185e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Oliveira?= Date: Fri, 22 Apr 2022 14:37:45 +0100 Subject: [PATCH] fix: hide lamassu screens and initial wizard steps on pazuz --- new-lamassu-admin/src/pages/Wizard/Wizard.js | 19 ++++++++++++++++--- new-lamassu-admin/src/routing/pazuz.routes.js | 16 ---------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/new-lamassu-admin/src/pages/Wizard/Wizard.js b/new-lamassu-admin/src/pages/Wizard/Wizard.js index b9ee1bb6..fe68d1bf 100644 --- a/new-lamassu-admin/src/pages/Wizard/Wizard.js +++ b/new-lamassu-admin/src/pages/Wizard/Wizard.js @@ -2,6 +2,7 @@ import { useQuery } from '@apollo/react-hooks' import { makeStyles, Dialog, DialogContent } from '@material-ui/core' import classnames from 'classnames' import gql from 'graphql-tag' +import * as R from 'ramda' import React, { useState, useContext } from 'react' import { useHistory } from 'react-router-dom' @@ -52,6 +53,18 @@ const Wizard = ({ fromAuthRegister }) => { const [footerExp, setFooterExp] = useState(false) + const getSteps = STEPS => { + const buildTarget = process.env.REACT_APP_BUILD_TARGET + if (buildTarget === 'PAZUZ') { + return R.filter(step => step.id !== 'wallet' && step.id !== 'twilio')( + STEPS + ) + } + return STEPS + } + + const steps = getSteps(STEPS) + if (loading) { return <> } @@ -78,7 +91,7 @@ const Wizard = ({ fromAuthRegister }) => { } const doContinue = () => { - if (step >= STEPS.length - 1) { + if (step >= steps.length - 1) { setOpen(false) history.push('/') } @@ -89,7 +102,7 @@ const Wizard = ({ fromAuthRegister }) => { setStep(nextStep) } - const current = STEPS[step] + const current = steps[step] return ( @@ -99,7 +112,7 @@ const Wizard = ({ fromAuthRegister }) => { {!isWelcome && (