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

559148: fixed container component #1255

Merged
merged 1 commit into from
Dec 6, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface ComponentProps {
params: ComponentParams;
}

export const Default = (props: ComponentProps): JSX.Element => {
const DefaultContainer = (props: ComponentProps): JSX.Element => {
const { sitecoreContext } = useSitecoreContext();
const containerStyles = props.params && props.params.Styles ? props.params.Styles : '';
const styles = `${props.params.GridParameters} ${containerStyles}`.trimEnd();
Expand All @@ -37,14 +37,26 @@ export const Default = (props: ComponentProps): JSX.Element => {
}

return (
<div className="container-wrapper" id={id ? id : undefined}>
<div className={`component container ${styles}`}>
<div className="component-content" style={backgroundStyle}>
<div className="row">
<Placeholder name={phKey} rendering={props.rendering} />
</div>
<div className={`component container-default ${styles}`} id={id ? id : undefined}>
<div className="component-content" style={backgroundStyle}>
<div className="row">
<Placeholder name={phKey} rendering={props.rendering} />
</div>
</div>
</div>
);
}

export const Default = (props: ComponentProps): JSX.Element => {
const splitStyles = props.params?.Styles?.split(" ");;

if (splitStyles && splitStyles.includes('container')) {
return (
<div className="container-wrapper">
<DefaultContainer {...props} />
</div>
);
}

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