diff --git a/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/Stepper.tsx b/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/Stepper.tsx new file mode 100644 index 0000000000..da8da2d00d --- /dev/null +++ b/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/Stepper.tsx @@ -0,0 +1,69 @@ +/* + * Copyright 2022 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + Stepper as MuiStepper, + Step as MuiStep, + StepLabel as MuiStepLabel, + Box, + Button, + makeStyles, +} from '@material-ui/core'; +import React, { useState } from 'react'; +import { TemplateParameterSchema } from '../../../types'; + +const useStyles = makeStyles(theme => ({ + backButton: { + marginRight: theme.spacing(1), + }, + footer: { + padding: theme.spacing(1, 1), + display: 'flex', + flexDirection: 'row', + justifyContent: 'right', + }, +})); + +export interface StepperProps { + manifest: TemplateParameterSchema; +} + +export const Stepper = (props: StepperProps) => { + const { steps } = props.manifest; + const [activeStep, setActiveStep] = useState(0); + const styles = useStyles(); + const handleBack = () => {}; + const handleNext = () => {}; + + return ( + + + {steps.map((step, index) => ( + + {step.title} + + ))} + +
+ + +
+
+ ); +}; diff --git a/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/index.ts b/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/index.ts new file mode 100644 index 0000000000..5532563e28 --- /dev/null +++ b/plugins/scaffolder/src/next/TemplateWizardPage/Stepper/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright 2022 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export { Stepper } from './Stepper'; diff --git a/plugins/scaffolder/src/next/TemplateWizardPage/TemplateWizardPage.tsx b/plugins/scaffolder/src/next/TemplateWizardPage/TemplateWizardPage.tsx index 1a57a438c6..5e0b20d468 100644 --- a/plugins/scaffolder/src/next/TemplateWizardPage/TemplateWizardPage.tsx +++ b/plugins/scaffolder/src/next/TemplateWizardPage/TemplateWizardPage.tsx @@ -29,6 +29,7 @@ import { useApi } from '@backstage/core-plugin-api'; import { scaffolderApiRef } from '../../api'; import useAsync from 'react-use/lib/useAsync'; import { makeStyles } from '@material-ui/core'; +import { Stepper } from './Stepper'; import { BackstageTheme } from '@backstage/theme'; export interface TemplateWizardPageProps { @@ -89,7 +90,7 @@ export const TemplateWizardPage = (_props: TemplateWizardPageProps) => { noPadding titleTypographyProps={{ component: 'h2' }} > - asd + )}