Skip to content

Commit

Permalink
feat(mwpw-140454): saving work
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheridan Sunier committed May 8, 2024
1 parent dddf7d7 commit 62a461b
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 33 deletions.
2 changes: 1 addition & 1 deletion dist/app.css

Large diffs are not rendered by default.

50 changes: 33 additions & 17 deletions dist/main.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/main.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/main.source.js

Large diffs are not rendered by default.

47 changes: 42 additions & 5 deletions less/components/consonant/cards/icon.less
Original file line number Diff line number Diff line change
@@ -1,16 +1,53 @@
.consonant-CardsGrid {
.consonant-Card.icon-card {
height: auto;
min-height: 222px;

.consonant-Card-content {
padding: 16px 16px 20px;
}

.consonant-Card-row {
display: flex;
flex-direction: row;
margin-bottom: 16px;
.consonant-Card-header {
flex-grow: 1;
position: relative;
width: 100%;
padding: 16px 0 0 16px;
height: 64px;
max-height: 64px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
background-image: none !important;
}

.consonant-Card-logo {
display: block;
width: 48px;
height: 48px;
overflow: hidden;
background-size: cover;
background-position: center center;
border-radius: 4px;

.no-font;

img {
width: 48px;
height: 48px;
object-fit: cover;
user-select: none;
}
}

.consonant-Card-label {
display: none;
max-width: 100%;
margin-bottom: 4px;

.font(@color: @consonantGray800);

text-decoration: none;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

.consonant-Card-title {
Expand Down
21 changes: 18 additions & 3 deletions react/src/js/components/Consonant/Cards/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ const Card = (props) => {
backgroundImage: image,
backgroundAltText: altText,
mnemonic,
cardIcon,
icon: cardIcon,
iconAlt,
},
contentArea: {
title,
Expand Down Expand Up @@ -265,7 +266,7 @@ const Card = (props) => {
const isIcon = cardStyle === 'icon-card';

// Card elements to show
const showHeader = !isProduct || !isIcon;
const showHeader = !isProduct;
const showBadge = isOneHalf || isThreeFourths || isFull;
const showLogo = isOneHalf || isThreeFourths || isFull || isText;
const showLabel = !isProduct && !isText;
Expand Down Expand Up @@ -379,6 +380,21 @@ const Card = (props) => {
width="32" />
</div>
}
{isIcon &&
<div
style={({
backgroundColor: logoBg,
borderColor: logoBorderBg,
})}
data-testid="consonant-Card-logo"
className="consonant-Card-logo">
<img
src={cardIcon}
alt={iconAlt}
loading="lazy"
width="32" />
</div>
}
</div>
}
<div
Expand Down Expand Up @@ -409,7 +425,6 @@ const Card = (props) => {
className="consonant-Card-title"
title={title}>
{isProduct && mnemonic && <img src={mnemonic} alt="mnemonic" loading="lazy" />}
{isIcon && cardIcon && <img src={cardIcon} alt="icon" loading="lazy" />}
{title}
</p>
{
Expand Down

0 comments on commit 62a461b

Please sign in to comment.