Skip to content

Commit

Permalink
Merge pull request #809 from sonaliTekdi/leanrathon_UI_changes
Browse files Browse the repository at this point in the history
Bug #228502  -  [webapp- content cards] Language font showing on content card is bigger than other values.PFA
  • Loading branch information
paritshivani authored Dec 5, 2024
2 parents 42c0587 + ec3c9fa commit 6c43fbd
Showing 1 changed file with 98 additions and 125 deletions.
223 changes: 98 additions & 125 deletions packages/nulp_elite/src/components/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default function BoxCard({ items, index, onClick, continueLearning }) {
return dateObject.toLocaleDateString("en-GB", options);
};


if (items.content) {
return (
<Card
Expand Down Expand Up @@ -98,9 +99,8 @@ export default function BoxCard({ items, index, onClick, continueLearning }) {
<Box className="cardLabelEllips">
{items.content.organisation.length === 1
? items.content.organisation[0]
: `${items.content.organisation[0]} + ${
items.content.organisation.length - 1
}`}
: `${items.content.organisation[0]} + ${items.content.organisation.length - 1
}`}
</Box>
</Typography>
)}
Expand Down Expand Up @@ -227,149 +227,122 @@ export default function BoxCard({ items, index, onClick, continueLearning }) {
<Box className="cardLabelEllips">
{items.organisation.length === 1
? items.organisation[0]
: `${items.organisation[0]} + ${
items.organisation.length - 1
}`}
: `${items.organisation[0]} + ${items.organisation.length - 1
}`}
</Box>
</Typography>
</Tooltip>
)}
</Box>
<Box>
{" "}
{items?.medium ||
(items?.se_mediums && (
<>
{items?.medium && items.medium.length > 0 ? (
<Tooltip
title={
items.medium.length > 1
? items.medium.join(", ")
: items.medium[0]
}
arrow
placement="top"
>
<Typography
variant="body2"
color="#5B5B5B"
style={{
fontSize: "11px",
padding: "10px 0",
textAlign: "right",
}}
>
<Box className="cardLabelEllips">
{items.medium.length === 1
? items.medium[0]
: `${items.medium[0]} + ${items.medium.length - 1}`}
</Box>
</Typography>
</Tooltip>
) : (
<Tooltip
title={
items.se_mediums.length > 1
{items?.medium || items?.se_mediums ? (
<>
{(items?.medium && items.medium.length > 0) || items?.se_mediums.length > 0 ? (
<Tooltip
title={
items.medium?.length > 1
? items.medium.join(", ")
: items.medium?.[0] ||
(items.se_mediums.length > 1
? items.se_mediums.join(", ")
: items.se_mediums[0]
}
arrow
placement="top"
: items.se_mediums[0])
}
arrow
placement="top"
>
<Typography
variant="body2"
color="#5B5B5B"
style={{
fontSize: "11px",
padding: "10px 0",
textAlign: "right",
}}
>
<Typography
variant="body2"
color="#5B5B5B"
style={{
fontSize: "11px",
padding: "10px 0",
textAlign: "right",
}}
>
<Box className="cardLabelEllips">
{items.se_mediums.length === 1
<Box className="cardLabelEllips">
{items.medium?.length > 0
? items.medium.length === 1
? items.medium[0]
: `${items.medium[0]} + ${items.medium.length - 1}`
: items.se_mediums.length === 1
? items.se_mediums[0]
: `${items.se_mediums[0]} + ${
items.se_mediums.length - 1
}`}
</Box>
</Typography>
</Tooltip>
)}
</>
))}
: `${items.se_mediums[0]} + ${items.se_mediums.length - 1}`}
</Box>
</Typography>
</Tooltip>
) : null}
</>
) : null}
</Box>
</Box>
</CardContent>
{(items?.board ||
items?.gradeLevel ||
items?.se_boards ||
items?.se_gradeLevels) && (
<>
<Box className="textLeft mb-15 d-flex">
{items?.board ? (
<Tooltip
title={items.board}
placement="top"
className="labelOne cardLabelEllips"
>
<Button>{items.board}</Button>
</Tooltip>
) : (
<Tooltip
title={
Array.isArray(items?.se_boards) && items.se_boards.length > 0
? items.se_boards.join(", ")
: ""
}
placement="top"
className="labelOne cardLabelEllips"
>
<Button>
{Array.isArray(items?.se_boards) && items.se_boards.length > 0
? `${items.se_boards[0]}${
items.se_boards.length > 1
? ` + ${items.se_boards.length - 1}`
: ""
<>
<Box className="textLeft mb-15 d-flex">
{items?.board ? (
<Tooltip
title={items.board}
placement="top"
className="labelOne cardLabelEllips"
>
<Button>{items.board}</Button>
</Tooltip>
) : (
<Tooltip
title={
Array.isArray(items?.se_boards) && items.se_boards.length > 0
? items.se_boards.join(", ")
: ""
}
placement="top"
className="labelOne cardLabelEllips"
>
<Button>
{Array.isArray(items?.se_boards) && items.se_boards.length > 0
? `${items.se_boards[0]}${items.se_boards.length > 1
? ` + ${items.se_boards.length - 1}`
: ""
}`
: ""}
</Button>
</Tooltip>
)}
{(items.gradeLevel || items.se_gradeLevels) && (
<Tooltip
title={
Array.isArray(items?.gradeLevel) &&
items.gradeLevel.length > 1
? items.gradeLevel.join(", ")
: items.gradeLevel?.[0] ||
: ""}
</Button>
</Tooltip>
)}
{(items.gradeLevel || items.se_gradeLevels) && (
<Tooltip
title={
Array.isArray(items?.gradeLevel) &&
items.gradeLevel.length > 1
? items.gradeLevel.join(", ")
: items.gradeLevel?.[0] ||
(Array.isArray(items?.se_gradeLevels) &&
items.se_gradeLevels.length > 1
items.se_gradeLevels.length > 1
? items.se_gradeLevels.join(", ")
: items.se_gradeLevels?.[0] || "")
}
placement="top"
className="labeltwo cardLabelEllips"
>
<Button>
{Array.isArray(items?.gradeLevel) &&
items.gradeLevel.length === 1
? items.gradeLevel[0]
: (Array.isArray(items?.gradeLevel) &&
`${items.gradeLevel[0]} + ${
items.gradeLevel.length - 1
}
placement="top"
className="labeltwo cardLabelEllips"
>
<Button>
{Array.isArray(items?.gradeLevel) &&
items.gradeLevel.length === 1
? items.gradeLevel[0]
: (Array.isArray(items?.gradeLevel) &&
`${items.gradeLevel[0]} + ${items.gradeLevel.length - 1
}`) ||
(Array.isArray(items?.se_gradeLevels) &&
items.se_gradeLevels.length === 1)
? items.se_gradeLevels[0]
: `${items.se_gradeLevels[0]} + ${
items.se_gradeLevels.length - 1
}`}
</Button>
</Tooltip>
)}
</Box>
</>
)}
(Array.isArray(items?.se_gradeLevels) &&
items.se_gradeLevels.length === 1)
? items.se_gradeLevels[0]
: `${items.se_gradeLevels[0]} + ${items.se_gradeLevels.length - 1
}`}
</Button>
</Tooltip>
)}
</Box>
</>
)}
</Card>
);
}

0 comments on commit 6c43fbd

Please sign in to comment.