Skip to content

Commit

Permalink
add hero background
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlanglen committed Oct 24, 2023
1 parent 7ec22d8 commit 0243e82
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 70 deletions.
8 changes: 4 additions & 4 deletions apps/potlock/widget/Components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const headerTitleFontSizePx = 88;
const HeaderContainer = styled.div`
width: 100%;
// background: #fffaf4;
background: white;
// background: white;
padding: 80px 64px;
`;

Expand Down Expand Up @@ -47,9 +47,10 @@ const ButtonsContainer = styled.div`
margin-top: 32px;
`;

const containerStyle = props.containerStyle ?? {};

return (
// <Theme>
<HeaderContainer>
<HeaderContainer style={containerStyle}>
<HeaderContent>
<HeaderTitle>
{props.title1}
Expand Down Expand Up @@ -84,5 +85,4 @@ return (
{props.buttonSecondary && props.buttonSecondary}
</ButtonsContainer>
</HeaderContainer>
// </Theme>
);
3 changes: 3 additions & 0 deletions apps/potlock/widget/Project/Create.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ return (
description:
"Lorem ipsum dolor sit amet consectetur. Vel sit nunc in nunc. Viverra arcu eu sed consequat.",
centered: false,
containerStyle: {
background: "#FEF6EE",
},
}}
/>
<Widget src={`${ownerId}/widget/Project.CreateForm`} />
Expand Down
87 changes: 56 additions & 31 deletions apps/potlock/widget/Project/ListPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const DEFAULT_BANNER_IMAGE_URL =
IPFS_BASE_URL + "bafkreih4i6kftb34wpdzcuvgafozxz6tk6u4f5kcr2gwvtvxikvwriteci";
const DEFAULT_PROFILE_IMAGE_URL =
IPFS_BASE_URL + "bafkreibwq2ucyui3wmkyowtzau6txgbsp6zizy4l2s5hkymsyv6tc75j3u";
const HERO_BACKGROUND_IMAGE_URL =
IPFS_BASE_URL + "bafkreiewg5afxbkvo6jbn6jgv7zm4mtoys22jut65fldqtt7wagar4wbga";

const getImageUrlFromSocialImage = (image) => {
if (image.url) {
Expand Down Expand Up @@ -66,6 +68,18 @@ const ProjectsContainer = styled.div`
// background: #fafafa;
`;

const HeroContainer = styled.div`
width: 100%;
height: 700px;
position: relative;
`;

const Hero = styled.img`
width: 100%;
height: 100%;
display: block;
`;

State.init({
registeredProjects: null, // TODO: change this back to null
// registeredProjects: sampleProjects,
Expand Down Expand Up @@ -121,37 +135,48 @@ if (!state.registeredProjects) return "";

return (
<>
<Widget
src={`${ownerId}/widget/Components.Header`}
props={{
title1: "Transforming",
title2: "Funding for Public Goods",
description:
"Lorem ipsum dolor sit amet consectetur. Vel sit nunc in nunc. Viverra arcu eu sed consequat.",
centered: true,
buttonPrimary: (
<Widget
src={`${ownerId}/widget/Buttons.ActionButton`}
props={{
type: "primary",
text: "Explore projects",
disabled: false,
}}
/>
),
buttonSecondary: (
<Widget
src={`${ownerId}/widget/Buttons.NavigationButton`}
props={{
type: "secondary",
text: "Create project",
disabled: false,
href: `?tab=createproject`,
}}
/>
),
}}
/>
<HeroContainer>
<Hero src={HERO_BACKGROUND_IMAGE_URL} alt="hero" />
<Widget
src={`${ownerId}/widget/Components.Header`}
props={{
title1: "Transforming",
title2: "Funding for Public Goods",
description:
"Lorem ipsum dolor sit amet consectetur. Vel sit nunc in nunc. Viverra arcu eu sed consequat.",
centered: true,
containerStyle: {
position: "absolute",
height: "100%",
top: 0,
left: 0,
background:
"radial-gradient(80% 80% at 40.82% 50%, white 25%, rgba(255, 255, 255, 0) 100%)",
},
buttonPrimary: (
<Widget
src={`${ownerId}/widget/Buttons.ActionButton`}
props={{
type: "primary",
text: "Explore projects",
disabled: false,
}}
/>
),
buttonSecondary: (
<Widget
src={`${ownerId}/widget/Buttons.NavigationButton`}
props={{
type: "secondary",
text: "Create project",
disabled: false,
href: `?tab=createproject`,
}}
/>
),
}}
/>
</HeroContainer>
<ProjectsContainer>
<SectionHeader>
<SectionTitle>All projects</SectionTitle>
Expand Down
8 changes: 4 additions & 4 deletions build/potlock/src/Components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const headerTitleFontSizePx = 88;
const HeaderContainer = styled.div`
width: 100%;
// background: #fffaf4;
background: white;
// background: white;
padding: 80px 64px;
`;

Expand Down Expand Up @@ -47,9 +47,10 @@ const ButtonsContainer = styled.div`
margin-top: 32px;
`;

const containerStyle = props.containerStyle ?? {};

return (
// <Theme>
<HeaderContainer>
<HeaderContainer style={containerStyle}>
<HeaderContent>
<HeaderTitle>
{props.title1}
Expand Down Expand Up @@ -84,5 +85,4 @@ return (
{props.buttonSecondary && props.buttonSecondary}
</ButtonsContainer>
</HeaderContainer>
// </Theme>
);
3 changes: 3 additions & 0 deletions build/potlock/src/Project/Create.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ return (
description:
"Lorem ipsum dolor sit amet consectetur. Vel sit nunc in nunc. Viverra arcu eu sed consequat.",
centered: false,
containerStyle: {
background: "#FEF6EE",
},
}}
/>
<Widget src={`${ownerId}/widget/Project.CreateForm`} />
Expand Down
87 changes: 56 additions & 31 deletions build/potlock/src/Project/ListPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const DEFAULT_BANNER_IMAGE_URL =
IPFS_BASE_URL + "bafkreih4i6kftb34wpdzcuvgafozxz6tk6u4f5kcr2gwvtvxikvwriteci";
const DEFAULT_PROFILE_IMAGE_URL =
IPFS_BASE_URL + "bafkreibwq2ucyui3wmkyowtzau6txgbsp6zizy4l2s5hkymsyv6tc75j3u";
const HERO_BACKGROUND_IMAGE_URL =
IPFS_BASE_URL + "bafkreiewg5afxbkvo6jbn6jgv7zm4mtoys22jut65fldqtt7wagar4wbga";

const getImageUrlFromSocialImage = (image) => {
if (image.url) {
Expand Down Expand Up @@ -66,6 +68,18 @@ const ProjectsContainer = styled.div`
// background: #fafafa;
`;

const HeroContainer = styled.div`
width: 100%;
height: 700px;
position: relative;
`;

const Hero = styled.img`
width: 100%;
height: 100%;
display: block;
`;

State.init({
registeredProjects: null, // TODO: change this back to null
// registeredProjects: sampleProjects,
Expand Down Expand Up @@ -121,37 +135,48 @@ if (!state.registeredProjects) return "";

return (
<>
<Widget
src={`${ownerId}/widget/Components.Header`}
props={{
title1: "Transforming",
title2: "Funding for Public Goods",
description:
"Lorem ipsum dolor sit amet consectetur. Vel sit nunc in nunc. Viverra arcu eu sed consequat.",
centered: true,
buttonPrimary: (
<Widget
src={`${ownerId}/widget/Buttons.ActionButton`}
props={{
type: "primary",
text: "Explore projects",
disabled: false,
}}
/>
),
buttonSecondary: (
<Widget
src={`${ownerId}/widget/Buttons.NavigationButton`}
props={{
type: "secondary",
text: "Create project",
disabled: false,
href: `?tab=createproject`,
}}
/>
),
}}
/>
<HeroContainer>
<Hero src={HERO_BACKGROUND_IMAGE_URL} alt="hero" />
<Widget
src={`${ownerId}/widget/Components.Header`}
props={{
title1: "Transforming",
title2: "Funding for Public Goods",
description:
"Lorem ipsum dolor sit amet consectetur. Vel sit nunc in nunc. Viverra arcu eu sed consequat.",
centered: true,
containerStyle: {
position: "absolute",
height: "100%",
top: 0,
left: 0,
background:
"radial-gradient(80% 80% at 40.82% 50%, white 25%, rgba(255, 255, 255, 0) 100%)",
},
buttonPrimary: (
<Widget
src={`${ownerId}/widget/Buttons.ActionButton`}
props={{
type: "primary",
text: "Explore projects",
disabled: false,
}}
/>
),
buttonSecondary: (
<Widget
src={`${ownerId}/widget/Buttons.NavigationButton`}
props={{
type: "secondary",
text: "Create project",
disabled: false,
href: `?tab=createproject`,
}}
/>
),
}}
/>
</HeroContainer>
<ProjectsContainer>
<SectionHeader>
<SectionTitle>All projects</SectionTitle>
Expand Down

0 comments on commit 0243e82

Please sign in to comment.