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

fix: resolve layout inconsistency in CTA_Bottom for mobile screens #5864

Merged
merged 1 commit into from
Sep 13, 2024
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
23 changes: 22 additions & 1 deletion src/components/Call-To-Actions/CTA_Bottom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ const CTA_BottomWrapper = styled.div`
border-radius: 0.5rem;
overflow: hidden;

@media (max-width: 507px) {
flex-direction: column;
height: auto;
}

.cta-content {
padding: 0.5rem 1.5rem;
text-align: center;
Expand All @@ -30,6 +35,11 @@ const CTA_BottomWrapper = styled.div`
p {
margin-top: 0.5rem;
}

@media (max-width: 507px) {
max-width: 100%;
margin-right: 0;
}
}

img {
Expand All @@ -39,10 +49,20 @@ const CTA_BottomWrapper = styled.div`
padding: 1rem;
max-height: 100%;
border-radius: 0 0.5rem 0.5rem 0;

@media (max-width: 507px) {
max-width: 100%;
padding: 0;
border-radius: 0;
}
}

button {
width: fit-content;

@media (max-width: 507px) {
margin-top: 1rem;
}
}
`;

Expand All @@ -53,6 +73,7 @@ const defaultURL = "https://slack.layer5.io";
const CTA_Bottom = ({ alt, button_text, category, content, external_link, image, url, heading, ...props }) => {
return (
<CTA_BottomWrapper {...props}>
<img src={category ? Categories[category]["Image"] : (image ? image : image_src)} alt={category ? Categories[category]["Image_Alt"] : (alt ? alt : "Alt Text")} />
<div className="cta-content">
{ category ? (
<>
Expand All @@ -67,7 +88,7 @@ const CTA_Bottom = ({ alt, button_text, category, content, external_link, image,
)}
<Button primary title={category ? Categories[category]["Button_Text"] : (button_text ? button_text : "Join Us")} url={category ? Categories[category]["Link"] : (url ? url : defaultURL)} external={category ? Categories[category]["Link_external"] : (external_link ? true : false)} />
</div>
<img src={category ? Categories[category]["Image"] : (image ? image : image_src)} alt={category ? Categories[category]["Image_Alt"] : (alt ? alt : "Alt Text")} />

</CTA_BottomWrapper>
);
};
Expand Down
Loading