Skip to content

Commit

Permalink
Merge pull request #1790 from airqo-platform/analytics-group-invite
Browse files Browse the repository at this point in the history
[Analytics] Group invite navigation enhancement from email link
  • Loading branch information
Baalmart authored Jan 5, 2024
2 parents 8b15117 + 8ab5666 commit 93bdb5e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion platform/src/pages/account/creation/individual/register.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import AccountPageLayout from '@/components/Account/Layout';
import Link from 'next/link';
import { useDispatch } from 'react-redux';
Expand Down Expand Up @@ -28,12 +28,22 @@ const IndividualAccountRegistration = () => {

const dispatch = useDispatch();
const router = useRouter();
const { userExists, userEmail } = router.query;
const [loading, setLoading] = useState(false);
const [creationErrors, setCreationErrors] = useState({
state: false,
message: '',
});

useEffect(() => {
if (userEmail) {
setEmail(userEmail);
}
if (userExists === 'true') {
router.push('/account/login');
}
}, [userExists, userEmail]);

const handleSubmit = async (e) => {
e.preventDefault();
setLoading(true);
Expand Down Expand Up @@ -148,6 +158,7 @@ const IndividualAccountRegistration = () => {
<div className='text-sm text-gray-500'>Email address*</div>
<div className='mt-2 w-full'>
<input
value={email || ''}
onChange={(e) => setEmail(e.target.value)}
type='email'
placeholder='Enter your email'
Expand Down

0 comments on commit 93bdb5e

Please sign in to comment.