Skip to content
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
12 changes: 2 additions & 10 deletions apps/remix/app/components/general/app-command-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -599,18 +599,10 @@ export const AppCommandMenu = ({ open, onOpenChange }: AppCommandMenuProps) => {
isVisibleCountCapped ? (
<Trans>{formatChipCount(totalVisibleCount, isVisibleCountCapped)} results</Trans>
) : (
<Plural
value={totalVisibleCount}
one="# result"
other="# results"
/>
<Plural value={totalVisibleCount} one="# result" other="# results" />
)
) : (
<Plural
value={totalVisibleCount}
one="# item"
other="# items"
/>
<Plural value={totalVisibleCount} one="# item" other="# items" />
)}
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { msg } from '@lingui/core/macro';
import { useLingui } from '@lingui/react';
import { Trans } from '@lingui/react/macro';
import { ArrowLeftIcon, KeyIcon, MailIcon, RotateCwIcon } from 'lucide-react';
import { KeyIcon, MailIcon, RotateCwIcon } from 'lucide-react';
import { useEffect, useState } from 'react';
import { useForm } from 'react-hook-form';
import { z } from 'zod';

import { EnableAuthenticatorAppDialog } from '~/components/forms/2fa/enable-authenticator-app-dialog';

import { useRequiredDocumentSigningAuthContext } from './document-signing-auth-provider';

export type DocumentSigningAuth2FAProps = {
Expand Down Expand Up @@ -89,9 +87,7 @@ export const DocumentSigningAuth2FA = ({

toast({
title: _(msg`Verification Code Sent`),
description: _(
msg`A 6-digit verification code has been sent to ${recipient.email}. Please check your inbox.`,
),
description: _(msg`A 6-digit verification code has been sent to ${recipient.email}. Please check your inbox.`),
});
} catch (err) {
setIsSendingEmail(false);
Expand Down Expand Up @@ -146,12 +142,12 @@ export const DocumentSigningAuth2FA = ({
<div className="space-y-4">
{/* Method switcher if user has both options */}
{user?.twoFactorEnabled && (
<div className="flex rounded-lg border p-1 bg-muted/30">
<div className="flex rounded-lg border bg-muted/30 p-1">
<Button
type="button"
variant={selectedMethod === 'authenticator' ? 'default' : 'ghost'}
size="sm"
className="flex-1 text-xs gap-1.5"
className="flex-1 gap-1.5 text-xs"
onClick={() => {
setSelectedMethod('authenticator');
setFormErrorCode(null);
Expand All @@ -165,7 +161,7 @@ export const DocumentSigningAuth2FA = ({
type="button"
variant={selectedMethod === 'email' ? 'default' : 'ghost'}
size="sm"
className="flex-1 text-xs gap-1.5"
className="flex-1 gap-1.5 text-xs"
onClick={() => {
setSelectedMethod('email');
setFormErrorCode(null);
Expand All @@ -192,7 +188,7 @@ export const DocumentSigningAuth2FA = ({
type="button"
variant="outline"
size="sm"
className="h-7 text-xs gap-1"
className="h-7 gap-1 text-xs"
loading={isSendingEmail}
onClick={sendEmailOtp}
>
Expand Down Expand Up @@ -238,7 +234,9 @@ export const DocumentSigningAuth2FA = ({
<Trans>Verification Failed</Trans>
</AlertTitle>
<AlertDescription>
<Trans>The code you entered is invalid or expired. Please check your email or click Resend Code.</Trans>
<Trans>
The code you entered is invalid or expired. Please check your email or click Resend Code.
</Trans>
</AlertDescription>
</Alert>
)}
Expand Down Expand Up @@ -294,7 +292,9 @@ export const DocumentSigningAuth2FA = ({
<Trans>Unauthorized</Trans>
</AlertTitle>
<AlertDescription>
<Trans>We were unable to verify your authenticator code. Please try again or switch to Email OTP.</Trans>
<Trans>
We were unable to verify your authenticator code. Please try again or switch to Email OTP.
</Trans>
</AlertDescription>
</Alert>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export const DocumentCertificateQRView = ({

<DialogDescription>
<Trans>
This document is available in your Crove Sign account. You can view more details, recipients, and audit
logs there.
This document is available in your Crove Sign account. You can view more details, recipients, and
audit logs there.
</Trans>
</DialogDescription>
</DialogHeader>
Expand Down Expand Up @@ -131,31 +131,31 @@ export const DocumentCertificateQRView = ({
</div>
</div>

<div className="flex items-center gap-2">
<Button asChild variant="outline" className="w-fit">
<a
href={`/articles/verify-document?token=${encodeURIComponent(token)}`}
target="_blank"
rel="noopener noreferrer"
>
<ShieldCheckIcon className="mr-2 h-5 w-5 text-emerald-500" />
<Trans>Verify on Blockchain</Trans>
</a>
</Button>

<EnvelopeDownloadDialog
envelopeId={envelopeItems[0].envelopeId}
envelopeStatus={DocumentStatus.COMPLETED}
envelopeItems={envelopeItems}
token={token}
trigger={
<Button type="button" variant="outline" className="w-fit">
<DownloadIcon className="mr-2 h-5 w-5" />
<Trans>Download</Trans>
</Button>
}
/>
</div>
<div className="flex items-center gap-2">
<Button asChild variant="outline" className="w-fit">
<a
href={`/articles/verify-document?token=${encodeURIComponent(token)}`}
target="_blank"
rel="noopener noreferrer"
>
<ShieldCheckIcon className="mr-2 h-5 w-5 text-emerald-500" />
<Trans>Verify on Blockchain</Trans>
</a>
</Button>

<EnvelopeDownloadDialog
envelopeId={envelopeItems[0].envelopeId}
envelopeStatus={DocumentStatus.COMPLETED}
envelopeItems={envelopeItems}
token={token}
trigger={
<Button type="button" variant="outline" className="w-fit">
<DownloadIcon className="mr-2 h-5 w-5" />
<Trans>Download</Trans>
</Button>
}
/>
</div>
</div>

<div className="mt-12 w-full">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ const UsageStatCard = ({ label, icon: Icon, used, limit, countOnly = false, foot

{hasFiniteLimit ? <Progress className={cn('mt-3 h-2', progressClassName)} value={percent} /> : null}

{subtext ? <p className="mt-2 text-muted-foreground text-xs">{subtext}</p> : null}
{Boolean(subtext) ? <p className="mt-2 text-muted-foreground text-xs">{subtext}</p> : null}
</div>

{action ? <div className="mt-4 flex justify-end border-t pt-4">{action}</div> : null}
{Boolean(action) ? <div className="mt-4 flex justify-end border-t pt-4">{action}</div> : null}
</div>
);
};
Expand Down
3 changes: 1 addition & 2 deletions apps/remix/app/routes/_share+/share.$slug.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { redirect, useLoaderData } from 'react-router';

import { NEXT_PUBLIC_WEBAPP_URL } from '@documenso/lib/constants/app';
import { getDocumentByAccessToken } from '@documenso/lib/server-only/document/get-document-by-access-token';
import { redirect, useLoaderData } from 'react-router';

import { DocumentCertificateQRView } from '~/components/general/document/document-certificate-qr-view';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export default function SignatureDisclosure() {
</h2>
<p>
<Trans>
Thank you for using Crove Sign to perform your electronic document signing. The purpose of this disclosure is
to inform you about the process, legality, and your rights regarding the use of electronic signatures on our
platform. By opting to use an electronic signature, you are agreeing to the terms and conditions outlined
below.
Thank you for using Crove Sign to perform your electronic document signing. The purpose of this disclosure
is to inform you about the process, legality, and your rights regarding the use of electronic signatures on
our platform. By opting to use an electronic signature, you are agreeing to the terms and conditions
outlined below.
</Trans>
</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,21 @@ export default function DocumentVerificationArticlePage() {
<div className="mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/10 text-primary">
<ShieldCheckIcon className="h-8 w-8 text-emerald-500" />
</div>
<h1 className="font-bold text-3xl tracking-tight text-foreground md:text-4xl">
<h1 className="font-bold text-3xl text-foreground tracking-tight md:text-4xl">
<Trans>Document Integrity Verification</Trans>
</h1>
<p className="mx-auto mt-2 max-w-xl text-muted-foreground text-sm md:text-base">
<Trans>
Verify the cryptographic tamper-evident receipt and on-chain attestation of any signed document on DOS Chain / EAS.
Verify the cryptographic tamper-evident receipt and on-chain attestation of any signed document on DOS Chain
/ EAS.
</Trans>
</p>
</div>

{/* Drag & Drop Upload Card */}
<Card className="border-border/60 shadow-sm">
<CardHeader>
<CardTitle className="text-lg font-semibold">
<CardTitle className="font-semibold text-lg">
<Trans>Upload Final PDF</Trans>
</CardTitle>
<CardDescription>
Expand All @@ -132,7 +133,9 @@ export default function DocumentVerificationArticlePage() {
e.preventDefault();
setIsDragging(false);
const file = e.dataTransfer.files?.[0];
if (file) handleFileProcess(file);
if (file) {
handleFileProcess(file);
}
}}
onClick={() => {
document.getElementById('verify-file-input')?.click();
Expand All @@ -145,14 +148,16 @@ export default function DocumentVerificationArticlePage() {
className="hidden"
onChange={(e) => {
const file = e.target.files?.[0];
if (file) handleFileProcess(file);
if (file) {
handleFileProcess(file);
}
}}
/>

{isLoading ? (
<div className="flex flex-col items-center gap-2">
<Loader2Icon className="h-10 w-10 animate-spin text-primary" />
<p className="font-medium text-sm text-foreground">
<p className="font-medium text-foreground text-sm">
<Trans>Computing cryptographic hash and querying DOS Chain...</Trans>
</p>
</div>
Expand Down Expand Up @@ -216,11 +221,13 @@ export default function DocumentVerificationArticlePage() {
<CardContent className="space-y-4 pt-2">
<div className="grid grid-cols-1 gap-4 md:grid-cols-2">
<div className="rounded-lg border bg-background p-3">
<span className="text-muted-foreground text-xs font-semibold uppercase">
<span className="font-semibold text-muted-foreground text-xs uppercase">
<Trans>Computed SHA-256 Hash</Trans>
</span>
<div className="mt-1 flex items-center justify-between">
<code className="truncate text-xs text-foreground font-mono">{verificationResult.documentHash}</code>
<code className="truncate font-mono text-foreground text-xs">
{verificationResult.documentHash}
</code>
<button
className="ml-2 text-muted-foreground hover:text-foreground"
onClick={() => copyToClipboard(verificationResult.documentHash, 'hash')}
Expand All @@ -230,17 +237,21 @@ export default function DocumentVerificationArticlePage() {
</button>
</div>
{copiedField === 'hash' && (
<span className="text-[10px] text-emerald-600 font-medium"><Trans>Copied!</Trans></span>
<span className="font-medium text-[10px] text-emerald-600">
<Trans>Copied!</Trans>
</span>
)}
</div>

{verificationResult.attestationUid && (
<div className="rounded-lg border bg-background p-3">
<span className="text-muted-foreground text-xs font-semibold uppercase">
<span className="font-semibold text-muted-foreground text-xs uppercase">
<Trans>EAS Attestation UID</Trans>
</span>
<div className="mt-1 flex items-center justify-between">
<code className="truncate text-xs text-foreground font-mono">{verificationResult.attestationUid}</code>
<code className="truncate font-mono text-foreground text-xs">
{verificationResult.attestationUid}
</code>
<button
className="ml-2 text-muted-foreground hover:text-foreground"
onClick={() => copyToClipboard(verificationResult.attestationUid, 'uid')}
Expand All @@ -250,40 +261,56 @@ export default function DocumentVerificationArticlePage() {
</button>
</div>
{copiedField === 'uid' && (
<span className="text-[10px] text-emerald-600 font-medium"><Trans>Copied!</Trans></span>
<span className="font-medium text-[10px] text-emerald-600">
<Trans>Copied!</Trans>
</span>
)}
</div>
)}
</div>

{verificationResult.isValid && (
<div className="rounded-lg border bg-background p-4 space-y-3">
<h4 className="font-semibold text-sm text-foreground flex items-center gap-2">
<div className="space-y-3 rounded-lg border bg-background p-4">
<h4 className="flex items-center gap-2 font-semibold text-foreground text-sm">
<FileTextIcon className="h-4 w-4 text-primary" />
<Trans>Attestation Details</Trans>
</h4>
<div className="grid grid-cols-1 gap-3 text-xs md:grid-cols-3">
<div>
<span className="text-muted-foreground"><Trans>Document Title</Trans>:</span>
<span className="text-muted-foreground">
<Trans>Document Title</Trans>:
</span>
<p className="font-medium text-foreground">{verificationResult.envelopeTitle || 'Document'}</p>
</div>
<div>
<span className="text-muted-foreground"><Trans>Anchored At</Trans>:</span>
<p className="font-medium text-foreground">{verificationResult.anchoredAt ? new Date(verificationResult.anchoredAt).toLocaleString() : 'N/A'}</p>
<span className="text-muted-foreground">
<Trans>Anchored At</Trans>:
</span>
<p className="font-medium text-foreground">
{verificationResult.anchoredAt
? new Date(verificationResult.anchoredAt).toLocaleString()
: 'N/A'}
</p>
</div>
<div>
<span className="text-muted-foreground"><Trans>Network</Trans>:</span>
<span className="text-muted-foreground">
<Trans>Network</Trans>:
</span>
<p className="font-medium text-foreground">DOS Chain (EAS Layer)</p>
</div>
</div>

{verificationResult.signers && verificationResult.signers.length > 0 && (
<div className="mt-3 pt-3 border-t">
<span className="text-muted-foreground text-xs"><Trans>Signers</Trans>:</span>
<div className="mt-3 border-t pt-3">
<span className="text-muted-foreground text-xs">
<Trans>Signers</Trans>:
</span>
<div className="mt-1 space-y-1">
{verificationResult.signers.map((signer: any, idx: number) => (
<div key={idx} className="flex items-center justify-between text-xs">
<span className="text-foreground font-medium">{signer.name} ({signer.email})</span>
<span className="font-medium text-foreground">
{signer.name} ({signer.email})
</span>
<span className="text-muted-foreground capitalize">{signer.role}</span>
</div>
))}
Expand All @@ -295,7 +322,10 @@ export default function DocumentVerificationArticlePage() {

{/* Legal & Technical Disclaimer */}
<div className="rounded-lg bg-muted/50 p-3 text-[11px] text-muted-foreground leading-relaxed">
<strong><Trans>Disclaimer</Trans>:</strong> {verificationResult.disclaimer}
<strong>
<Trans>Disclaimer</Trans>:
</strong>{' '}
{verificationResult.disclaimer}
</div>
</CardContent>
</Card>
Expand Down
Loading
Loading