From 4e0b4daa5b3335982ec3f345f4518e751d9bb992 Mon Sep 17 00:00:00 2001 From: Aminejv Date: Mon, 16 Jan 2023 11:58:53 +0100 Subject: [PATCH] chore(pages): use Constants.gateways.ipfs for hardcoded ipfs links --- components/core/WebsitePrototypeWrapper.js | 4 ++-- components/sidebars/SidebarSingleSlateSettings.js | 3 --- pages/_/file.js | 3 +-- pages/about.js | 3 +-- pages/faqs.js | 3 +-- pages/get-slate.js | 3 +-- pages/guide/browser-control.js | 2 +- pages/guide/file.js | 6 ++---- pages/guide/new-tab.js | 5 +---- pages/guide/save.js | 2 +- pages/guide/search.js | 2 +- pages/guide/space.js | 3 ++- pages/index.js | 3 +-- 13 files changed, 15 insertions(+), 27 deletions(-) diff --git a/components/core/WebsitePrototypeWrapper.js b/components/core/WebsitePrototypeWrapper.js index e1c13872..8e28e63c 100644 --- a/components/core/WebsitePrototypeWrapper.js +++ b/components/core/WebsitePrototypeWrapper.js @@ -1,11 +1,11 @@ import * as React from "react"; +import * as Constants from "~/common/constants"; import Head from "next/head"; export default class WebsitePrototypeWrapper extends React.Component { static defaultProps = { - image: - "https://slate.textile.io/ipfs/bafybeihtmqpx2lnlvaerfhq5imi2y3jzuf4jqspmmqbth3ebim4ebc2lqy", + image: `${Constants.gateways.ipfs}/bafybeihtmqpx2lnlvaerfhq5imi2y3jzuf4jqspmmqbth3ebim4ebc2lqy`, title: "Slate", url: "https://slate.host/_", description: diff --git a/components/sidebars/SidebarSingleSlateSettings.js b/components/sidebars/SidebarSingleSlateSettings.js index 62577333..8d8be496 100644 --- a/components/sidebars/SidebarSingleSlateSettings.js +++ b/components/sidebars/SidebarSingleSlateSettings.js @@ -12,9 +12,6 @@ import { RadioGroup } from "~/components/system/components/RadioGroup"; import { css } from "@emotion/react"; import { ConfirmationModal } from "~/components/core/ConfirmationModal"; -const DEFAULT_IMAGE = - "https://slate.textile.io/ipfs/bafkreiaow45dlq5xaydaeqocdxvffudibrzh2c6qandpqkb6t3ahbvh6re"; - const STYLES_HEADER = css` font-family: ${Constants.font.semiBold}; `; diff --git a/pages/_/file.js b/pages/_/file.js index 717d8738..580d5931 100644 --- a/pages/_/file.js +++ b/pages/_/file.js @@ -12,8 +12,7 @@ import WebsitePrototypeHeader from "~/components/core/WebsitePrototypeHeader"; import WebsitePrototypeFooter from "~/components/core/WebsitePrototypeFooter"; import CTATransition from "~/components/core/CTATransition"; -const DEFAULT_IMAGE = - "https://slate.textile.io/ipfs/bafkreiaow45dlq5xaydaeqocdxvffudibrzh2c6qandpqkb6t3ahbvh6re"; +const DEFAULT_IMAGE = `${Constants.gateways.ipfs}/bafkreiaow45dlq5xaydaeqocdxvffudibrzh2c6qandpqkb6t3ahbvh6re`; export const getServerSideProps = async (context) => { return { diff --git a/pages/about.js b/pages/about.js index ea0af8c0..59d10e1f 100644 --- a/pages/about.js +++ b/pages/about.js @@ -98,8 +98,7 @@ export default function AboutUsPage() { const title = `About Us - Slate`; const description = "Your personal search engine"; const url = "https://slate.host/about"; - const image = - "https://slate.textile.io/ipfs/bafkreifww37ypduoi5pvj2cuikz7iycp7l5h7czke6lcboukkaqkoab3t4"; + const image = `${Constants.gateways.ipfs}/bafkreifww37ypduoi5pvj2cuikz7iycp7l5h7czke6lcboukkaqkoab3t4`; return ( diff --git a/pages/faqs.js b/pages/faqs.js index 6309aaa0..fb7dc9fc 100644 --- a/pages/faqs.js +++ b/pages/faqs.js @@ -87,8 +87,7 @@ export default function FAQPage() { const title = `FAQs - Slate`; const description = "Your personal search engine"; const url = "https://slate.host/faqs"; - const image = - "https://slate.textile.io/ipfs/bafkreifww37ypduoi5pvj2cuikz7iycp7l5h7czke6lcboukkaqkoab3t4"; + const image = `${Constants.gateways.ipfs}/bafkreifww37ypduoi5pvj2cuikz7iycp7l5h7czke6lcboukkaqkoab3t4`; return ( diff --git a/pages/get-slate.js b/pages/get-slate.js index f267ba44..534c460e 100644 --- a/pages/get-slate.js +++ b/pages/get-slate.js @@ -186,8 +186,7 @@ export default function InstallPage() { const title = `Install Slate for Chrome - Slate`; const description = "Install Slate from Chrome web store"; const url = "https://slate.host/get-slate"; - const image = - "https://slate.textile.io/ipfs/bafkreifww37ypduoi5pvj2cuikz7iycp7l5h7czke6lcboukkaqkoab3t4"; + const image = `${Constants.gateways.ipfs}/bafkreifww37ypduoi5pvj2cuikz7iycp7l5h7czke6lcboukkaqkoab3t4`; const next = "/_/data"; const prev = "../guide/new-tab"; diff --git a/pages/guide/browser-control.js b/pages/guide/browser-control.js index 3fbd1613..a358c4c5 100644 --- a/pages/guide/browser-control.js +++ b/pages/guide/browser-control.js @@ -50,7 +50,7 @@ export default function BrowserControlGuidePage() { title="Browser Control Guide - Slate" description="Your personal search engine" url="https://slate.host/guide/browser-control" - image="https://slate.textile.io/ipfs/bafkreifww37ypduoi5pvj2cuikz7iycp7l5h7czke6lcboukkaqkoab3t4" + image={`${Constants.gateways.ipfs}/bafkreifww37ypduoi5pvj2cuikz7iycp7l5h7czke6lcboukkaqkoab3t4`} heading="Built for your browser" body="Our Chrome extension gives you seamless control of your tabs with powerful tools to help you manage and keep track of things." next="save" diff --git a/pages/guide/file.js b/pages/guide/file.js index a6a132ff..c37363ba 100644 --- a/pages/guide/file.js +++ b/pages/guide/file.js @@ -5,8 +5,6 @@ import * as JumperPrototype from "~/components/landing/jumperPrototype"; import Guide from "~/pages/guide/guide.js"; -import { css } from "@emotion/react"; - const VIEWS_ACTIONS = [{ label: "Current Window" }, { label: "All Open" }, { label: "Recent" }]; const CUSTOM_VIEWS_ACTIONS = [{ label: "Files" }]; @@ -65,7 +63,7 @@ export default function FileGuidePage() { title="File Guide - Slate" description="Your personal search engine" url="https://slate.host/guide/file" - image="https://slate.textile.io/ipfs/bafkreifww37ypduoi5pvj2cuikz7iycp7l5h7czke6lcboukkaqkoab3t4" + image={`${Constants.gateways.ipfs}/bafkreifww37ypduoi5pvj2cuikz7iycp7l5h7czke6lcboukkaqkoab3t4`} heading="Integrated storage for your files" body="Save text, images, and files from the web or upload them directly to Slate to create your personal archive." next="space" @@ -73,7 +71,7 @@ export default function FileGuidePage() { jumper={
- {VIEWS_ACTIONS.map((action, i) => ( + {VIEWS_ACTIONS.map((action) => ( {action.label} diff --git a/pages/guide/new-tab.js b/pages/guide/new-tab.js index 58391afc..338a8628 100644 --- a/pages/guide/new-tab.js +++ b/pages/guide/new-tab.js @@ -1,18 +1,15 @@ import * as React from "react"; import * as Constants from "~/common/constants"; -import * as SVG from "~/common/svg"; import Guide from "~/pages/guide/guide.js"; -import { css } from "@emotion/react"; - export default function NewTabGuidePage() { return (