Skip to content

Commit fc48338

Browse files
authored
fix: [lw-11747] add line clamp styling for tockens and collectibles (#1489)
1 parent 3f1a480 commit fc48338

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

packages/nami/src/ui/app/components/asset.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ const useIsMounted = () => {
3333
return isMounted;
3434
};
3535

36+
const lineClampStyle = {
37+
display: '-webkit-box',
38+
'-webkit-line-clamp': '2',
39+
'-webkit-box-orient': 'vertical',
40+
};
41+
3642
type Props = Pick<CommonOutsideHandlesContextValue, 'cardanoCoin'> &
3743
PropsWithChildren<{
3844
asset: NamiAsset;
@@ -128,8 +134,8 @@ const Asset = ({
128134

129135
<Box w={4} />
130136
<Box
137+
style={lineClampStyle}
131138
width="90px"
132-
className="lineClamp"
133139
fontWeight="bold"
134140
overflow="hidden"
135141
fontSize={12}

packages/nami/src/ui/app/components/collectible.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ const useIsMounted = () => {
2222
return isMounted;
2323
};
2424

25+
const lineClampStyle = {
26+
display: '-webkit-box',
27+
'-webkit-line-clamp': '3',
28+
'-webkit-box-orient': 'vertical',
29+
};
30+
2531
const CollectibleComponent = ({ asset, ...props }, ref) => {
2632
const capture = useCaptureEvent();
2733
const background = useColorModeValue('gray.300', 'white');
@@ -103,7 +109,7 @@ const CollectibleComponent = ({ asset, ...props }, ref) => {
103109
>
104110
<Box
105111
overflow="hidden"
106-
className="lineClamp3"
112+
style={lineClampStyle}
107113
fontSize={13}
108114
fontWeight="bold"
109115
color="GrayText"

packages/nami/src/ui/app/components/collectiblesViewer.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ import Copy from './copy';
4242

4343
import type { Asset as NamiAsset } from '../../../types/assets';
4444

45+
const lineClampStyle = {
46+
display: '-webkit-box',
47+
'-webkit-line-clamp': '2',
48+
'-webkit-box-orient': 'vertical',
49+
};
50+
4551
interface Props {
4652
assets: NamiAsset[];
4753
setAvatar: (image: string) => void;
@@ -221,7 +227,7 @@ export const CollectibleModalComponent = (
221227
<Box h={6} />
222228
<Box
223229
textAlign="center"
224-
className="lineClamp"
230+
style={lineClampStyle}
225231
overflow="hidden"
226232
fontSize={14}
227233
fontWeight="bold"
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
.lineClamp {
2-
display: -webkit-box;
3-
-webkit-line-clamp: 2;
4-
-webkit-box-orient: vertical;
5-
}
6-
7-
.lineClamp3 {
8-
display: -webkit-box;
9-
-webkit-line-clamp: 3;
10-
-webkit-box-orient: vertical;
11-
}
12-
131
body::-webkit-scrollbar {
142
display: none;
153
}

0 commit comments

Comments
 (0)