From ed851685f1d2d2ca33e026bc57e425e8738133ea Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Mar 2022 12:28:44 +0530 Subject: [PATCH] Added start again button --- .../components/HomeSection/HomeSection.jsx | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/frontend/components/HomeSection/HomeSection.jsx b/frontend/components/HomeSection/HomeSection.jsx index 2bf60a2..fd220e4 100644 --- a/frontend/components/HomeSection/HomeSection.jsx +++ b/frontend/components/HomeSection/HomeSection.jsx @@ -13,6 +13,17 @@ import { signup } from '@pages/signup' import styles from '../../styles/HomeSection.module.css' import toast from 'react-hot-toast' import { Toaster } from 'react-hot-toast' +import { createTheme } from '@mui/material/styles' +import { ThemeProvider } from '@mui/material/styles' + +const theme = createTheme({ + palette: { + action: { + disabledBackground: '#222831', + disabled: 'white' + } + } +}) const spanVariants = { visible: { y: 0, scaleY: 1 }, @@ -68,7 +79,6 @@ function HomeSection(props) { } else { setdisabled(true) - setTimeout(() => { setdisabled(false) }, 5000) let res try { res = await Axios.post(`/minify/add`, { @@ -110,12 +120,15 @@ function HomeSection(props) { const handleResponse = async () => { setOpen(false) props.setLongUrl('') + setdisabled(false) } const text1 = "Url"; const text2 = "MiniFy"; + + return (
@@ -141,7 +154,7 @@ function HomeSection(props) { props.setLongUrl(e.target.value) }} /> - + {disabled ? 'MINIFIED' : 'MINIFY'} +
@@ -194,6 +207,7 @@ function HomeSection(props) { sx={{ padding: '5px 0 0 0' }} onClick={() => { setOpen(false) + setdisabled(false) }} > @@ -215,8 +229,8 @@ function HomeSection(props) { component={motion.div} whileHover={{ scale: 1.1, transition: { ease: 'easeOut' } }} whileTap={{ scale: 0.8, transition: { ease: 'easeOut' } }} - sx={{ background: '#D82148', boxShadow: 'inset 0 -5px 0 0 #470D21', marginTop: '10px', gap: '10px', borderRadius: '20px', padding: '10px 25px 13px', '&:hover': { background: '#F90716', boxShadow: 'inset 0 -5px 0 0 #470D21' } }} - onClick={handleResponse}>Start Over + sx={{ background: '#D82148', boxShadow: 'inset 0 -5px 0 0 #470D21', marginTop: '10px', gap: '5px', textTransform: 'none', borderRadius: '20px', padding: '10px 25px 13px', '&:hover': { background: '#F90716', boxShadow: 'inset 0 -5px 0 0 #470D21' } }} + onClick={handleResponse}>Have another URL?