diff --git a/frontend/public/messages/en.json b/frontend/public/messages/en.json index b14c6919..198c0662 100644 --- a/frontend/public/messages/en.json +++ b/frontend/public/messages/en.json @@ -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", diff --git a/frontend/public/sitemap.xml b/frontend/public/sitemap.xml new file mode 100644 index 00000000..fe5f851b --- /dev/null +++ b/frontend/public/sitemap.xml @@ -0,0 +1,50 @@ + + + https://basemind.ai/en + 2024-01-21 + weekly + 1.0 + + + https://basemind.ai/en/sign-in + 2024-01-21 + weekly + 0.9 + + + https://basemind.ai/en/privacy-policy + 2024-01-21 + weekly + 0.8 + + + https://basemind.ai/en/terms-of-service + 2024-01-21 + weekly + 0.7 + + + https://basemind.ai/en/support + 2024-01-21 + weekly + 0.6 + + + https://basemind.ai/en/projects/create + 2024-01-21 + weekly + 0.5 + + + https://basemind.ai/en/settings + 2024-01-21 + weekly + 0.4 + + + https://basemind.ai/en/projects + 2024-01-21 + weekly + 0.3 + + diff --git a/frontend/src/app/[locale]/sign-in/page.tsx b/frontend/src/app/[locale]/sign-in/page.tsx index b0f9e59e..4dfcad5f 100644 --- a/frontend/src/app/[locale]/sign-in/page.tsx +++ b/frontend/src/app/[locale]/sign-in/page.tsx @@ -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'; @@ -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); @@ -30,21 +29,23 @@ export default function SignIn() { return (
- -
-
- - { - setIsLoading(loadingValue); - }} - isInitialized={initialized} - /> + {isLoading ? ( + + ) : ( +
+
+ { + setIsLoading(loadingValue); + }} + isInitialized={initialized} + /> +
+
+ +
-
- -
-
+ )}
); } diff --git a/frontend/src/app/sitemap.ts b/frontend/src/app/sitemap.ts new file mode 100644 index 00000000..5a8bea75 --- /dev/null +++ b/frontend/src/app/sitemap.ts @@ -0,0 +1,25 @@ +import { MetadataRoute } from 'next'; + +import { Navigation } from '@/constants'; + +const BASE_URL = 'https://basemind.ai'; +const SitemapArray = [ + Navigation.Base, + Navigation.SignIn, + Navigation.PrivacyPolicy, + Navigation.TOS, + Navigation.Support, + Navigation.CreateProject, + Navigation.Settings, + Navigation.Projects, +]; +export default function SiteMap(): MetadataRoute.Sitemap { + return SitemapArray.map((path, index) => { + return { + changeFrequency: 'weekly', + lastModified: new Date(), + priority: 1 - index, + url: BASE_URL + path, + }; + }); +} diff --git a/frontend/src/components/sign-in/firebase-login.spec.tsx b/frontend/src/components/sign-in/firebase-login.spec.tsx index ed97a5e9..e75972ef 100644 --- a/frontend/src/components/sign-in/firebase-login.spec.tsx +++ b/frontend/src/components/sign-in/firebase-login.spec.tsx @@ -1,5 +1,4 @@ import { - EmailAuthProvider, GithubAuthProvider, GoogleAuthProvider, signInWithPopup, @@ -38,7 +37,6 @@ describe('FirebaseLogin tests', () => { ).toBeInTheDocument(); }); - expect(screen.getByTestId('email-login-button')).toBeInTheDocument(); expect(screen.getByTestId('github-login-button')).toBeInTheDocument(); expect(screen.getByTestId('google-login-button')).toBeInTheDocument(); @@ -64,7 +62,6 @@ describe('FirebaseLogin tests', () => { }); it.each([ - ['email-login-button', EmailAuthProvider], ['github-login-button', GithubAuthProvider], ['google-login-button', GoogleAuthProvider], ])( @@ -113,7 +110,7 @@ describe('FirebaseLogin tests', () => { let button: HTMLButtonElement; await waitFor(() => { - button = screen.getByTestId('email-login-button'); + button = screen.getByTestId('github-login-button'); expect(button).toBeInTheDocument(); }); @@ -142,13 +139,4 @@ describe('FirebaseLogin tests', () => { getEnv().NEXT_PUBLIC_FRONTEND_HOST + Navigation.PrivacyPolicy, ); }); - - it('should open the reset password modal when the reset password button is clicked', () => { - render(); - const resetPasswordButton: HTMLButtonElement = screen.getByTestId( - 'reset-password-button', - ); - fireEvent.click(resetPasswordButton); - expect(screen.getByTestId('password-reset-modal')).toBeInTheDocument(); - }); }); diff --git a/frontend/src/components/sign-in/firebase-login.tsx b/frontend/src/components/sign-in/firebase-login.tsx index 5e16875b..0f63f3b2 100644 --- a/frontend/src/components/sign-in/firebase-login.tsx +++ b/frontend/src/components/sign-in/firebase-login.tsx @@ -2,16 +2,15 @@ import { FirebaseError } from '@firebase/app'; import { Auth, AuthProvider, - EmailAuthProvider, GithubAuthProvider, GoogleAuthProvider, - sendEmailVerification, sendPasswordResetEmail, signInWithPopup, User, } 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'; @@ -45,8 +44,6 @@ const authProviders: { }, ]; -const emailProvider = new EmailAuthProvider(); - export function FirebaseLogin({ setLoading, isInitialized, @@ -137,39 +134,19 @@ export function FirebaseLogin({ data-testid="firebase-login-container" className="flex items-center h-full w-full justify-center" > -
- -
- -
+
+

+ {t('welcomeMessage')} +

+

+ {t('welcomeMessageDescription')} +

{authProviders.map(({ key, provider, size }) => (