Skip to content

Commit

Permalink
fix: loading signup bug, removed email login, added sitemap (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaaclindenman authored Jan 22, 2024
1 parent 31466ec commit 97034b3
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 36 deletions.
4 changes: 3 additions & 1 deletion frontend/public/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,9 @@
"resetPassword": "Reset Password",
"tos": "Terms of Service",
"unknownEmail": "User does not exist",
"userAgreementMessage": "By continuing you are agreeing to our"
"userAgreementMessage": "By continuing you are agreeing to our ",
"welcomeMessage": "Welcome to BaseMind",
"welcomeMessageDescription": "Get started with free credits, no credit card required."
},
"support": {
"api": "API",
Expand Down
50 changes: 50 additions & 0 deletions frontend/public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://basemind.ai/en</loc>
<lastmod>2024-01-21</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://basemind.ai/en/sign-in</loc>
<lastmod>2024-01-21</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>https://basemind.ai/en/privacy-policy</loc>
<lastmod>2024-01-21</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://basemind.ai/en/terms-of-service</loc>
<lastmod>2024-01-21</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://basemind.ai/en/support</loc>
<lastmod>2024-01-21</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://basemind.ai/en/projects/create</loc>
<lastmod>2024-01-21</lastmod>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>https://basemind.ai/en/settings</loc>
<lastmod>2024-01-21</lastmod>
<changefreq>weekly</changefreq>
<priority>0.4</priority>
</url>
<url>
<loc>https://basemind.ai/en/projects</loc>
<lastmod>2024-01-21</lastmod>
<changefreq>weekly</changefreq>
<priority>0.3</priority>
</url>
</urlset>
33 changes: 17 additions & 16 deletions frontend/src/app/[locale]/sign-in/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useRouter } from 'next/navigation';
import { useEffect, useState } from 'react';

import { LottieLoader } from '@/components/loader';
import { Logo } from '@/components/logo';
import { FirebaseLogin } from '@/components/sign-in/firebase-login';
import { LoginBanner } from '@/components/sign-in/login-banner';
import { marketingInfographic, Navigation } from '@/constants';
Expand All @@ -16,7 +15,7 @@ export default function SignIn() {
const user = useUser();
const router = useRouter();
const { initialized, page, identify } = useAnalytics();
const [isLoading, setIsLoading] = useState(true);
const [isLoading, setIsLoading] = useState(false);

useEffect(() => {
page(PageNames.Auth);
Expand All @@ -30,21 +29,23 @@ export default function SignIn() {

return (
<main data-testid="login-container" className="flex bg-base-100 h-full">
<LottieLoader />
<div className={`flex grow ${isLoading && 'hidden'}`}>
<div className="flex grow px-16 pt-16 pb-24 flex-col">
<Logo />
<FirebaseLogin
setLoading={(loadingValue) => {
setIsLoading(loadingValue);
}}
isInitialized={initialized}
/>
{isLoading ? (
<LottieLoader />
) : (
<div className="flex grow">
<div className="flex grow px-16 pt-16 pb-24 flex-col">
<FirebaseLogin
setLoading={(loadingValue) => {
setIsLoading(loadingValue);
}}
isInitialized={initialized}
/>
</div>
<div className="hidden lg:flex lg:h-screen lg:bg-base-200 lg:items-center lg:w-2/5">
<LoginBanner imageSrc={marketingInfographic} />
</div>
</div>
<div className="hidden lg:flex lg:h-screen lg:bg-base-200 lg:items-center lg:w-2/5">
<LoginBanner imageSrc={marketingInfographic} />
</div>
</div>
)}
</main>
);
}
2 changes: 1 addition & 1 deletion frontend/src/components/sign-in/firebase-login.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('FirebaseLogin tests', () => {
let button: HTMLButtonElement;

await waitFor(() => {
button = screen.getByTestId('email-login-button');
button = screen.getByTestId('github-login-button');
expect(button).toBeInTheDocument();
});

Expand Down
29 changes: 18 additions & 11 deletions frontend/src/components/sign-in/firebase-login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from '@firebase/auth';
import { useClickAway } from '@uidotdev/usehooks';
import Image from 'next/image';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { useTranslations } from 'next-intl';
import { LegacyRef, useEffect, useState } from 'react';
Expand Down Expand Up @@ -137,10 +138,16 @@ export function FirebaseLogin({
data-testid="firebase-login-container"
className="flex items-center h-full w-full justify-center"
>
<div className="flex flex-col justify-center gap-3 h-fit border-2 rounded border-neutral p-12">
<div className="flex flex-col justify-center gap-3 h-fit border-1 rounded border-neutral p-12">
<h3 className="text-4xl font-bold text-center text-neutral-content">
{t('welcomeMessage')}
</h3>
<p className="text-center text-neutral-content">
{t('welcomeMessageDescription')}
</p>
<button
data-testid="email-login-button"
className="btn btn-rounded flex border-2 border-base-300 justify-center gap-2"
className="btn btn-rounded flex border-2 border-base-300 justify-center gap-2 hidden"
onClick={() => {
void handleLogin(emailProvider, sendEmailVerification);
}}
Expand All @@ -153,7 +160,7 @@ export function FirebaseLogin({
/>
<span className="font-bold">Login with Email</span>
</button>
<div className="flex justify-end">
<div className="flex justify-end hidden">
<button
className="btn btn-xs btn-link"
data-testid="reset-password-button"
Expand All @@ -169,7 +176,7 @@ export function FirebaseLogin({
<button
key={key.toLowerCase()}
data-testid={`${key.toLowerCase()}-login-button`}
className="btn btn-rounded flex border-2 border-base-300 justify-center gap-2"
className="btn btn-bloc"
onClick={() => {
void handleLogin(provider);
}}
Expand All @@ -186,24 +193,24 @@ export function FirebaseLogin({
<div className="card-section-divider" />
<div
data-testid="tos-and-privacy-policy-container"
className="text-xs text-center"
className="text-xs text-center text-neutral-content max-w-xs mx-auto"
>
<span>{t('userAgreementMessage')}</span>
<a
className="link link-primary"
<Link
className="link hover:link-accent"
href={host + Navigation.TOS}
data-testid="tos-link"
>
{t('tos')}
</a>
</Link>
<span>{` ${t('and')} `}</span>
<a
className="link link-primary"
<Link
className="link hover:link-accent"
href={host + Navigation.PrivacyPolicy}
data-testid="privacy-policy-link"
>
{t('privacyPolicy')}
</a>
</Link>
<span>.</span>
</div>
<div ref={ref as LegacyRef<HTMLDivElement>}>
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/static-site/nav-auction-icons.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Book, Discord, Github, Telephone } from 'react-bootstrap-icons';
import { Discord, Github, Telephone } from 'react-bootstrap-icons';

import { ExternalNavigation } from '@/constants';
import { TrackEvents } from '@/constants/analytics';
Expand All @@ -18,11 +18,11 @@ export const NavAuctionIconsList = [
name: 'github-button',
url: ExternalNavigation.Github,
},
{
icon: <Book />,
name: 'docs-button',
url: ExternalNavigation.Docs,
},
// {
// icon: <Book />,
// name: 'docs-button',
// url: ExternalNavigation.Docs,
// },
{
icon: <Telephone />,
name: 'schedule-meeting-button',
Expand Down
1 change: 0 additions & 1 deletion frontend/src/constants/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export enum Navigation {
SignIn = '/en/sign-in',
Support = '/en/support',
TOS = '/en/terms-of-service',
Testing = '/en/projects/:projectId/testing',
}

export enum ExternalNavigation {
Expand Down

0 comments on commit 97034b3

Please sign in to comment.