Skip to content

Commit

Permalink
Merge pull request #325 from celestiaorg/feature/light-node-page
Browse files Browse the repository at this point in the history
Feature/light node page
  • Loading branch information
alex-beckett authored Dec 21, 2023
2 parents 4832c48 + 636fcba commit 48c671c
Show file tree
Hide file tree
Showing 31 changed files with 404 additions and 395 deletions.
58 changes: 34 additions & 24 deletions src/components/buttons/button.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
import * as React from "react"
import {Link} from "gatsby";
import * as React from "react";
import { Link } from "gatsby";
import { AnchorLink } from "gatsby-plugin-anchor-links";

export default class Button extends React.Component {
render() {
var buttonTitle = this.props.text
render() {
var buttonTitle = this.props.text;

if(this.props.class.includes('external') || this.props.class.includes('external-big')){
buttonTitle = this.props.text + '<i class="icon-external-link"></i>';
}
if(this.props.class === 'icon'){
buttonTitle = this.props.text + '<i class="icon-'+this.props.icon+'"></i>';
}
if (this.props.class.includes("external") || this.props.class.includes("external-big")) {
buttonTitle = this.props.text + '<i class="icon-external-link"></i>';
}
if (this.props.class === "icon") {
buttonTitle = this.props.text + '<i class="icon-' + this.props.icon + '"></i>';
}

if(this.props.type === 'internal'){
return <Link to={`${this.props.url}`} className={'button button-'+this.props.class} dangerouslySetInnerHTML={{__html: buttonTitle}}/>
}
else if(this.props.type === 'external' || this.props.type === 'external-big'){
return <a href={`${this.props.url}`} target={'_blank'} rel="noreferrer" className={'button button-'+this.props.class} aria-label={this.props.text} dangerouslySetInnerHTML={{__html: buttonTitle}}/>
}
else if(this.props.type === 'anchor'){
return (
<AnchorLink to={`${this.props.url}`} className={'button button-'+this.props.class}>
{buttonTitle}
</AnchorLink>
)
}
}
if (this.props.type === "internal") {
return (
<Link to={`${this.props.url}`} className={"button button-" + this.props.class} dangerouslySetInnerHTML={{ __html: buttonTitle }} />
);
} else if (this.props.type === "external" || this.props.type === "external-big") {
return (
<a
href={`${this.props.url}`}
target={"_blank"}
rel='noreferrer'
className={"button button-" + this.props.class}
aria-label={this.props.text}
dangerouslySetInnerHTML={{ __html: buttonTitle }}
/>
);
} else if (this.props.type === "anchor") {
let path = typeof window !== "undefined" ? window.location.pathname : "/";
return (
<AnchorLink to={`${path}#${this.props.url}`} className={"button button-" + this.props.class}>
{buttonTitle}
</AnchorLink>
);
}
}
}
1 change: 0 additions & 1 deletion src/components/footer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from "react";
import { Link } from "gatsby";
import addToMailchimp from "gatsby-plugin-mailchimp";
import { AnchorLink } from "gatsby-plugin-anchor-links";

// import FooterBox from "../components/footer-box";
import FooterBox2 from "../components/footer-box-2";
Expand Down
125 changes: 59 additions & 66 deletions src/components/modules/icon-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AnchorLink } from "gatsby-plugin-anchor-links";
export default function IconCard({ imageClass, content, variant, iconPosition = "top", className, btnClass = "" }) {
return (
<div className={className}>
<div className={`icon-card ${variant}`}>
<div className={`icon-card ${variant} d-flex flex-column h-100`}>
{content.image && (
<div className={`logo-container ${iconPosition} ${imageClass}`} data-image={content.image}>
<Image alt={content.title} filename={content.image} />
Expand All @@ -15,71 +15,64 @@ export default function IconCard({ imageClass, content, variant, iconPosition =
<div className='text-box'>
<div className={"title"}>{content.title}</div>
{content.text && <div className={"text"}>{content.text}</div>}
<div className='link-wrapper'>
{content.link && content.type === "internal" && (
<Button type={"internal"} class={"external " + btnClass} text={content.link.text} url={content.link.url} />
)}
{content.link && (content.type === "external" || content.type === undefined) && content.link.text !== "Coming Soon" && (
<Button type={"external"} class={"external " + btnClass} text={content.link.text} url={content.link.url} />
)}
{content.link && (content.type === "external" || content.type === undefined) && content.link.text === "Coming Soon" && (
<div className={"coming-soon"}>{content.link.text}</div>
)}
{content.link && content.type === "anchor" && (
<AnchorLink
className={`link ${btnClass}`}
to={`/developer-portal#${content.anchorToId ? content.anchorToId : content.title.replace(/\s+/g, "-").toLowerCase()}`}
stripHash
>
{content.link.text}
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'>
<path stroke='#7B2BF9' strokeLinecap='square' strokeWidth='1.5' d='M6.89106 1.34961L6.89106 11.9052' />
<path
stroke='#7B2BF9'
strokeLinecap='square'
strokeLinejoin='bevel'
strokeWidth='1.5'
d='M2 7.64941L7 12.6494L12 7.64942'
/>
</svg>
</AnchorLink>
)}
{content.links &&
content.links.map((link) => {
if (link.type === "internal") {
return <Button type={"internal"} class={"external " + btnClass} text={link.text} url={link.url} />;
} else if (link.type === "external" || link.type === undefined) {
return <Button type={"external"} class={"external " + btnClass} text={link.text} url={link.url} />;
} else if (link.type === "anchor") {
return (
<AnchorLink
className='link'
to={`/developer-portal#${
link.anchorToId ? link.anchorToId : link.title.replace(/\s+/g, "-").toLowerCase()
}`}
stripHash
>
{link.text}
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'>
<path
stroke='#7B2BF9'
strokeLinecap='square'
strokeWidth='1.5'
d='M6.89106 1.34961L6.89106 11.9052'
/>
<path
stroke='#7B2BF9'
strokeLinecap='square'
strokeLinejoin='bevel'
strokeWidth='1.5'
d='M2 7.64941L7 12.6494L12 7.64942'
/>
</svg>
</AnchorLink>
);
}
})}
</div>
</div>
<div className='link-wrapper'>
{content.link && content.type === "internal" && (
<Button type={"internal"} class={"external " + btnClass} text={content.link.text} url={content.link.url} />
)}
{content.link && (content.type === "external" || content.type === undefined) && content.link.text !== "Coming Soon" && (
<Button type={"external"} class={"external " + btnClass} text={content.link.text} url={content.link.url} />
)}
{content.link && (content.type === "external" || content.type === undefined) && content.link.text === "Coming Soon" && (
<div className={"coming-soon"}>{content.link.text}</div>
)}
{content.link && content.type === "anchor" && (
<AnchorLink
className={`link ${btnClass}`}
to={`/developer-portal#${content.anchorToId ? content.anchorToId : content.title.replace(/\s+/g, "-").toLowerCase()}`}
stripHash
>
{content.link.text}
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'>
<path stroke='#7B2BF9' strokeLinecap='square' strokeWidth='1.5' d='M6.89106 1.34961L6.89106 11.9052' />
<path
stroke='#7B2BF9'
strokeLinecap='square'
strokeLinejoin='bevel'
strokeWidth='1.5'
d='M2 7.64941L7 12.6494L12 7.64942'
/>
</svg>
</AnchorLink>
)}
{content.links &&
content.links.map((link) => {
if (link.type === "internal") {
return <Button type={"internal"} class={"external " + btnClass} text={link.text} url={link.url} />;
} else if (link.type === "external" || link.type === undefined) {
return <Button type={"external"} class={"external " + btnClass} text={link.text} url={link.url} />;
} else if (link.type === "anchor") {
return (
<AnchorLink
className='link'
to={`/developer-portal#${link.anchorToId ? link.anchorToId : link.title.replace(/\s+/g, "-").toLowerCase()}`}
stripHash
>
{link.text}
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'>
<path stroke='#7B2BF9' strokeLinecap='square' strokeWidth='1.5' d='M6.89106 1.34961L6.89106 11.9052' />
<path
stroke='#7B2BF9'
strokeLinecap='square'
strokeLinejoin='bevel'
strokeWidth='1.5'
d='M2 7.64941L7 12.6494L12 7.64942'
/>
</svg>
</AnchorLink>
);
}
})}
</div>
</div>
</div>
Expand Down
34 changes: 17 additions & 17 deletions src/datas/home/hero-section.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export const heroData = {
title: 'The first modular blockchain network',
text: 'Celestia is a modular data availability network that securely scales with the number of users, making it easy for anyone to launch their own blockchain.',
buttons:[
{
text: 'Build modular',
class: 'simple plausible-event-name=Build_Modular_Button--Homepage-Hero',
type: 'internal',
url: '/developer-portal/'
},
{
text: 'Explore',
class: 'white plausible-event-name=Explore_Button--Homepage-Hero',
type: 'anchor',
url: '/#explore-celestia'
}
]
}
title: "The first modular blockchain network",
text: "Celestia is a modular data availability network that securely scales with the number of users, making it easy for anyone to launch their own blockchain.",
buttons: [
{
text: "Build modular",
class: "simple plausible-event-name=Build_Modular_Button--Homepage-Hero",
type: "internal",
url: "/developer-portal/",
},
{
text: "Explore",
class: "white plausible-event-name=Explore_Button--Homepage-Hero",
type: "anchor",
url: "explore-celestia",
},
],
};
36 changes: 0 additions & 36 deletions src/datas/run-a-node/get-started.js

This file was deleted.

12 changes: 6 additions & 6 deletions src/datas/run-a-node/hero-data.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export const heroData = {
title: "Run a light node",
text: "Join the collective powering an open internet. Run a light node on Celestia to secure your assets and become sovereign.",
title: "Directly verify",
text: "Join the network or integrate the Celestia light node.",
buttons: [
{
text: "Show me how to start",
text: "Run a node",
class: "simple",
type: "anchor",
url: "start-up-a-node",
},
{
text: "Ask a question",
text: "Integrate",
class: "white",
type: "anchor",
url: "https://www.google.com/",
}
url: "integrate",
},
],
};
38 changes: 38 additions & 0 deletions src/datas/run-a-node/join-the-network.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export const joinTheNetwork = {
title: "Join the network",
items: [
{
id: 1,
title: "Beginner",
text: "Deploy a light node in two commands with Vimana’s on-demand hardware.",
type: "external",
image: "run-a-node/beginner-image.png",
link: {
text: "Deploy on Vimana",
url: "https://docs.vistara.dev/the-vistara-workflow/getting-started",
},
},
{
id: 2,
title: "Intermediate",
text: "Power up a light node in under 3 minutes with Docker.",
type: "external",
image: "run-a-node/intermediate-image.png",
link: {
text: "Follow the tutorial",
url: "https://docs.celestia.org/nodes/docker-images",
},
},
{
id: 3,
title: "Advanced",
text: "Start a light node with the command line.",
type: "external",
image: "run-a-node/advanced-image.png",
link: {
text: "Read the guide",
url: "https://docs.celestia.org/nodes/light-node",
},
},
],
};
45 changes: 45 additions & 0 deletions src/datas/run-a-node/light-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
export const lightNode = {
title: "Light nodes for developers",
button: {
text: "Start light node",
class: "simple",
type: "external",
url: "https://docs.celestia.org/nodes/light-node",
},
description: "How developers can use a Celestia light node for their chain",
items: [
{
id: 1,
title: "Publish data",
text: "Publish transaction data to Celestia’s DA network.",
type: "external",
image: "run-a-node/publish-image.png",
link: {
text: "Submit data to Celestia",
url: "https://docs.celestia.org/developers/node-tutorial",
},
},
{
id: 2,
title: "Retrieve data",
text: "Retrieve transaction data from Celestia’s DA network.",
type: "external",
image: "run-a-node/retrieve-image.png",
link: {
text: "Retrieve data from Celestia",
url: "https://docs.celestia.org/developers/node-tutorial#retrieving-data",
},
},
{
id: 3,
title: "Manage Tia wallet",
text: "Generate a Celestia wallet to store Tia and pay for publishing transaction data to Celestia.",
type: "external",
image: "run-a-node/manage-image.png",
link: {
text: "Setup wallet",
url: "https://docs.celestia.org/developers/celestia-node-key",
},
},
],
};
Loading

0 comments on commit 48c671c

Please sign in to comment.