-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Submit a team from popup to page
- Loading branch information
1 parent
a9c0565
commit a25fe27
Showing
10 changed files
with
260 additions
and
154 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
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 |
---|---|---|
@@ -0,0 +1,106 @@ | ||
.teamReg { | ||
background: white; | ||
border-radius: 8px; | ||
border: none; | ||
height: 87svh; | ||
max-height: 1000px; | ||
margin: auto; | ||
position: relative; | ||
width: 100%; | ||
} | ||
|
||
.loginPrompt { | ||
background: white; | ||
border-radius: 8px; | ||
border: none; | ||
margin: auto; | ||
position: relative; | ||
width: 756px; | ||
margin-top: 130px; | ||
} | ||
|
||
|
||
.teamReg__close { | ||
display: none; | ||
} | ||
|
||
.teamReg__cn { | ||
position: relative; | ||
display: flex; | ||
border-radius: 8px; | ||
border: none; | ||
width: 100%; | ||
height: 100%; | ||
flex-direction: column; | ||
overflow: hidden; | ||
} | ||
|
||
.teamReg__cn__mobile { | ||
display: flex; | ||
} | ||
|
||
.teamReg__cn__desktopinfo { | ||
width: 100%; | ||
height: fit-content; | ||
display: none; | ||
background-image: linear-gradient(rgba(30, 58, 138, 1), rgba(29, 78, 216, 1)); | ||
} | ||
|
||
.teamReg__cn__bannermobile { | ||
display: block; | ||
height: 109px; | ||
overflow: hidden; | ||
background-image: linear-gradient(rgba(30, 58, 138, 1), rgba(29, 78, 216, 1)); | ||
} | ||
|
||
.teamReg__cn__desktopinfo__steps { | ||
padding: 24px 0; | ||
} | ||
|
||
.teamReg__cn__content { | ||
height: 100%; | ||
flex: 1; | ||
overflow: hidden; | ||
position: relative; | ||
} | ||
|
||
@media (min-width: 1024px) { | ||
.teamReg{ | ||
top: 20px; | ||
width: 956px; | ||
height: 81svh; | ||
} | ||
.teamReg__cn { | ||
flex-direction: row; | ||
overflow-y: hidden; | ||
} | ||
|
||
.teamReg__cn__mobile { | ||
display: none; | ||
} | ||
|
||
.teamReg__cn__bannermobile { | ||
display: none; | ||
} | ||
|
||
.teamReg__cn__desktopinfo { | ||
display: block; | ||
width: 300px; | ||
} | ||
|
||
.teamReg__cn__desktopinfo { | ||
height: 100%; | ||
} | ||
|
||
.teamReg__cn__content { | ||
/* // overflow-y: auto; */ | ||
} | ||
|
||
.teamReg__close { | ||
display: block; | ||
cursor: pointer; | ||
position: absolute; | ||
top: 16px; | ||
right: 16px; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import RegsiterFormLoader from '@/components/core/register/register-form-loader'; | ||
import StepsIndicatorDesktop from '@/components/core/register/steps-indicator-desktop'; | ||
import StepsIndicatorMobile from '@/components/core/register/steps-indicator-mobile'; | ||
import TeamRegisterForm from '@/components/page/team-form-info/team-register-form'; | ||
import TeamRegisterInfo from '@/components/page/team-form-info/team-register-info'; | ||
import styles from './page.module.css'; | ||
import LoginInfo from '@/components/page/team-form-info/team-login-info'; | ||
import { getCookiesFromHeaders } from '@/utils/next-helpers'; | ||
|
||
export default function AddTeam(props: any) { | ||
const steps = ['basic', 'project details', 'social', 'success']; | ||
|
||
const { userInfo } = getPageData(); | ||
|
||
const showLoginInfo = !userInfo; | ||
|
||
|
||
return ( | ||
<> | ||
{!showLoginInfo && ( | ||
<div className={styles.teamReg}> | ||
<div className={styles.teamReg__cn}> | ||
<div className={styles.teamReg__cn__mobile}> | ||
<StepsIndicatorMobile steps={steps} /> | ||
</div> | ||
<aside className={styles.teamReg__cn__desktopinfo}> | ||
<TeamRegisterInfo /> | ||
<StepsIndicatorDesktop skip={['success']} steps={steps} /> | ||
</aside> | ||
<section className={styles.teamReg__cn__content}> | ||
<RegsiterFormLoader /> | ||
<TeamRegisterForm /> | ||
</section> | ||
</div> | ||
</div> | ||
)} | ||
{showLoginInfo && ( | ||
<div className={styles.loginPrompt}> | ||
<LoginInfo /> | ||
</div> | ||
)} | ||
</> | ||
); | ||
} | ||
|
||
function getPageData() { | ||
const { userInfo } = getCookiesFromHeaders(); | ||
|
||
return { | ||
userInfo | ||
}; | ||
} |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
'use client'; | ||
|
||
import { useRouter } from 'next/navigation'; | ||
|
||
export default function LoginInfo() { | ||
const router = useRouter(); | ||
const onCancel = () => { | ||
router.push('/'); | ||
}; | ||
|
||
const onLogin = async () => { | ||
router.push(`${window.location.pathname}${window.location.search}#login`, { scroll: false }); | ||
}; | ||
|
||
return ( | ||
<> | ||
<div className="login-info"> | ||
<div className="login-info__title">Login to submit a team</div> | ||
<div className="login-info__subtitle">You need to log in to submit a team.Please login to proceed.</div> | ||
<div className='login-info__actions'> | ||
<button onClick={onCancel} className="login-info__actions__cancel" type="button"> | ||
Cancel | ||
</button> | ||
<button className="login-info__actions__login" onClick={onLogin}>Proceed to Login</button> | ||
</div> | ||
</div> | ||
<style jsx> | ||
{` | ||
.login-info { | ||
display: flex; | ||
width: 100%; | ||
flex-direction: column; | ||
padding: 32px; | ||
gap: 20px; | ||
} | ||
.login-info__title { | ||
font-size: 24px; | ||
font-weight: 700; | ||
line-height: 32px; | ||
} | ||
.login-info__subtitle { | ||
font-size: 14px; | ||
font-weight: 400; | ||
line-height: 20px; | ||
} | ||
.login-info__actions{ | ||
display:flex; | ||
justify-content: flex-end; | ||
gap:10px; | ||
} | ||
.login-info__actions__cancel { | ||
padding: 10px 24px; | ||
border: 1px solid #cbd5e1; | ||
border-radius: 8px; | ||
background: white; | ||
cursor: pointer; | ||
font-size: 14px; | ||
font-weight: 500; | ||
} | ||
.login-info__actions__login { | ||
padding: 10px 24px; | ||
border: 1px solid #cbd5e1; | ||
border-radius: 8px; | ||
background: #156ff7; | ||
cursor: pointer; | ||
color: white; | ||
font-size: 14px; | ||
font-weight: 500; | ||
} | ||
`} | ||
</style> | ||
</> | ||
); | ||
} |
Oops, something went wrong.