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

weekly promotion of develop to main #690

Merged
merged 8 commits into from
Mar 7, 2024
17 changes: 9 additions & 8 deletions src/AI/Agent/AgentCreate.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
const { typeMatch } = VM.require("devhub.near/widget/core.lib.struct");

if (!typeMatch) {
return <p>Loading modules...</p>;
}

const { data, onSubmit, onCancel } = props;
const onSubmitDefault = (formValues) => {
const { name, ...rest } = formValues;
Expand Down Expand Up @@ -77,7 +71,7 @@ const AgentInputsPartialSchema = {
// },
component: {
inputProps: {
min: 2,
min: 0,
max: 255,
placeholder: "The component used to run the agent, default is near/widget/AI.Agent.AgentChat",
required: false,
Expand Down Expand Up @@ -121,7 +115,14 @@ const AgentInputsPartialSchema = {
};

const agentInputsValidator = (formValues) =>
typeMatch(formValues) && Object.values(formValues).every((value) => typeof value === "string" && value.length > 0);
formValues !== null &&
typeof formValues === "object" &&
!Array.isArray(formValues) &&
Object.keys(AgentInputsPartialSchema).every((key) => {
const val = AgentInputsPartialSchema[key];
const required = val?.inputProps?.required;
return !required || typeof formValues[key] === "string";
});

return (
<Widget
Expand Down
3 changes: 3 additions & 0 deletions src/AI/Agent/AgentHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ class CreateParticles {
document.addEventListener( 'mousedown', this.onMouseDown.bind( this ));
document.addEventListener( 'mousemove', this.onMouseMove.bind( this ));
document.addEventListener( 'mouseup', this.onMouseUp.bind( this ));
document.addEventListener( 'touchstart', this.onMouseDown.bind( this ));
document.addEventListener( 'touchmove', this.onMouseMove.bind( this ));
document.addEventListener( 'touchend', this.onMouseUp.bind( this ));
}

onMouseDown(){
Expand Down
129 changes: 77 additions & 52 deletions src/Events/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,11 @@ const IconCircle = styled.div`
}
`;

const featuredEvent = [...eventsList].sort(
(a, b) => Math.abs(new Date(a.event.start_at) - new Date()) - Math.abs(new Date(b.event.start_at) - new Date()),
)[0].event;
const featuredEvent =
eventsList.length > 0 &&
[...eventsList].sort(
(a, b) => Math.abs(new Date(a.event.start_at) - new Date()) - Math.abs(new Date(b.event.start_at) - new Date()),
)[0].event;

return (
<Wrapper>
Expand All @@ -226,32 +228,34 @@ return (
</Container>
</Section>

<Section backgroundColor="#fff" style={{ padding: "72px 24px" }}>
<Container>
<Flex direction="column" gap="80px" mobileGap="40px">
<Text size="text-3xl" mobileSize="text-2xl" fontWeight="500">
Upcoming Event
</Text>
</Flex>
{featuredEvent && (
<Section backgroundColor="#fff" style={{ padding: "72px 24px" }}>
<Container>
<Flex direction="column" gap="80px" mobileGap="40px">
<Text size="text-3xl" mobileSize="text-2xl" fontWeight="500">
Upcoming Event
</Text>
</Flex>

<Widget
src="${REPL_ACCOUNT}/widget/Events.CardLarge"
props={{
as: "a",
href: featuredEvent.url,
imgSrc: featuredEvent.cover_url,
title: featuredEvent.name,
description: featuredEvent.description,
date: { startAt: convertData(featuredEvent.start_at), endAt: convertData(featuredEvent.end_at) },
location: formatLocation(featuredEvent?.geo_address_json),
target: "_blank",
rel: "noopener noreferrer",
loading: !dataLoaded,
variant: "large",
}}
/>
</Container>
</Section>
<Widget
src="${REPL_ACCOUNT}/widget/Events.CardLarge"
props={{
as: "a",
href: featuredEvent.url,
imgSrc: featuredEvent.cover_url,
title: featuredEvent.name,
description: featuredEvent.description,
date: { startAt: convertData(featuredEvent.start_at), endAt: convertData(featuredEvent.end_at) },
location: formatLocation(featuredEvent?.geo_address_json),
target: "_blank",
rel: "noopener noreferrer",
loading: !dataLoaded,
variant: "large",
}}
/>
</Container>
</Section>
)}

<Section backgroundColor="#fff" style={{ padding: "72px 24px" }}>
<Container>
Expand All @@ -273,30 +277,51 @@ return (
)}
</Flex>

<Grid columns="1fr 1fr 1fr" gap="20px">
{eventsList.map(({ event }) => {
const startAt = convertData(event?.start_at);
const endAt = convertData(event?.end_at);
const location = formatLocation(event.geo_address_json);
return (
<Widget
src="${REPL_ACCOUNT}/widget/Events.Card"
key={event.api_id}
props={{
as: "a",
href: event.url,
imgSrc: event.cover_url,
title: event.name,
date: { startAt, endAt },
location,
target: "_blank",
rel: "noopener noreferrer",
loading: !dataLoaded,
}}
/>
);
})}
</Grid>
{eventsList.length > 0 ? (
<Grid columns="1fr 1fr 1fr" gap="20px">
{eventsList.map(({ event }) => {
const startAt = convertData(event?.start_at);
const endAt = convertData(event?.end_at);
const location = formatLocation(event.geo_address_json);
return (
<Widget
src="${REPL_ACCOUNT}/widget/Events.Card"
key={event.api_id}
props={{
as: "a",
href: event.url,
imgSrc: event.cover_url,
title: event.name,
date: { startAt, endAt },
location,
target: "_blank",
rel: "noopener noreferrer",
loading: !dataLoaded,
}}
/>
);
})}
</Grid>
) : (
<Flex direction="column" gap="24px" alignItems="center">
<Text size="text-2xl" mobileSize="text-lg" style={{ textAlign: "center" }}>
There are no upcoming events at the moment.
</Text>
<Text size="text-xl" mobileSize="text-lg" style={{ maxWidth: "808px", textAlign: "center" }}>
Subscribe to our Luma calendar to stay up to date with our events.
</Text>
<Widget
src="${REPL_ACCOUNT}/widget/DIG.Button"
props={{
label: "Subscribe",
variant: "primary",
size: "large",
href: "https://lu.ma/NEAR-community",
target: "_blank",
}}
/>
</Flex>
)}
</Container>
</Section>

Expand Down
1 change: 1 addition & 0 deletions src/NearOrg/CookieDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const firstPartyCookies = `| Identifer | Purpose |
| rl_session | product analytics | Rudderstack | .near.org | [Link](https://cookiedatabase.org/?lang=en&s=rl_session) | 1 year | Stores the session-related information including the ID. |
| rl_page_init_referring_domain | product analytics | Rudderstack | .near.org | [Link](https://cookiedatabase.org/?lang=en&s=rl_page_init_referring_domain) | 1 year | to store referring website. |
| rl_page_init_referrer | product analytics | Rudderstack | .near.org | [Link](https://cookiedatabase.org/?lang=en&s=rl_page_init_referrer) | 1 year | to store referring website. |
| user-country-code | product analytics | Discovery Domain | .near.org | n/a | 1 year | to store a visitor's country code |
`;

const thirdPartyCookies = `| Identifer | Purpose | Provider | Domain | Duration |
Expand Down
2 changes: 1 addition & 1 deletion src/NearOrg/CookiePrompt.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if (state.cookieAcceptance) {
const onAccept = ({ all, onlyRequired }) => {
State.update({ cookieAcceptance: true });
State.update({ isDialogOpen: false });
return <AnalyticsCookieConsent all onlyRequired />;
return <AnalyticsCookieConsent all={all} onlyRequired={onlyRequired} />;
};

const onCustomize = () => {
Expand Down
97 changes: 61 additions & 36 deletions src/NearOrg/FoundersPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const Pattern = styled.div`
`;

const PatternContent = styled.div`
padding: 1rem;
padding: 2rem 4rem;
max-width: 496px;
margin: 0 auto;
background-color: var(--background-color);
Expand Down Expand Up @@ -148,8 +148,19 @@ const IconCircle = styled.div`
`;

const TextLink = styled("Link")`
color: inherit;
text-decoration: underline;
font: var(--text-base);
font-weight: 600;
line-height: 150%;
color: var(--white);
background: transparent;
text-decoration: none;
padding: 16px 24px;
border-radius: 50px;
border: 1px solid var(--green10);

&:hover {
text-decoration: none;
}
`;

const Resource = ({ name, description, icon, url, target }) => (
Expand Down Expand Up @@ -231,13 +242,19 @@ const ecosystemCommunityResources = [
},
];

function returnIpfsImage(cfid) {
return {
ipfs_cid: cfid,
};
}

return (
<Wrapper>
<Section backgroundColor="#00EC97" style={{ padding: "72px 0" }}>
<Container center>
<Pattern>
<PatternContent>
<Flex gap="32px" direction="column" alignItems="center">
<Flex direction="column" alignItems="center">
<H1>FounderHub</H1>
</Flex>
</PatternContent>
Expand All @@ -246,8 +263,8 @@ return (
</Section>

<Section backgroundColor="#ffffff">
<Container>
<Flex direction="column" gap="24px">
<Container center>
<Flex direction="column" gap="24px" alignItems="center">
<H2>Welcome to NEAR, the best place to build Web3 projects</H2>
<Text size="text-2xl" mobileSize="text-l" style={{ maxWidth: "808px" }}>
From idea to launch, the NEAR FounderHub guides you every step of the way. Get the tailored resources,
Expand All @@ -260,60 +277,75 @@ return (
<Container>
<Flex direction="column" gap="24px">
<H2>Self-Serve Resources</H2>
<Text size="text-2xl" mobileSize="text-l" style={{ maxWidth: "808px" }}>
Tap into our curated resources: proven templates, expert insights, and a vibrant founder network.
</Text>
</Flex>
<Grid columns="1fr 1fr 1fr" gap="24px">
{selfServeResources.map((item) => (
<Resource key={`resource-${item.name}`} {...item} />
))}
</Grid>
<Flex direction="column" gap="24px">
<Text size="text-2xl" mobileSize="text-l" style={{ maxWidth: "808px" }}>
Tap into our curated resources: proven templates, expert insights, and a vibrant founder network.
</Text>
</Flex>
</Container>
</Section>

<Section backgroundColor="#ffffff">
<Container>
<Flex direction="column" gap="24px">
<H2>Ecosystem Community Resources</H2>
<Text size="text-2xl" mobileSize="text-l" style={{ maxWidth: "808px" }}>
Find your place within the ecosystem — your community is near.
</Text>
</Flex>
<Grid columns="1fr 1fr 1fr" gap="24px">
{ecosystemCommunityResources.map((item) => (
<Resource key={`resource-${item.name}`} {...item} />
))}
</Grid>
<Flex direction="column" gap="24px">
<Text size="text-2xl" mobileSize="text-l" style={{ maxWidth: "808px" }}>
Find your place within the ecosystem: whether it&apos;s by joining our selective accelerator program,
getting involved with our builder groups or hanging out at a live event, your community is near.
</Text>
</Flex>
</Container>
</Section>

<Section backgroundColor="#161615">
<Container>
<Flex direction="column" gap="24px">
<H2 style={{ color: "var(--white)", maxWidth: "600px" }}>Accelerate your Web3 journey</H2>
<Text size="text-2xl" mobileSize="text-l" color="white" style={{ maxWidth: "808px" }}>
HZN3 applications are{" "}
<TextLink href="https://www.hzn.xyz/hzn" target="_blank">
open.
</TextLink>
Over 50 projects have been accelerated through HZN, our equity-free accelerator and gone on to raise over
$10M in external capital. Get the equity-free education, mentorship, and a network to take your project to
the next level.
</Text>
<H2 style={{ color: "var(--white)" }}>Accelerate your Web3 journey</H2>
</Flex>

<Widget
src="${REPL_ACCOUNT}/widget/NearOrg.ContentWithImage"
props={{
content: (
<Flex direction="column" gap="32px">
<Text size="text-xl" mobileSize="text-l" fontWeight="500" color="white">
HZN3 applications are open
</Text>
<Text color="white" style={{ maxWidth: "496px" }}>
Over 50 projects have been accelerated through HZN, our equity-free accelerator and gone on to raise
over $10M in external capital. Get the equity-free education, mentorship, and a network to take your
project to the next level.
</Text>
<Flex>
<TextLink href="https://www.hzn.xyz/hzn" target="_blank">
Apply Now
</TextLink>
</Flex>
</Flex>
),
image: returnIpfsImage("bafkreib55qq67nbthwpkzqx2upjnecwnrutpo3q26zjqt3wz3n5iw4o6da"),
imageSide: "left",
alt: "The HZN logo.",
}}
/>
</Container>
</Section>
<Section backgroundColor="#F2F1EA">
<Section backgroundColor="#00EC97">
<Container>
<Flex direction="column" gap="24px" alignItems="center">
<Text size="text-3xl" fontWeight="500" style={{ maxWidth: "808px", textAlign: "center" }}>
Get in touch with us to provide any feedback or ask for specific support
Get in touch
</Text>
<Text size="text-xl" style={{ maxWidth: "658px", textAlign: "center" }}>
Reach out to us to provide your feedback or to ask for specific support.
</Text>

<Widget
Expand All @@ -329,13 +361,6 @@ return (
</Container>
</Section>

<Widget
src="${REPL_ACCOUNT}/widget/NearOrg.BosCtaSection"
props={{
backgroundColor: "#00EC97",
}}
/>

<Widget src="${REPL_ACCOUNT}/widget/NearOrg.Footer" />
</Wrapper>
);
Loading