@@ -9,6 +9,7 @@ import {Amplify, Auth} from "aws-amplify";
99import Spinner from "@/components/common/Spinner" ;
1010import UserInfo from '../Profile/userInfo'
1111import TextField from "@mui/material/TextField" ;
12+ import { useRouter } from "next/router" ;
1213
1314const COGNITO_REGION = process . env . NEXT_PUBLIC_COGNITO_REGION ;
1415const LOGIN_REGISTER_COGNITO_CLIENT_ID = process . env . NEXT_PUBLIC_LOGIN_REGISTER_COGNITO_CLIENT_ID ;
@@ -35,6 +36,7 @@ const RegisterComponent = () => {
3536 const [ successMessage , setSuccessMessage ] = useState ( '' ) ;
3637 const [ errorMessage , setErrorMessage ] = useState ( '' ) ;
3738 const [ loading , setLoading ] = useState ( false ) ;
39+ const { query} = useRouter ( ) ;
3840 const handleRegistration = async ( ) => {
3941 // Validate confirm password
4042 setErrorMessage ( '' ) ;
@@ -60,7 +62,6 @@ const RegisterComponent = () => {
6062 userPoolId : COGNITO_USER_POOL_ID ,
6163 userPoolWebClientId : LOGIN_REGISTER_COGNITO_CLIENT_ID
6264 }
63- console . log ( "awsAmplifyConfig:" , awsAmplifyConfig )
6465 Amplify . configure ( awsAmplifyConfig )
6566 const { name, designation, companyName, receiveUpdates} : userProps = user ;
6667 const params = {
@@ -93,7 +94,7 @@ const RegisterComponent = () => {
9394 } ;
9495 const handleLoginWithGoogle = async ( ) => {
9596 setLoading ( true )
96- await signIn ( "cognito_google" , { redirect : false } )
97+ await signIn ( "cognito_google" , { redirect : false , callbackUrl : `http://localhost:3000 ${ query ?. callBack } ` } )
9798 } ;
9899
99100 const handleUser = async ( { validates, user} : any ) => {
@@ -114,24 +115,24 @@ const RegisterComponent = () => {
114115 return (
115116 < >
116117 < div
117- className = "Maincontainer bg-dark-600 d-flex justify-content-center align-items-center w-full "
118+ className = "w-full Maincontainer bg-dark-600 d-flex justify-content-center align-items-center"
118119 style = { { height : 'auto !important' , minHeight : '100vh' } }
119120 >
120- < div className = "container w-full pt-6 px-6 gap-20 "
121+ < div className = "container w-full gap-20 px-6 pt-6 "
121122 style = { { display : 'flex' , justifyContent : 'center' , marginTop : "-35px" } } >
122123 < div className = "mt-20" >
123- < Image src = { logo } alt = "logo" className = " text-center" />
124+ < Image src = { logo } alt = "logo" className = "text-center " />
124125 < div style = { { display : 'flex' , alignItems : 'center' } } className = "mt-3" >
125- < Image src = { check } alt = "logo" className = " text-center" style = { { marginTop : '-66px' } } />
126- < p className = "text-white ml-3" >
126+ < Image src = { check } alt = "logo" className = "text-center " style = { { marginTop : '-66px' } } />
127+ < p className = "ml-3 text-white " >
127128 < span style = { { color : '#90A4AE' } } > Real-time Monitoring. </ span > Track < br /> Ethereum
128129 network hash-rate and
129130 < br /> difficulty in real-time with charts and < br /> historical data.
130131 </ p >
131132 </ div >
132133 < div style = { { display : 'flex' , alignItems : 'center' } } className = "mt-3" >
133- < Image src = { check } alt = "logo" className = "text-center mt-2" style = { { marginTop : '-66px' } } />
134- < p className = "text-white ml-3" >
134+ < Image src = { check } alt = "logo" className = "mt-2 text-center " style = { { marginTop : '-66px' } } />
135+ < p className = "ml-3 text-white " >
135136 < span style = { { color : '#90A4AE' } } > Miner Distribution Analysis.</ span >
136137 < br />
137138 Analyze miner distribution on the
@@ -141,8 +142,8 @@ const RegisterComponent = () => {
141142 </ p >
142143 </ div >
143144 < div style = { { display : 'flex' , alignItems : 'center' } } className = "mt-3" >
144- < Image src = { check } alt = "logo" className = "text-center mt-2" style = { { marginTop : '-66px' } } />
145- < p className = "text-white ml-3" >
145+ < Image src = { check } alt = "logo" className = "mt-2 text-center " style = { { marginTop : '-66px' } } />
146+ < p className = "ml-3 text-white " >
146147 < span style = { { color : '#90A4AE' } } > Miner Distribution Analysis.</ span >
147148 < br />
148149 Analyze miner distribution on the
@@ -153,18 +154,18 @@ const RegisterComponent = () => {
153154 </ div >
154155 </ div >
155156 < div style = { { display : 'flex' , alignItems : 'center' , justifyContent : 'center' } } >
156- < div className = "sec-box bg-white rounded px-10 mt-8 py-5 "
157+ < div className = "px-10 py-5 mt-8 bg-white rounded sec-box "
157158 style = { { height : 'auto !important' , width : '464px' } } >
158- < p className = "text-black text-xl font-weight-bold mt-4 text-center "
159+ < p className = "mt-4 text-xl text-center text-black font-weight-bold "
159160 style = { { fontSize : '1.5rem' } } >
160161 Register
161162 </ p >
162163 { errorMessage && < div
163- className = "font-regular mt-5 relative block w-full rounded-lg bg-red-500 p-2 text-base leading-5 text-white opacity-100" >
164+ className = "relative block w-full p-2 mt-5 text-base leading-5 text-white bg-red-500 rounded-lg opacity-100 font-regular " >
164165 { errorMessage }
165166 </ div > }
166167 { successMessage && < div
167- className = "font-regular mt-5 relative block w-full rounded-lg bg-green-500 p-4 text-base leading-5 text-white opacity-100" >
168+ className = "relative block w-full p-4 mt-5 text-base leading-5 text-white bg-green-500 rounded-lg opacity-100 font-regular " >
168169 { successMessage }
169170 </ div > }
170171 { loading && < div className = { 'align-items-center d-flex flex justify-center mt-3' } >
@@ -211,12 +212,12 @@ const RegisterComponent = () => {
211212 />
212213 < UserInfo handleInfo = { handleUser } />
213214 < button
214- className = "text-white font-weight-bold text-center bg-dark-600 w-full rounded py-2 mt-9"
215+ className = "w-full py-2 text-center text- white rounded font-weight-bold bg-dark-600 mt-9"
215216 onClick = { handleRegistration }
216217 type = "button" >
217218 REGISTER
218219 </ button >
219- < p className = "text-black text-md font-weight-bold mt-9 text-center " >
220+ < p className = "text-center text- black text-md font-weight-bold mt-9" >
220221 By clicking “Create account” or “Continue with Google” or “Continue with Github”, you
221222 agree to the
222223 jiffyscan.xyz
@@ -240,7 +241,7 @@ const RegisterComponent = () => {
240241 </ p >
241242
242243 < Link href = "/login" >
243- < p className = " text-black text-md font-weight-bold mt-5 text-center " >
244+ < p className = "mt-5 text-center text- black text-md font-weight-bold" >
244245 Already have an account? < span style = { { color : '#1976D2' } } > Log in</ span >
245246 </ p >
246247 </ Link >
0 commit comments