diff --git a/.eslintrc.js b/.eslintrc.js index cf37b38..7747354 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -103,10 +103,7 @@ module.exports = { "max-params": "off", "max-statements": "off", "max-statements-per-line": "off", - "multiline-ternary": [ - "error", - "never" - ], + "multiline-ternary": "off", "new-parens": "off", "newline-after-var": "off", "newline-before-return": "off", diff --git a/src/components/projects/FundProject.jsx b/src/components/projects/FundProject.jsx index 9641d0d..7c08d86 100644 --- a/src/components/projects/FundProject.jsx +++ b/src/components/projects/FundProject.jsx @@ -22,6 +22,7 @@ import { getProfileById, pledgeLifetimeReceived } from './queries' import styles from './styles/FundProject' import Loading from '../base/Loading' import BreadCrumb from '../base/BreadCrumb' +import FundStepper from './FundStepper' const { addGiverAndDonate } = LiquidPledging.methods @@ -181,6 +182,7 @@ const SubmissionSection = ({ classes, projectData, projectId, profileData, start
{getTokenLabel(manifest.goalToken)}
+ } ) diff --git a/src/components/projects/FundStepper.jsx b/src/components/projects/FundStepper.jsx new file mode 100644 index 0000000..b733867 --- /dev/null +++ b/src/components/projects/FundStepper.jsx @@ -0,0 +1,169 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { makeStyles, withStyles } from '@material-ui/core/styles'; +import clsx from 'clsx'; +import Stepper from '@material-ui/core/Stepper'; +import Step from '@material-ui/core/Step'; +import StepLabel from '@material-ui/core/StepLabel'; +import Check from '@material-ui/icons/Check'; +import SettingsIcon from '@material-ui/icons/Settings'; +import GroupAddIcon from '@material-ui/icons/GroupAdd'; +import VideoLabelIcon from '@material-ui/icons/VideoLabel'; +import StepConnector from '@material-ui/core/StepConnector'; + +const QontoConnector = withStyles({ + alternativeLabel: { + top: 10, + left: 'calc(-50% + 16px)', + right: 'calc(50% + 16px)', + }, + active: { + '& $line': { + borderColor: '#4360DF', + }, + }, + completed: { + '& $line': { + borderColor: '#4360DF', + }, + }, + line: { + borderColor: '#eaeaf0', + borderTopWidth: 3, + borderRadius: 1, + }, +})(StepConnector); + +const useQontoStepIconStyles = makeStyles({ + root: { + color: '#eaeaf0', + display: 'flex', + height: 22, + alignItems: 'center', + }, + active: { + color: '#4360DF', + }, + circle: { + width: 8, + height: 8, + borderRadius: '50%', + backgroundColor: 'currentColor', + }, + completed: { + color: '#4360DF', + zIndex: 1, + fontSize: 18, + }, +}); + +function QontoStepIcon(props) { + const classes = useQontoStepIconStyles(); + const { active, completed } = props; + + return ( +
+ {completed ? :
} +
+ ); +} + +QontoStepIcon.propTypes = { + active: PropTypes.bool, + completed: PropTypes.bool, +}; + +const useColorlibStepIconStyles = makeStyles({ + root: { + backgroundColor: '#ccc', + zIndex: 1, + color: '#fff', + width: 50, + height: 50, + display: 'flex', + borderRadius: '50%', + justifyContent: 'center', + alignItems: 'center', + }, + active: { + backgroundImage: + 'linear-gradient( 136deg, rgb(242,113,33) 0%, rgb(233,64,87) 50%, rgb(138,35,135) 100%)', + boxShadow: '0 4px 10px 0 rgba(0,0,0,.25)', + }, + completed: { + backgroundImage: + 'linear-gradient( 136deg, rgb(242,113,33) 0%, rgb(233,64,87) 50%, rgb(138,35,135) 100%)', + }, +}); + +function ColorlibStepIcon(props) { + const classes = useColorlibStepIconStyles(); + const { active, completed } = props; + + const icons = { + 1: , + 2: , + 3: , + }; + + return ( +
+ {icons[String(props.icon)]} +
+ ); +} + +ColorlibStepIcon.propTypes = { + active: PropTypes.bool, + completed: PropTypes.bool, + icon: PropTypes.node, +}; + +const useStyles = makeStyles(theme => ({ + root: { + gridColumn: '1 / 13', + }, + stepper: { + background: '#FAFAFA', + padding: '2rem 0px' + }, + button: { + marginRight: theme.spacing(1), + }, + instructions: { + marginTop: theme.spacing(1), + marginBottom: theme.spacing(1), + }, +})); + +function getSteps() { + return ['Connect', 'Authorize Amount', 'Fund', 'Confirmation']; +} + +export default function CustomizedSteppers() { + const classes = useStyles(); + const [activeStep, setActiveStep] = React.useState(1); + console.log({setActiveStep}) + const steps = getSteps(); + + return ( +
+ }> + {steps.map(label => ( + + {label} + + ))} + +
+ ); +}