[portal][feat] add sign up link

pull/542/head
Yangshun Tay 2 years ago
parent c99f57260d
commit 433a2ca11a

@ -6,6 +6,7 @@ import type { ReactNode } from 'react';
import { Fragment, useState } from 'react'; import { Fragment, useState } from 'react';
import { Menu, Transition } from '@headlessui/react'; import { Menu, Transition } from '@headlessui/react';
import { Bars3BottomLeftIcon } from '@heroicons/react/24/outline'; import { Bars3BottomLeftIcon } from '@heroicons/react/24/outline';
import { Button } from '@tih/ui';
import GlobalNavigation from '~/components/global/GlobalNavigation'; import GlobalNavigation from '~/components/global/GlobalNavigation';
import HomeNavigation from '~/components/global/HomeNavigation'; import HomeNavigation from '~/components/global/HomeNavigation';
@ -37,9 +38,25 @@ function ProfileJewel() {
const loginHref = loginPageHref(); const loginHref = loginPageHref();
if (session == null) { if (session == null) {
return router.pathname !== loginHref.pathname ? ( return router.pathname !== loginHref.pathname ? (
<Link className="text-base" href={loginHref}> <div className="flex items-center space-x-4">
Sign In <Link
</Link> className="hover:text-primary-500 text-xs font-medium text-slate-700"
href={loginHref}>
Sign In
</Link>
<Button
href={{
...loginHref,
query: {
...loginHref.query,
mode: 'signup',
},
}}
label="Sign Up"
size="sm"
variant="tertiary"
/>
</div>
) : null; ) : null;
} }

@ -28,13 +28,13 @@ export default function LoginPage({
<div className="sm:mx-auto sm:w-full sm:max-w-md"> <div className="sm:mx-auto sm:w-full sm:max-w-md">
<img <img
alt="Tech Interview Handbook" alt="Tech Interview Handbook"
className="mx-auto h-24 w-auto" className="mx-auto h-24 w-auto sm:h-36"
src="/logo.svg" src="/logo.svg"
/> />
<h2 className="mt-6 text-center text-3xl font-bold tracking-tight text-slate-900"> <h2 className="mt-6 text-center text-2xl font-bold tracking-tight text-slate-900 sm:text-3xl">
Sign in to Tech Interview Handbook Portal Sign in to Tech Interview Handbook Portal
</h2> </h2>
<p className="mt-2 text-center text-slate-600"> <p className="mt-2 text-center text-sm text-slate-600 sm:text-base">
Get your resumes peer-reviewed, discuss solutions to tech interview Get your resumes peer-reviewed, discuss solutions to tech interview
questions, explore offer data points. questions, explore offer data points.
</p> </p>
@ -48,7 +48,11 @@ export default function LoginPage({
addonPosition="start" addonPosition="start"
display="block" display="block"
icon={GitHubIcon} icon={GitHubIcon}
label={`Sign in with ${provider.name}`} label={
router.query.mode === 'signup'
? `Sign up with ${provider.name}`
: `Sign in with ${provider.name}`
}
type="button" type="button"
variant="primary" variant="primary"
onClick={() => onClick={() =>
@ -65,6 +69,11 @@ export default function LoginPage({
</div> </div>
))} ))}
</div> </div>
{router.query.mode === 'signup' && (
<p className="mt-2 text-center text-xs text-slate-500 sm:text-sm">
Sign up for an account via GitHub, it's free!
</p>
)}
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save