Skip to content

Commit 1356cad

Browse files
committed
fix(web): text-overflow-in-item-card
1 parent 058af70 commit 1356cad

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

web/src/components/ItemCard/ItemField/TextField.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import styled from "styled-components";
33
import WithHelpTooltip from "components/WithHelpTooltip";
4+
import TruncatedText from "components/TruncatedText";
45

56
const Container = styled.p`
67
margin: 0px;
@@ -13,7 +14,13 @@ export interface ITextField {
1314
}
1415
const TextField: React.FC<ITextField> = ({ value, detailed, label }) => {
1516
return (
16-
<Container>{detailed ? <WithHelpTooltip tooltipMsg={label ?? ""}>{value}</WithHelpTooltip> : value}</Container>
17+
<Container>
18+
{detailed ? (
19+
<WithHelpTooltip tooltipMsg={label ?? ""}>{value}</WithHelpTooltip>
20+
) : (
21+
<TruncatedText text={value} maxLength={100} />
22+
)}
23+
</Container>
1724
);
1825
};
1926

web/src/components/ItemCard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const FieldsContainer = styled.div`
6363
flex-direction: column;
6464
justify-content: space-between;
6565
align-items: start;
66-
width: max-content;
66+
width: fit-content;
6767
gap: 16px;
6868
grid-column: span 2;
6969
${landscapeStyle(

0 commit comments

Comments
 (0)