mirror of
https://github.com/selfxyz/self.git
synced 2026-01-10 07:08:10 -05:00
formatting
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
|
||||
|
||||
import React from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import type {
|
||||
ImageSourcePropType,
|
||||
LayoutChangeEvent,
|
||||
@@ -50,7 +50,7 @@ export const ProofRequestCard: React.FC<ProofRequestCardProps> = ({
|
||||
appName,
|
||||
appUrl,
|
||||
documentType = '',
|
||||
timestamp = new Date(),
|
||||
timestamp,
|
||||
children,
|
||||
testID = 'proof-request-card',
|
||||
onScroll,
|
||||
@@ -59,6 +59,10 @@ export const ProofRequestCard: React.FC<ProofRequestCardProps> = ({
|
||||
onLayout,
|
||||
initialScrollOffset,
|
||||
}) => {
|
||||
// Create default timestamp once and reuse it to avoid unnecessary re-renders
|
||||
const defaultTimestamp = useMemo(() => new Date(), []);
|
||||
const effectiveTimestamp = timestamp ?? defaultTimestamp;
|
||||
|
||||
// Build request message with highlighted app name and document type
|
||||
const requestMessage = (
|
||||
<>
|
||||
@@ -99,7 +103,7 @@ export const ProofRequestCard: React.FC<ProofRequestCardProps> = ({
|
||||
|
||||
{/* Metadata Bar */}
|
||||
<ProofMetadataBar
|
||||
timestamp={formatTimestamp(timestamp)}
|
||||
timestamp={formatTimestamp(effectiveTimestamp)}
|
||||
testID={`${testID}-metadata`}
|
||||
/>
|
||||
|
||||
|
||||
@@ -138,11 +138,6 @@ export const WalletIcon: React.FC<IconProps> = ({
|
||||
strokeWidth="2"
|
||||
fill="none"
|
||||
/>
|
||||
<Path
|
||||
d="M2 10H22"
|
||||
stroke={color}
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
<Path d="M2 10H22" stroke={color} strokeWidth="2" strokeLinecap="round" />
|
||||
</Svg>
|
||||
);
|
||||
|
||||
@@ -380,7 +380,13 @@ const DocumentSelectorForProvingScreen: React.FC = () => {
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
}, [selectedDocumentId, canContinue, submitting, setSelectedDocument, navigation]);
|
||||
}, [
|
||||
selectedDocumentId,
|
||||
canContinue,
|
||||
submitting,
|
||||
setSelectedDocument,
|
||||
navigation,
|
||||
]);
|
||||
|
||||
const handleApprove = async () => {
|
||||
if (!selectedDocumentId || !canContinue || submitting) {
|
||||
|
||||
Reference in New Issue
Block a user