Skip to content

Conversation

@piyalbasu
Copy link
Contributor

Followup PR to #2451

This adds the sheet component from shadcn which we will use on asset/collectible detail views. This doesn't change any business logic, it's simply a refactor to uses the component when displaying the detail view. Because of that, I haven't added any new test; we expect our previous tests to provide coverage to make sure I haven't broken any functionality

Screen.Recording.2025-12-14.at.3.51.00.PM.mov

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​radix-ui/​react-dialog@​1.1.15991007196100
Addednpm/​style-loader@​4.0.010010010083100
Addednpm/​tailwindcss@​4.1.181001008498100
Addednpm/​postcss-loader@​8.2.09810010085100
Addednpm/​tw-animate-css@​1.4.01001009488100
Addednpm/​@​tailwindcss/​postcss@​4.1.1810010010099100

View full report

"jest-canvas-mock": "2.5.2",
"jest-environment-jsdom": "29.7.0",
"js-yaml": "^4.1.1",
"js-yaml": "4.1.1",
Copy link
Contributor Author

@piyalbasu piyalbasu Dec 14, 2025

Choose a reason for hiding this comment

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

I noticed 2 deps that should be pinned

const [assetIcons, setAssetIcons] = useState(inputAssetIcons);
const networkDetails = useSelector(settingsNetworkDetailsSelector);
const [hasIconFetchRetried, setHasIconFetchRetried] = useState(false);
const [selectedAsset, setSelectedAsset] = useState<string>("");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we can now move the selectedAsset state into this component rather than passing it in, which makes our code a little cleaner 🎉

<span className="asset-code">{code}</span>
<div className="asset-native-amount" data-testid="asset-amount">
{formatAmount(amountVal)}
<Sheet open={selectedAsset === canonicalAsset} key={canonicalAsset}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrapping the existing component in <Sheet>

selectedAsset={canonicalAsset}
handleClose={() => setSelectedAsset("")}
/>
</SheetContent>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

And we then we wrap <AssetDetail> in <SheetContent>

const CollectionsList = ({ collections }: { collections: Collection[] }) => {
const { t } = useTranslation();
const [selectedCollectible, setSelectedCollectible] =
useState<SelectedCollectible | null>(null);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Similar change here - we can move the selected state closer to the actual detail component

subentryCount,
tokenPrices,
assetIcons,
handleClose,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the real changes here are removing some of these passed params and replacing with the redux selectors. This helps clean up some prop drilling we would have to do

module.exports = () => ({
plugins: {
"@tailwindcss/postcss": {},
autoprefixer: {},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like using postcss to implement tailwind's animation lib is the cleanest way to integrate tailwind into our build system

<img src={IconEllipsis} alt={t("asset options")} />
</div>
{optionsOpen ? (
<View>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

wrapping the existing component in a View to make it conform to the correct height and width

</div>
)}
{isNative && (
<SlideupModal
Copy link
Contributor Author

@piyalbasu piyalbasu Dec 15, 2025

Choose a reason for hiding this comment

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

We have a few instances of SlideupModal in the repo (a similar component to sheet). I've opened a new ticket to address this as I'd like to replace them all at once: #2467

Copy link
Contributor

@aristidesstaffieri aristidesstaffieri left a comment

Choose a reason for hiding this comment

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

👏 this lgtm.

@piyalbasu piyalbasu merged commit 0a1870e into release/5.37.0 Dec 15, 2025
2 of 10 checks passed
@piyalbasu piyalbasu deleted the add-bottom-sheet-detail-2 branch December 15, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants