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

fix: broken loading in Transactions in UserHub + fixed text overflow in pills #2725

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/components/common/Extensions/UserHub/UserHub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const UserHub: FC<UserHubProps> = ({
</>
)}
</div>
<div className={clsx('relative h-full w-full')}>
<div className="relative h-full w-full min-w-0">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

min-w-0 and max-w-full classes added for different elements to make text-overflow: ellipsis on pills actually works

Screenshot 2024-07-17 at 15 54 35

{selectedTab === UserHubTabs.Balance && (
<ReputationTab onTabChange={handleTabChange} />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const GroupedTransaction: FC<GroupedTransactionProps> = ({
onClick={handleNavigateToAction}
disabled={!canLinkToAction || hideSummary}
className={clsx(
'flex w-full flex-col items-start gap-1 sm:px-6',
'flex w-full min-w-0 flex-col items-start gap-1 sm:px-6',
{
'cursor-default': !canLinkToAction,
},
Expand All @@ -138,7 +138,7 @@ const GroupedTransaction: FC<GroupedTransactionProps> = ({
{value}
</h4>
{createdAt && (
<span className="mt-0.5 block text-xs text-gray-400">
<span className="mt-0.5 block whitespace-nowrap text-xs text-gray-400">
{createdAt}
</span>
)}
Expand All @@ -156,7 +156,7 @@ const GroupedTransaction: FC<GroupedTransactionProps> = ({
/>
</p>
</div>
<div className="flex gap-2 pr-8">
<div className="flex min-w-0 gap-2 pr-8">
{!isMobile && <GroupedTransactionStatus status={status} />}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,29 @@ const GroupedTransactionStatus: FC<TransactionStatusProps> = ({ status }) => {

return (
<div
className={clsx('flex flex-col items-end', {
className={clsx('flex min-w-0 flex-col items-end', {
'text-success-400': succeeded,
'text-negative-400': failed,
})}
>
{pending && (
<SpinnerGap
className="ml-2.5 h-[0.8125rem] w-[0.8125rem] animate-spin text-blue-400"
size={14}
/>
)}
<PillsBase
className={clsx({
'bg-success-100 text-success-400': succeeded,
'bg-negative-100 text-negative-400': failed,
'bg-gray-100 text-gray-500': !succeeded && !failed,
})}
className={clsx(
{
'bg-success-100 text-success-400': succeeded,
'bg-negative-100 text-negative-400': failed,
'bg-gray-100 text-gray-500': !succeeded && !failed,
},
'min-w-0 max-w-full',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure min-w-0 is needed.

)}
textClassName="flex min-w-0 items-center"
>
{status.toLowerCase()}
<span className="min-w-0 truncate">{status.toLowerCase()}</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure min-w-0 is needed.

{pending && (
<SpinnerGap
className="flex-grow-1 ml-1 inline-block h-[0.8125rem] w-[0.8125rem] flex-shrink-0 animate-spin text-blue-400"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure flex-grow-1 inline-block flex-shrink-0 is needed here.

size={14}
/>
)}
</PillsBase>
</div>
);
Expand Down
Loading