Skip to content

Commit

Permalink
fix: revert card image height changed like bootstrap-italia templates
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini committed Nov 16, 2023
1 parent 836258a commit d331288
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const CardWithImageTemplate = (props) => {
) : (
<Card
className={cx('listing-item card-bg', {
'card-img': showImage,
'card-teaser-image card-flex no-after':
item['@type'] === 'Persona',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ const InEvidenceTemplate = (props) => {
key={index}
/>
) : (
<Card key={index} className={cx('listing-item card-bg')}>
<Card
key={index}
className={cx('listing-item card-bg', {
'card-img': index === 0 && image,
})}
>
{index === 0 && image && (
<div className="img-responsive-wrapper">
<div className="img-responsive">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ const CardWithImageTemplateSkeleton = ({
{[0, 1, 2, 3, 4, 5].map((i) => {
return (
<Col lg="4" key={i} className="col-item mb-3">
<Card className={cx('listing-item card-bg')}>
<Card
className={cx('listing-item card-bg', {
'card-img': i < 3,
})}
>
{/* wrapperClassName="card-overlapping" */}
{(i < 3 || always_show_image) && (
<div className="img-responsive-wrapper">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ const InEvidenceTemplateSkeleton = ({
<div className="in-evidence-cards-wrapper mb-5">
{[0, 1, 2, 3, 4].map((i) => {
return (
<Card key={i} className={cx('listing-item card-bg')}>
<Card
key={i}
className={cx('listing-item card-bg', {
'card-img': i === 0,
})}
>
{i === 0 && (
<div className="img-responsive-wrapper">
<div className="img-responsive">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const CardWithImageRssTemplate = ({
<Row>
{items.map((item) => (
<Col lg={3} className="mb-3" key={item['@id']}>
<Card className="card-bg" noWrapper={false} tag="div">
<Card className="card-bg card-img" noWrapper={false} tag="div">
{item.enclosure?.url && (
<div className="img-responsive-wrapper">
<div className="img-responsive img-responsive-panoramic">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const CardWithImageRssTemplateSkeleton = ({ isEditMode, data = {} }) => {
<Row>
{[0, 1, 2, 3, 4, 5, 6, 7].map((i) => (
<Col lg={3} className="mb-3" key={i}>
<Card noWrapper={false} tag="div">
<Card className="card-img" noWrapper={false} tag="div">
<div className="img-responsive-wrapper">
<div className="img-responsive img-responsive-panoramic">
<figure className="img-wrapper"></figure>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ItaliaTheme/View/Commons/GenericCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const GenericCard = ({

return item ? (
image ? (
<div className={cx('genericcard card shadow rounded mt-3')}>
<div className={cx('genericcard card card-img shadow rounded mt-3')}>
<div className="img-responsive-wrapper">
<div className="img-responsive img-responsive-panoramic">
<figure className="img-wrapper">{image}</figure>
Expand Down
6 changes: 6 additions & 0 deletions src/theme/ItaliaTheme/Blocks/_cardWithImageAndInEvidence.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
display: inline;
}

img.listing-image {
max-width: 100%;
height: auto;
object-position: center;
}

.img-responsive-wrapper {
width: inherit;
.img-responsive {
Expand Down
4 changes: 4 additions & 0 deletions src/theme/ItaliaTheme/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ a {
margin-right: unset;
}

.public-ui .text-secondary {
color: $secondary-text !important;
}

::selection {
background-color: default;
}
Expand Down
6 changes: 0 additions & 6 deletions src/theme/bootstrap-override/bootstrap-italia/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@
fill: $gray-secondary;
}
}
&.rounded {
.img-responsive-wrapper {
border-top-left-radius: $border-radius;
border-top-right-radius: $border-radius;
}
}
}

a.read-more {
Expand Down

0 comments on commit d331288

Please sign in to comment.