Skip to content

Commit

Permalink
Add new background image for straight lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Breno committed Oct 14, 2024
1 parent 65dbe17 commit 82f2ceb
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 55 deletions.
51 changes: 20 additions & 31 deletions src/components/BackgroundImages/StraightLinesBackground.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,32 @@
import { graphql, useStaticQuery } from 'gatsby';
import React from 'react';
import clsx from 'clsx';
import { StaticImage } from 'gatsby-plugin-image';
import {
container,
backgroundImage,
swoopingLines,
} from './styles.module.less';

import BackgroundImage, {
IBackgroundImageProps,
} from 'gatsby-background-image';

import { commonBackgroundImageProps } from './utils';

type StraightLinesBackgroundProps = IBackgroundImageProps & {
type StraightLinesBackgroundProps = {
children?: React.ReactNode;
} & React.HTMLAttributes<HTMLDivElement>;

const StraightLinesBackground = ({
children,
...rest
className,
}: StraightLinesBackgroundProps) => {
const swoopingLines = useStaticQuery(graphql`
query {
imageData: file(
relativePath: { eq: "lp-connector/real-time/Vector.png" }
) {
childImageSharp {
fluid(quality: 90, maxWidth: 1356) {
...GatsbyImageSharpFluid_withWebp_noBase64
}
}
}
}
`);

return (
<BackgroundImage
fluid={swoopingLines.imageData.childImageSharp.fluid}
backgroundColor="#04192b"
{...commonBackgroundImageProps}
{...rest}
>
{children}
</BackgroundImage>
<div className={container}>
<StaticImage
alt=""
src="../../images/lp-connector/real-time/Vector.png"
className={clsx(backgroundImage, swoopingLines)}
placeholder="blurred"
quality={100}
backgroundColor="#04192b"
/>
<div className={className}>{children}</div>
</div>
);
};

Expand Down
1 change: 0 additions & 1 deletion src/components/BackgroundImages/styles.module.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import '../../globalStyles/sections.module.less';

.container {
.sectionTopBottomPadding;
position: relative;
}

Expand Down
4 changes: 0 additions & 4 deletions src/components/BackgroundImages/utils.ts

This file was deleted.

8 changes: 4 additions & 4 deletions src/components/BlogBanner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ interface BlogBanner {

const BlogBanner = ({ title, button }: BlogBanner) => {
return (
<StraightLinesBackground className={background}>
<div className={container}>
<div className={background}>
<StraightLinesBackground className={container}>
<div className={banner}>
{title}
<OutboundLinkFilled href={button.href} target="_blank">
{button.title}
</OutboundLinkFilled>
</div>
</div>
</StraightLinesBackground>
</StraightLinesBackground>
</div>
);
};

Expand Down
1 change: 0 additions & 1 deletion src/components/Connectors/styles.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
.container {
.globalMaxWidth;
.sectionTopBottomPadding;
padding-top: 0;
}

.connectorIndexHeader {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Homepage/SectionFive/styles.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import styled from 'styled-components';
import { globalMaxWidth } from '../../../globalStyles';
import { globalMaxWidth, sectionTopBottomPadding } from '../../../globalStyles';

export const Wrapper = styled.div`
${globalMaxWidth}
${sectionTopBottomPadding}
display: flex;
justify-content: center;
Expand Down
3 changes: 2 additions & 1 deletion src/components/Homepage/SectionNine/styles.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import styled from 'styled-components';
import { globalMaxWidth } from '../../../globalStyles';
import { globalMaxWidth, sectionTopBottomPadding } from '../../../globalStyles';

export const Wrapper = styled.div`
${globalMaxWidth}
${sectionTopBottomPadding}
h2 {
font-size: 2.5rem;
Expand Down
3 changes: 2 additions & 1 deletion src/components/Homepage/SectionSeven/styles.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import styled from 'styled-components';
import { globalMaxWidth } from '../../../globalStyles';
import { globalMaxWidth, sectionTopBottomPadding } from '../../../globalStyles';

export const Wrapper = styled.div`
${globalMaxWidth}
${sectionTopBottomPadding}
padding-right: 0;
display: flex;
Expand Down
7 changes: 6 additions & 1 deletion src/components/Homepage/SectionThree/styles.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import styled from 'styled-components';
import { LinkOutlined, globalMaxWidth } from '../../../globalStyles';
import {
LinkOutlined,
globalMaxWidth,
sectionTopBottomPadding,
} from '../../../globalStyles';

export const Wrapper = styled.div`
${globalMaxWidth}
${sectionTopBottomPadding}
display: flex;
flex-direction: column;
Expand Down
12 changes: 7 additions & 5 deletions src/templates/blog-post/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ import {
blogPostContent,
blogPostContentWrapper,
mainContent,
background,
bigBuildPipelineBannerContainer,
popularArticlesWrapper,
bigBuildPipelineBannerSection,
bigBuildPipelineBannerWrapper,
bigBuildPipelineBannerContainerLayout,
leftColumnContainer,
rightColumnContainer,
Expand Down Expand Up @@ -315,8 +315,10 @@ const BlogPostTemplate = ({ data: { post } }) => {
<PopularArticles />
</section>
<section className={bigBuildPipelineBannerSection}>
<StraightLinesBackground className={background}>
<div className={bigBuildPipelineBannerContainer}>
<div className={bigBuildPipelineBannerWrapper}>
<StraightLinesBackground
className={bigBuildPipelineBannerContainer}
>
<div
className={
bigBuildPipelineBannerContainerLayout
Expand Down Expand Up @@ -372,8 +374,8 @@ const BlogPostTemplate = ({ data: { post } }) => {
See Pricing
</OutboundLinkOutlined>
</div>
</div>
</StraightLinesBackground>
</StraightLinesBackground>
</div>
</section>
</article>
<BlogPostPopupModal />
Expand Down
5 changes: 4 additions & 1 deletion src/templates/blog-post/styles.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@

.blogPostHeaderWrapper {
.globalMaxWidth;
.sectionTopBottomPadding;

display: flex;
flex-direction: row;
Expand Down Expand Up @@ -337,12 +338,14 @@
}
}

.background {
.bigBuildPipelineBannerWrapper {
border-radius: 24px;
overflow: hidden;
}

.bigBuildPipelineBannerContainer {
border-radius: 24px;
overflow: hidden;
padding: 48px 90px;
max-width: 1356px;
margin-left: auto;
Expand Down
5 changes: 1 addition & 4 deletions src/templates/blog/styles.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
.sectionTopBottomPadding;
display: flex;
align-items: center;
padding-top: 0;

@media (max-width: 810px) {
flex-direction: column-reverse;
Expand Down Expand Up @@ -88,9 +87,7 @@

.blogsIndexBody {
.globalMaxWidth;

padding-top: 2rem;
display: grid;
.sectionTopBottomPadding;

padding-top: 2rem;
display: grid;
Expand Down

0 comments on commit 82f2ceb

Please sign in to comment.