Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMB-357] feat: add tooltip about security info to signup form #88

Merged
merged 2 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
"plain": "The password hint will be stored in plain text. Avoid using your full password as a hint!",
"referral": "Referral Code",
"save": "Please save your password as it cannot be recovered if lost.",
"security": "The password is your responsibility to keep safe. You may want to consider using a password manager. <learn>Learn more</learn> about BancoLibre security practices.",
"set": "Set a password",
"submit": "Create Account"
},
Expand Down
1 change: 1 addition & 0 deletions messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
"plain": "El recordatorio para la contraseña se guarda sin encripción. Evita usar la misma contraseña como recordatorio!",
"referral": "Código de Invitación",
"save": "Por favór guarda la contraseña. No se puede recuperar si se pierde.",
"security": "Es su responsabilidad mantener la contraseña segura. Recomendamos el uso de un administrador de contraseñas. <learn>Aprende más</learn> sobre las practicas de seguridad de BancoLibre.",
"set": "Crea una contraseña",
"submit": "Crea una cuenta"
},
Expand Down
19 changes: 11 additions & 8 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { getLocale, getMessages } from 'next-intl/server';
import PlausibleProvider from 'next-plausible';

import { Toaster } from '@/components/ui/toaster';
import { TooltipProvider } from '@/components/ui/tooltip';
import { ApolloWrapper } from '@/lib/apollo/wrapper';
import { ThemeProvider } from '@/lib/themes/wrapper';

Expand Down Expand Up @@ -55,14 +56,16 @@ export default async function RootLayout({
enableSystem
disableTransitionOnChange
>
<ApolloWrapper
serverUrl={serverUrl}
accessToken={accessToken}
refreshToken={refreshToken}
>
{children}
<Toaster />
</ApolloWrapper>
<TooltipProvider>
<ApolloWrapper
serverUrl={serverUrl}
accessToken={accessToken}
refreshToken={refreshToken}
>
{children}
<Toaster />
</ApolloWrapper>
</TooltipProvider>
</ThemeProvider>
</NextIntlClientProvider>
</body>
Expand Down
29 changes: 27 additions & 2 deletions src/components/form/SignUpForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { ApolloError, useApolloClient } from '@apollo/client';
import stringEntropy from 'fast-password-entropy';
import { ArrowLeft, Eye, EyeOff, Loader2 } from 'lucide-react';
import { ArrowLeft, Eye, EyeOff, Info, Loader2 } from 'lucide-react';
import Link from 'next/link';
import { useSearchParams } from 'next/navigation';
import { useTranslations } from 'next-intl';
Expand All @@ -24,6 +24,7 @@ import { Button } from '../ui/button-v2';
import { Checkbox } from '../ui/checkbox';
import { Label } from '../ui/label';
import { Progress } from '../ui/progress';
import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip';
import { useToast } from '../ui/use-toast';
import { WaitlistForm } from './WaitlistForm';

Expand Down Expand Up @@ -264,7 +265,31 @@ export function SignUpForm() {

<div className="space-y-4">
<div className="space-y-2">
<Label htmlFor="password">{c('password')}</Label>
<div className="flex items-center space-x-2">
<Label htmlFor="password">{c('password')}</Label>

<Tooltip>
<TooltipTrigger asChild>
<button type="button">
<Info size={16} />
</button>
</TooltipTrigger>

<TooltipContent className="w-72">
{s.rich('security', {
learn: chunks => (
<Link
href={ROUTES.docs.security}
target="_blank"
className="underline underline-offset-2"
>
{chunks}
</Link>
),
})}
</TooltipContent>
</Tooltip>
</div>

<div className="flex items-center gap-2">
<Input
Expand Down
Loading
Loading