Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
LL-8840 - Limit NFT's name to 3 lines in NFT Viewer (#4598)
Browse files Browse the repository at this point in the history
* Limit NFT's name to 3 lines in NFT Viewer

* Fix linting
  • Loading branch information
grsoares21 authored Jan 7, 2022
1 parent 5189223 commit 30b4021
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/renderer/drawers/NFTViewerDrawer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { CopiableField } from "./CopiableField";
import { ExternalViewerButton } from "./ExternalViewerButton";
import Skeleton from "~/renderer/screens/nft/Skeleton";
import Image from "~/renderer/screens/nft/Image";
import { centerEllipsis } from "~/renderer/styles/helpers";
import { useNftMetadata } from "@ledgerhq/live-common/lib/nft/NftMetadataProvider";
import { space, layout, position } from "styled-system";
import { openModal } from "~/renderer/actions/modals";
Expand Down Expand Up @@ -142,7 +141,7 @@ export function NFTViewerDrawer({
const nft = useSelector(state => getNFTById(state, { nftId }));
const { status, metadata } = useNftMetadata(nft.collection.contract, nft.tokenId);
const show = useMemo(() => status === "loading", [status]);
const name = centerEllipsis(metadata?.nftName || nft.tokenId, 26);
const name = metadata?.nftName || nft.tokenId;

const onNFTSend = useCallback(() => {
setDrawer();
Expand Down Expand Up @@ -170,8 +169,13 @@ export function NFTViewerDrawer({
fontSize={7}
lineHeight="29px"
color="palette.text.shade100"
style={{
WebkitLineClamp: 3,
WebkitBoxOrient: "vertical",
overflow: "hidden",
display: "-webkit-box",
}}
uppercase
pb={5}
>
{name}
</Text>
Expand Down

1 comment on commit 30b4021

@github-actions
Copy link

Choose a reason for hiding this comment

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

Lint outputs ✅

Tests outputs ✅

PASS src/generate-cryptoassets-md.test.js

Test Suites: 1 skipped, 1 passed, 1 of 2 total
Tests: 5 skipped, 1 passed, 6 total
Snapshots: 0 total
Time: 2.936 s
Test results written to: report.json

Diff output ✅

Please sign in to comment.