-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #704 from Ayushmaanagarwal1211/Update
Changed the loader and the input fields
- Loading branch information
Showing
2 changed files
with
133 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ import { ContainerScroll } from "@components/Scrolltab"; | |
import ParticlesComponent from "@components/ParticleBackground"; | ||
function HomePage() { | ||
const [loading , setLoading ]=useState(false) | ||
|
||
const [blur,setBLur]=useState(false) | ||
//to add body bg color | ||
|
||
useEffect(() => { | ||
|
@@ -140,6 +140,7 @@ function HomePage() { | |
setTimeout(() => { | ||
setEmail('') | ||
}, 2000); | ||
setBLur(true) | ||
// Validate email format | ||
setLoading(true) | ||
if (!validateEmail(email)) { | ||
|
@@ -148,6 +149,7 @@ function HomePage() { | |
setError('') | ||
}, 2000); | ||
setLoading(false) | ||
setBLur(false) | ||
|
||
return; | ||
} | ||
|
@@ -170,6 +172,8 @@ setLoading(false) | |
setError('') | ||
}, 2000); | ||
setLoading(false) | ||
setBLur(false) | ||
|
||
return; | ||
} | ||
|
||
|
@@ -184,6 +188,7 @@ setLoading(false) | |
setError('') | ||
}, 2000); | ||
setLoading(false) | ||
setBLur(false) | ||
|
||
return; | ||
} | ||
|
@@ -223,12 +228,13 @@ setLoading(false) | |
}, 2000); | ||
} | ||
setLoading(false) | ||
setBLur(false) | ||
|
||
}; | ||
|
||
return ( | ||
<div> | ||
{loading && <Lodaernewletter/>} | ||
|
||
<ParticlesComponent id="particles" /> | ||
{error&& <Popup msg={error} error={`${error=='Subscribed Successfully'?"green1":"red1"}`} />} | ||
<main> | ||
|
@@ -534,11 +540,17 @@ setLoading(false) | |
<div className="subscribe-input"> | ||
<input | ||
value={email} onChange={(e)=>setEmail(e.target.value)} | ||
placeholder="[email protected]" | ||
className="input-field " | ||
placeholder="Email" | ||
className={`${blur?"blurclass":""} input-field `} | ||
/> | ||
{/* {error && <p className="error-message-mobile">{error}</p>} */} | ||
<button className="subscribe-btn" onClick={subscribe}>Subscribe</button> | ||
<button className="subscribe-btn" onClick={subscribe}>Subscribe {loading && <div className="loader2"> | ||
<div className="circle"> | ||
<div className="dot"></div> | ||
<div className="outline"></div> | ||
</div> | ||
|
||
</div>}</button> | ||
</div> | ||
{/* {error && <p className="error-message-desktop">{error}</p>} */} | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters