The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Make <Background /> component responsive (#4767)
Ady Beraud990f9aeff479
diff --git a/packages/twenty-website/src/app/_components/contributors/AvatarGrid.tsx b/packages/twenty-website/src/app/_components/contributors/AvatarGrid.tsxindex 436f7bd1da5..4f98abf43dc 100644--- a/packages/twenty-website/src/app/_components/contributors/AvatarGrid.tsx+++ b/packages/twenty-website/src/app/_components/contributors/AvatarGrid.tsx@@ -26,6 +26,7 @@ const AvatarItem = styled.div`border-radius: 16px;overflow: hidden;transition: 200ms;+ background-color: white;&:hover {-webkit-box-shadow: -6px 6px 0px 1px rgba(0, 0, 0, 1);diff --git a/packages/twenty-website/src/app/_components/oss-friends/Background.tsx b/packages/twenty-website/src/app/_components/oss-friends/Background.tsxindex f97b976d481..06f472f4877 100644--- a/packages/twenty-website/src/app/_components/oss-friends/Background.tsx+++ b/packages/twenty-website/src/app/_components/oss-friends/Background.tsx@@ -1,44 +1,100 @@'use client';-+import React from 'react';import styled from '@emotion/styled';-const BackgroundContainer = styled.div`+const BACKGROUND_ROTATION = -5;++const BACKGROUND_IMAGE_URL =+ 'https://framerusercontent.com/images/nqEmdwe7yDXNsOZovuxG5zvj2E.png';++const BackgroundImage = styled.div`position: absolute;- top: 100%;- left: 0px;- width: 100%;- height: 100%;- max-height: 200%;- background-image: url(https://framerusercontent.com/images/nqEmdwe7yDXNsOZovuxG5zvj2E.png);+ height: calc(100% - 350px);+ width: 200%;+ top: 250px;+ overflow: visible;+ z-index: -3;+ background-image: url(${BACKGROUND_IMAGE_URL});+ transform: rotate(${BACKGROUND_ROTATION}deg);background-size: auto 20px;background-repeat: repeat;transform-origin: center center;- z-index: -2;++ @media (max-width: 1024px) {+ transform: rotate(-1deg);+ top: 100px;+ height: 100%;+ }`;-const Gradient = styled.div`- position: absolute;- width: 100%;+const Container = styled.div`+ position: relative;+ display: flex;+ align-items: center;+ justify-content: center;height: 100%;- max-height: 200%;- top: 100%;- left: 0;- right: 0;- bottom: 0;- background: linear-gradient(- 185deg,- #fff 8.33%,- rgba(255, 255, 255, 0.08) 48.95%,- #fff 92.18%- );- z-index: -1;+ width: 100%;+ overflow: hidden;+ min-width: 100vw;+ max-width: 100vw;+ z-index: 0;++ &::before {+ content: '';+ position: absolute;+ top: 150px;+ left: 0;+ height: 300px;+ width: 200%;+ background: linear-gradient(+ to bottom,+ rgba(255, 255, 255, 1),+ rgba(255, 255, 255, 0)+ );+ transform: rotate(${BACKGROUND_ROTATION}deg);+ z-index: -2;+ pointer-events: none;++ @media (max-width: 1024px) {+ height: 200px;+ top: 50px;+ transform: rotate(-1deg);+ }+ }++ &::after {+ content: '';+ position: absolute;+ bottom: 140px;+ left: -20px;+ height: 300px;+ width: 220%;+ background: linear-gradient(+ to top,+ rgba(255, 255, 255, 1),+ rgba(255, 255, 255, 0)+ );+ transform: rotate(${BACKGROUND_ROTATION}deg);+ z-index: -2;+ pointer-events: none;++ @media (max-width: 1024px) {+ height: 200px;+ transform: rotate(-1deg);+ bottom: 0px;+ }+ }`;-export const Background = () => {+type BackgroundProps = {+ children: React.ReactNode;+};++export const Background = ({ children }: BackgroundProps) => {return (- <>- <BackgroundContainer />- <Gradient />- </>+ <Container>+ {children}+ <BackgroundImage />+ </Container>);};diff --git a/packages/twenty-website/src/app/contributors/[slug]/page.tsx b/packages/twenty-website/src/app/contributors/[slug]/page.tsxindex 0a916fc5455..549333552ab 100644--- a/packages/twenty-website/src/app/contributors/[slug]/page.tsx+++ b/packages/twenty-website/src/app/contributors/[slug]/page.tsx@@ -100,8 +100,7 @@ export default async function ({ params }: { params: { slug: string } }) {.sort((a, b) => new Date(a.day).getTime() - new Date(b.day).getTime());return (- <>- <Background />+ <Background><ContentContainer><Breadcrumb active={contributor.id} /><ProfileCard@@ -129,6 +128,6 @@ export default async function ({ params }: { params: { slug: string } }) {/><ThankYou username={contributor.id} /></ContentContainer>- </>+ </Background>);}diff --git a/packages/twenty-website/src/app/contributors/page.tsx b/packages/twenty-website/src/app/contributors/page.tsxindex 8e553d330e2..deb8803f449 100644--- a/packages/twenty-website/src/app/contributors/page.tsx+++ b/packages/twenty-website/src/app/contributors/page.tsx@@ -43,13 +43,12 @@ const Contributors = async () => {.filter((contributor) => contributor.pullRequestCount > 0);return (- <>- <Background />+ <Background><ContentContainer><Header /><AvatarGrid users={fitlerContributors as Contributor[]} /></ContentContainer>- </>+ </Background>);};diff --git a/packages/twenty-website/src/app/oss-friends/page.tsx b/packages/twenty-website/src/app/oss-friends/page.tsxindex 9b2f9b45374..ec8d930e962 100644--- a/packages/twenty-website/src/app/oss-friends/page.tsx+++ b/packages/twenty-website/src/app/oss-friends/page.tsx@@ -10,8 +10,7 @@ export default async function OssFriends() {const listJson = await ossList.json();return (- <>- <Background />+ <Background><ContentContainer><Header /><CardContainer>@@ -20,6 +19,6 @@ export default async function OssFriends() {))}</CardContainer></ContentContainer>- </>+ </Background>);}