Skip to content

Commit

Permalink
Merge pull request #108 from ethersphere/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
martink635 authored Jan 29, 2024
2 parents 4060d2e + e886c11 commit 9b71979
Show file tree
Hide file tree
Showing 9 changed files with 772 additions and 248 deletions.
47 changes: 38 additions & 9 deletions components/sections/Connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Container } from "@/components/common";
import content from "../../data/connect.json";
import GridContainer from "../common/GridContainer";
import Newsletter from "../Newsletter";
import Link from "next/link";

type ConnectProps = {
events: {
Expand Down Expand Up @@ -70,18 +71,46 @@ type EventLinkProps = {
add_to_calendar?: string;
};

const EventLink: React.FC<EventLinkProps> = ({ href = "", title }) => {
const EventLink: React.FC<EventLinkProps> = ({
href = "",
title,
add_to_calendar = "",
}) => {
return (
<div className="">
{href && href.length > 0 ? (
<a
href={href}
target="_blank"
rel="noreferrer"
className="text-sm font-semibold text-[#F6F7F9] transition hover:text-opacity-70"
>
{title}
</a>
<div className="flex items-center gap-4">
<a
href={href}
target="_blank"
rel="noreferrer"
className="text-sm font-semibold text-[#F6F7F9] transition hover:text-opacity-70"
>
{title}
</a>

{add_to_calendar.length > 0 && (
<Link href={add_to_calendar} target="_blank">
<span className="sr-only">Add to calendar</span>
<svg
className="w-4 h-4 hover:opacity-70"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 17 16"
>
<g fill="#F6F7F9" clipPath="url(#a)">
<path d="M8.467 14h-6V6h12v2h2V4a1 1 0 0 0-1-1h-2V1a1 1 0 0 0-2 0v2h-6V1a1 1 0 0 0-2 0v2h-2a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h7v-2Z" />
<path d="M15.967 12h-1.5v-1.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5V12h-1.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1.5v1.5a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5V14h1.5a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5Z" />
</g>
<defs>
<clipPath id="a">
<path fill="#fff" d="M.467 0h16v16h-16z" />
</clipPath>
</defs>
</svg>
</Link>
)}
</div>
) : (
<span className="font-medium md:text-lg ">{title}</span>
)}
Expand Down
9 changes: 7 additions & 2 deletions components/sections/EventPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { useState } from "react";
import { cx } from "utils";

type EventPopupType = {
image: {
image?: {
src: string;
alt: string;
};
cta: {
href: string;
title: string;
};
title: string;
title?: string;
content?: string;
};

Expand All @@ -33,6 +33,11 @@ const EventPopup = ({ image, title, content, cta }: EventPopupType) => {
return null;
}

// if image, title are null, return null
if (!image || !title) {
return null;
}

return (
<RegularLink
href={cta.href}
Expand Down
2 changes: 1 addition & 1 deletion content/pages/why.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sections:
type: default
title: Book of Swarm ->
background: orange
href: "https://www.ethswarm.org/The-Book-of-Swarm.pdf"
href: "https://papers.ethswarm.org/p/book-of-swarm/"
- template: cta
arrow: true
type: default
Expand Down
5 changes: 0 additions & 5 deletions data/pages/index.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"event": {
"title": "Community Call",
"content": "Swarm Foundations monthly community call on January 25.",
"cta": {
"href": "https://www.addevent.com/event/iH19625610",
"title": "Add to Calendar ->"
},
"image": {
"src": "/assets/event-community_call-jan.png",
"alt": ""
}
},
"hero": {
Expand Down
10 changes: 10 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ const nextConfig = {
},
],
},
async redirects() {
return [
// Basic redirect
{
source: "/The-Book-of-Swarm.pdf",
destination: "https://papers.ethswarm.org/p/book-of-swarm/",
permanent: false,
},
];
},
};

module.exports = nextConfig;
Loading

1 comment on commit 9b71979

@vercel
Copy link

@vercel vercel bot commented on 9b71979 Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.