Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug #228502 - [webapp- content cards] Language font showing on content card is bigger than other values.PFA #809

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
);
}
Loading