-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
775fc5f
commit ddd71ca
Showing
7 changed files
with
136 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import * as React from 'react' | ||
|
||
import { cn } from '@/features/common/utils' | ||
|
||
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( | ||
<div ref={ref} className={cn('rounded-lg border bg-card text-card-foreground shadow-sm', className)} {...props} /> | ||
)) | ||
Card.displayName = 'Card' | ||
|
||
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( | ||
<div ref={ref} className={cn('flex flex-col', className)} {...props} /> | ||
)) | ||
CardHeader.displayName = 'CardHeader' | ||
|
||
const CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => ( | ||
<h3 ref={ref} className={cn('text-2xl font-semibold leading-none tracking-tight', className)} {...props} /> | ||
)) | ||
CardTitle.displayName = 'CardTitle' | ||
|
||
const CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>( | ||
({ className, ...props }, ref) => <p ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} /> | ||
) | ||
CardDescription.displayName = 'CardDescription' | ||
|
||
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( | ||
<div ref={ref} className={cn(className)} {...props} /> | ||
)) | ||
CardContent.displayName = 'CardContent' | ||
|
||
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( | ||
<div ref={ref} className={cn('flex items-center', className)} {...props} /> | ||
)) | ||
CardFooter.displayName = 'CardFooter' | ||
|
||
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { TemplatedNavLink } from '@/features/routing/components/templated-nav-link/templated-nav-link' | ||
import { Urls } from '@/routes/urls' | ||
|
||
export function ExplorePage() { | ||
return ( | ||
<div> | ||
<TemplatedNavLink | ||
urlTemplate={Urls.Explore.Transaction.ById} | ||
urlParams={{ transactionId: 'QOOBRVQMX4HW5QZ2EGLQDQCQTKRF3UP3JKDGKYPCXMI6AVV35KQA' }} | ||
> | ||
View sample transaction | ||
</TemplatedNavLink> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,49 @@ | ||
import { UrlParams } from '../../../routes/urls' | ||
import { useRequiredParam } from '../../common/hooks/use-required-param' | ||
import { Card, CardContent } from '@/features/common/components/card' | ||
import { cn } from '@/features/common/utils' | ||
|
||
export function TransactionPage() { | ||
const { transactionId } = useRequiredParam(UrlParams.TransactionId) | ||
return <div>Transaction Id {transactionId}</div> | ||
type Props = { | ||
transaction: TransactionModel | ||
} | ||
|
||
export function Transaction({ transaction }: Props) { | ||
const transactionCardItems = [ | ||
{ | ||
dt: 'Transaction ID', | ||
dd: transaction.id, | ||
}, | ||
{ | ||
dt: 'Type', | ||
dd: transaction.type, | ||
}, | ||
] | ||
return ( | ||
<div> | ||
<h1 className={cn('text-2xl text-primary font-bold')}>Transaction</h1> | ||
<div className={cn('space-y-6 pt-7')}> | ||
<Card className={cn('p-4')}> | ||
<CardContent className={cn('text-sm space-y-2')}> | ||
{transactionCardItems.map((item, index) => ( | ||
<dl className={cn('grid grid-cols-8')} key={index}> | ||
<dt>{item.dt}</dt> | ||
<dd className={cn('col-span-7')}>{item.dd}</dd> | ||
</dl> | ||
))} | ||
</CardContent> | ||
</Card> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export enum TransactionType { | ||
Payment = 'Payment', | ||
} | ||
|
||
export type TransactionModel = { | ||
id: string | ||
type: TransactionType | ||
confirmedRound: number | ||
roundTime: number | ||
group: string | ||
fee: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { UrlParams } from '../../../routes/urls' | ||
import { useRequiredParam } from '../../common/hooks/use-required-param' | ||
import { Transaction, TransactionModel, TransactionType } from '../components/transaction' | ||
|
||
export function TransactionPage() { | ||
const { transactionId } = useRequiredParam(UrlParams.TransactionId) | ||
const sampleTransaction = getSampleTransaction(transactionId) | ||
|
||
return <Transaction transaction={sampleTransaction} /> | ||
} | ||
|
||
const getSampleTransaction = (transactionId: string): TransactionModel => { | ||
return { | ||
id: transactionId, | ||
type: TransactionType.Payment, | ||
confirmedRound: 36570178, | ||
roundTime: 1709189521, | ||
group: 'a7Qnfai3DEKS8JI5ZPl149O9P7RztrBqRvBwRebx/Ao=', | ||
fee: 1000, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters