Skip to content

Commit

Permalink
Added RV for Promo
Browse files Browse the repository at this point in the history
  • Loading branch information
SitecoreAdmin authored and SitecoreAdmin committed Jul 27, 2023
1 parent f0d8641 commit 302d7ca
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/sxastarter/src/components/Promo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import {
ImageField,
Field,
LinkField,
RichText,
} from '@sitecore-jss/sitecore-jss-nextjs';

interface Fields {
PromoIcon: ImageField;
PromoText: Field<string>;
PromoLink: LinkField;
PromoText2: Field<string>;
PromoText3: Field<string>;
}

type PromoProps = {
Expand Down Expand Up @@ -81,3 +83,29 @@ export const WithText = (props: PromoProps): JSX.Element => {

return <PromoDefaultComponent {...props} />;
};

//Promo RV
export const GetToKnow = (props: PromoProps): JSX.Element => {
const id = props.params.RenderingIdentifier;
if (props.fields) {
return (
<div className={`component promo ${props.params.styles}`} id={id ? id : undefined}>
<div className="component-content">
<section className="container section-inner-space">
<div className="row align-items-center row-cols-1 row-cols-md-2 gx-5 text-center text-md-start">
<div className="col">
<RichText className="mb-4" field={props?.fields?.PromoText} tag="h2" />
<RichText className="text-align-justify" field={props?.fields?.PromoText2} />
</div>
<div className="col ps-md-5">
<JssImage field={props.fields.PromoIcon} />
</div>
</div>
</section>
</div>
</div>
);
}

return <PromoDefaultComponent {...props} />;
};

0 comments on commit 302d7ca

Please sign in to comment.