-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix: update table for mobile view #3401
Open
Nortsova
wants to merge
2
commits into
master
Choose a base branch
from
fix/2662-c2f-drain-history-table-ui
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
...ame/v5/pages/UserCryptoToFiatPage/partials/FiatTransfersTable/FiatTransferDescription.tsx
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,75 @@ | ||
import { ArrowSquareOut } from '@phosphor-icons/react'; | ||
import { type Row } from '@tanstack/react-table'; | ||
import clsx from 'clsx'; | ||
import React, { type FC } from 'react'; | ||
|
||
import ExternalLink from '~shared/ExternalLink/ExternalLink.tsx'; | ||
import { type BridgeDrain } from '~types/graphql.ts'; | ||
import { getFormattedDateFrom } from '~utils/getFormattedDateFrom.ts'; | ||
import { formatText } from '~utils/intl.ts'; | ||
import PillsBase from '~v5/common/Pills/PillsBase.tsx'; | ||
|
||
import { statusPillScheme, STATUS_MSGS } from './consts.ts'; | ||
import { FiatTransferDescriptionRow } from './FiatTransferDescriptionRow.tsx'; | ||
|
||
export interface FiatTransferDescriptionProps { | ||
actionRow: Row<BridgeDrain>; | ||
loading: boolean; | ||
} | ||
|
||
const FiatTransferDescription: FC<FiatTransferDescriptionProps> = ({ | ||
actionRow, | ||
loading, | ||
}) => { | ||
const status = actionRow.getValue('state') as keyof typeof statusPillScheme; | ||
const statusScheme = statusPillScheme[status] || statusPillScheme.default; | ||
|
||
return ( | ||
<div className="expandable flex items-start justify-between gap-1 pb-5 pl-[1.125rem] pr-[.9375rem]"> | ||
<div className="flex flex-col gap-3 text-gray-500"> | ||
<FiatTransferDescriptionRow | ||
loading={loading} | ||
title={formatText({ id: 'table.row.date' })} | ||
> | ||
<span className="text-md"> | ||
{getFormattedDateFrom(actionRow.getValue('createdAt'))} | ||
</span> | ||
</FiatTransferDescriptionRow> | ||
<FiatTransferDescriptionRow | ||
loading={loading} | ||
title={formatText({ id: 'table.row.status' })} | ||
> | ||
<PillsBase | ||
isCapitalized={false} | ||
className={clsx(statusScheme.bgClassName, 'text-sm font-medium')} | ||
> | ||
<span className={statusScheme.textClassName}> | ||
{formatText(STATUS_MSGS[status as keyof typeof STATUS_MSGS])} | ||
</span> | ||
</PillsBase> | ||
</FiatTransferDescriptionRow> | ||
<FiatTransferDescriptionRow | ||
loading={loading} | ||
title={formatText({ id: 'table.row.receipt' })} | ||
> | ||
{!actionRow.original.receipt ? ( | ||
<div className="text-gray-400"> | ||
{formatText({ id: 'table.content.receiptGenerating' })} | ||
</div> | ||
) : ( | ||
<ExternalLink | ||
href={actionRow.original.receipt.url} | ||
key={actionRow.original.receipt.url} | ||
className="ml-1 flex items-center gap-2 text-gray-700 underline transition-colors hover:text-blue-400" | ||
> | ||
<ArrowSquareOut size={18} /> | ||
{formatText({ id: 'table.content.viewReceipt' })} | ||
</ExternalLink> | ||
)} | ||
</FiatTransferDescriptionRow> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FiatTransferDescription; |
23 changes: 23 additions & 0 deletions
23
.../v5/pages/UserCryptoToFiatPage/partials/FiatTransfersTable/FiatTransferDescriptionRow.tsx
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,23 @@ | ||
import clsx from 'clsx'; | ||
import React, { type PropsWithChildren, type FC } from 'react'; | ||
|
||
interface FiatTransferDescriptionRowProps { | ||
title: string; | ||
loading: boolean; | ||
} | ||
|
||
export const FiatTransferDescriptionRow: FC< | ||
PropsWithChildren<FiatTransferDescriptionRowProps> | ||
> = ({ title, children, loading }) => { | ||
const textClassName = 'font-normal text-sm flex items-center'; | ||
return ( | ||
<p | ||
className={clsx(textClassName, 'text-gray-600', { | ||
skeleton: loading, | ||
})} | ||
> | ||
<span>{title}:</span> | ||
<span className="ml-1">{children}</span> | ||
</p> | ||
); | ||
}; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing that doesn't match the design is the size, due to the fact that we have quite long statuses.
@melyndav could you please check if it is possible to leave it as it is?