fix: Integration icons should load from CDN if available

This commit is contained in:
Tom Moor
2021-12-14 16:14:50 -08:00
parent 632799fea6
commit 1e3f3ff047

View File

@@ -1,6 +1,7 @@
import * as React from "react"; import * as React from "react";
import { EmbedDescriptor } from "rich-markdown-editor/dist/types"; import { EmbedDescriptor } from "rich-markdown-editor/dist/types";
import styled from "styled-components"; import styled from "styled-components";
import { cdnPath } from "@shared/utils/urls";
import Abstract from "./Abstract"; import Abstract from "./Abstract";
import Airtable from "./Airtable"; import Airtable from "./Airtable";
import Bilibili from "./Bilibili"; import Bilibili from "./Bilibili";
@@ -72,14 +73,14 @@ const embeds: EmbedDescriptor[] = [
title: "Abstract", title: "Abstract",
keywords: "design", keywords: "design",
defaultHidden: true, defaultHidden: true,
icon: () => <Img src="/images/abstract.png" alt="Abstract" />, icon: () => <Img src={cdnPath("/images/abstract.png")} alt="Abstract" />,
component: Abstract, component: Abstract,
matcher: matcher(Abstract), matcher: matcher(Abstract),
}, },
{ {
title: "Airtable", title: "Airtable",
keywords: "spreadsheet", keywords: "spreadsheet",
icon: () => <Img src="/images/airtable.png" alt="Airtable" />, icon: () => <Img src={cdnPath("/images/airtable.png")} alt="Airtable" />,
component: Airtable, component: Airtable,
matcher: matcher(Airtable), matcher: matcher(Airtable),
}, },
@@ -87,7 +88,7 @@ const embeds: EmbedDescriptor[] = [
title: "Bilibili", title: "Bilibili",
keywords: "video", keywords: "video",
defaultHidden: true, defaultHidden: true,
icon: () => <Img src="/images/bilibili.png" alt="Bilibili" />, icon: () => <Img src={cdnPath("/images/bilibili.png")} alt="Bilibili" />,
component: Bilibili, component: Bilibili,
matcher: matcher(Bilibili), matcher: matcher(Bilibili),
}, },
@@ -95,98 +96,112 @@ const embeds: EmbedDescriptor[] = [
title: "Cawemo", title: "Cawemo",
keywords: "bpmn process", keywords: "bpmn process",
defaultHidden: true, defaultHidden: true,
icon: () => <Img src="/images/cawemo.png" alt="Cawemo" />, icon: () => <Img src={cdnPath("/images/cawemo.png")} alt="Cawemo" />,
component: Cawemo, component: Cawemo,
matcher: matcher(Cawemo), matcher: matcher(Cawemo),
}, },
{ {
title: "ClickUp", title: "ClickUp",
keywords: "project", keywords: "project",
icon: () => <Img src="/images/clickup.png" alt="ClickUp" />, icon: () => <Img src={cdnPath("/images/clickup.png")} alt="ClickUp" />,
component: ClickUp, component: ClickUp,
matcher: matcher(ClickUp), matcher: matcher(ClickUp),
}, },
{ {
title: "Codepen", title: "Codepen",
keywords: "code editor", keywords: "code editor",
icon: () => <Img src="/images/codepen.png" alt="Codepen" />, icon: () => <Img src={cdnPath("/images/codepen.png")} alt="Codepen" />,
component: Codepen, component: Codepen,
matcher: matcher(Codepen), matcher: matcher(Codepen),
}, },
{ {
title: "Descript", title: "Descript",
keywords: "audio", keywords: "audio",
icon: () => <Img src="/images/descript.png" alt="Descript" />, icon: () => <Img src={cdnPath("/images/descript.png")} alt="Descript" />,
component: Descript, component: Descript,
matcher: matcher(Descript), matcher: matcher(Descript),
}, },
{ {
title: "Figma", title: "Figma",
keywords: "design svg vector", keywords: "design svg vector",
icon: () => <Img src="/images/figma.png" alt="Figma" />, icon: () => <Img src={cdnPath("/images/figma.png")} alt="Figma" />,
component: Figma, component: Figma,
matcher: matcher(Figma), matcher: matcher(Figma),
}, },
{ {
title: "Framer", title: "Framer",
keywords: "design prototyping", keywords: "design prototyping",
icon: () => <Img src="/images/framer.png" alt="Framer" />, icon: () => <Img src={cdnPath("/images/framer.png")} alt="Framer" />,
component: Framer, component: Framer,
matcher: matcher(Framer), matcher: matcher(Framer),
}, },
{ {
title: "GitHub Gist", title: "GitHub Gist",
keywords: "code", keywords: "code",
icon: () => <Img src="/images/github-gist.png" alt="GitHub" />, icon: () => <Img src={cdnPath("/images/github-gist.png")} alt="GitHub" />,
component: Gist, component: Gist,
matcher: matcher(Gist), matcher: matcher(Gist),
}, },
{ {
title: "Diagrams.net", title: "Diagrams.net",
keywords: "diagrams drawio", keywords: "diagrams drawio",
icon: () => <Img src="/images/diagrams.png" alt="Diagrams.net" />, icon: () => (
<Img src={cdnPath("/images/diagrams.png")} alt="Diagrams.net" />
),
component: Diagrams, component: Diagrams,
matcher: matcher(Diagrams), matcher: matcher(Diagrams),
}, },
{ {
title: "Google Drawings", title: "Google Drawings",
keywords: "drawings", keywords: "drawings",
icon: () => <Img src="/images/google-drawings.png" alt="Google Drawings" />, icon: () => (
<Img src={cdnPath("/images/google-drawings.png")} alt="Google Drawings" />
),
component: GoogleDrawings, component: GoogleDrawings,
matcher: matcher(GoogleDrawings), matcher: matcher(GoogleDrawings),
}, },
{ {
title: "Google Drive", title: "Google Drive",
keywords: "drive", keywords: "drive",
icon: () => <Img src="/images/google-drive.png" alt="Google Drive" />, icon: () => (
<Img src={cdnPath("/images/google-drive.png")} alt="Google Drive" />
),
component: GoogleDrive, component: GoogleDrive,
matcher: matcher(GoogleDrive), matcher: matcher(GoogleDrive),
}, },
{ {
title: "Google Docs", title: "Google Docs",
keywords: "documents word", keywords: "documents word",
icon: () => <Img src="/images/google-docs.png" alt="Google Docs" />, icon: () => (
<Img src={cdnPath("/images/google-docs.png")} alt="Google Docs" />
),
component: GoogleDocs, component: GoogleDocs,
matcher: matcher(GoogleDocs), matcher: matcher(GoogleDocs),
}, },
{ {
title: "Google Sheets", title: "Google Sheets",
keywords: "excel spreadsheet", keywords: "excel spreadsheet",
icon: () => <Img src="/images/google-sheets.png" alt="Google Sheets" />, icon: () => (
<Img src={cdnPath("/images/google-sheets.png")} alt="Google Sheets" />
),
component: GoogleSheets, component: GoogleSheets,
matcher: matcher(GoogleSheets), matcher: matcher(GoogleSheets),
}, },
{ {
title: "Google Slides", title: "Google Slides",
keywords: "presentation slideshow", keywords: "presentation slideshow",
icon: () => <Img src="/images/google-slides.png" alt="Google Slides" />, icon: () => (
<Img src={cdnPath("/images/google-slides.png")} alt="Google Slides" />
),
component: GoogleSlides, component: GoogleSlides,
matcher: matcher(GoogleSlides), matcher: matcher(GoogleSlides),
}, },
{ {
title: "Google Calendar", title: "Google Calendar",
keywords: "calendar", keywords: "calendar",
icon: () => <Img src="/images/google-calendar.png" alt="Google Calendar" />, icon: () => (
<Img src={cdnPath("/images/google-calendar.png")} alt="Google Calendar" />
),
component: GoogleCalendar, component: GoogleCalendar,
matcher: matcher(GoogleCalendar), matcher: matcher(GoogleCalendar),
}, },
@@ -194,7 +209,10 @@ const embeds: EmbedDescriptor[] = [
title: "Google Data Studio", title: "Google Data Studio",
keywords: "bi business intelligence", keywords: "bi business intelligence",
icon: () => ( icon: () => (
<Img src="/images/google-datastudio.png" alt="Google Data Studio" /> <Img
src={cdnPath("/images/google-datastudio.png")}
alt="Google Data Studio"
/>
), ),
component: GoogleDataStudio, component: GoogleDataStudio,
matcher: matcher(GoogleDataStudio), matcher: matcher(GoogleDataStudio),
@@ -203,42 +221,46 @@ const embeds: EmbedDescriptor[] = [
title: "InVision", title: "InVision",
keywords: "design prototype", keywords: "design prototype",
defaultHidden: true, defaultHidden: true,
icon: () => <Img src="/images/invision.png" alt="InVision" />, icon: () => <Img src={cdnPath("/images/invision.png")} alt="InVision" />,
component: InVision, component: InVision,
matcher: matcher(InVision), matcher: matcher(InVision),
}, },
{ {
title: "Loom", title: "Loom",
keywords: "video screencast", keywords: "video screencast",
icon: () => <Img src="/images/loom.png" alt="Loom" />, icon: () => <Img src={cdnPath("/images/loom.png")} alt="Loom" />,
component: Loom, component: Loom,
matcher: matcher(Loom), matcher: matcher(Loom),
}, },
{ {
title: "Lucidchart", title: "Lucidchart",
keywords: "chart", keywords: "chart",
icon: () => <Img src="/images/lucidchart.png" alt="Lucidchart" />, icon: () => (
<Img src={cdnPath("/images/lucidchart.png")} alt="Lucidchart" />
),
component: Lucidchart, component: Lucidchart,
matcher: matcher(Lucidchart), matcher: matcher(Lucidchart),
}, },
{ {
title: "Marvel", title: "Marvel",
keywords: "design prototype", keywords: "design prototype",
icon: () => <Img src="/images/marvel.png" alt="Marvel" />, icon: () => <Img src={cdnPath("/images/marvel.png")} alt="Marvel" />,
component: Marvel, component: Marvel,
matcher: matcher(Marvel), matcher: matcher(Marvel),
}, },
{ {
title: "Mindmeister", title: "Mindmeister",
keywords: "mindmap", keywords: "mindmap",
icon: () => <Img src="/images/mindmeister.png" alt="Mindmeister" />, icon: () => (
<Img src={cdnPath("/images/mindmeister.png")} alt="Mindmeister" />
),
component: Mindmeister, component: Mindmeister,
matcher: matcher(Mindmeister), matcher: matcher(Mindmeister),
}, },
{ {
title: "Miro", title: "Miro",
keywords: "whiteboard", keywords: "whiteboard",
icon: () => <Img src="/images/miro.png" alt="Miro" />, icon: () => <Img src={cdnPath("/images/miro.png")} alt="Miro" />,
component: Miro, component: Miro,
matcher: matcher(Miro), matcher: matcher(Miro),
}, },
@@ -246,7 +268,7 @@ const embeds: EmbedDescriptor[] = [
title: "Mode", title: "Mode",
keywords: "analytics", keywords: "analytics",
defaultHidden: true, defaultHidden: true,
icon: () => <Img src="/images/mode-analytics.png" alt="Mode" />, icon: () => <Img src={cdnPath("/images/mode-analytics.png")} alt="Mode" />,
component: ModeAnalytics, component: ModeAnalytics,
matcher: matcher(ModeAnalytics), matcher: matcher(ModeAnalytics),
}, },
@@ -254,56 +276,56 @@ const embeds: EmbedDescriptor[] = [
title: "Pitch", title: "Pitch",
keywords: "presentation", keywords: "presentation",
defaultHidden: true, defaultHidden: true,
icon: () => <Img src="/images/pitch.png" alt="Pitch" />, icon: () => <Img src={cdnPath("/images/pitch.png")} alt="Pitch" />,
component: Pitch, component: Pitch,
matcher: matcher(Pitch), matcher: matcher(Pitch),
}, },
{ {
title: "Prezi", title: "Prezi",
keywords: "presentation", keywords: "presentation",
icon: () => <Img src="/images/prezi.png" alt="Prezi" />, icon: () => <Img src={cdnPath("/images/prezi.png")} alt="Prezi" />,
component: Prezi, component: Prezi,
matcher: matcher(Prezi), matcher: matcher(Prezi),
}, },
{ {
title: "Spotify", title: "Spotify",
keywords: "music", keywords: "music",
icon: () => <Img src="/images/spotify.png" alt="Spotify" />, icon: () => <Img src={cdnPath("/images/spotify.png")} alt="Spotify" />,
component: Spotify, component: Spotify,
matcher: matcher(Spotify), matcher: matcher(Spotify),
}, },
{ {
title: "Trello", title: "Trello",
keywords: "kanban", keywords: "kanban",
icon: () => <Img src="/images/trello.png" alt="Trello" />, icon: () => <Img src={cdnPath("/images/trello.png")} alt="Trello" />,
component: Trello, component: Trello,
matcher: matcher(Trello), matcher: matcher(Trello),
}, },
{ {
title: "Typeform", title: "Typeform",
keywords: "form survey", keywords: "form survey",
icon: () => <Img src="/images/typeform.png" alt="Typeform" />, icon: () => <Img src={cdnPath("/images/typeform.png")} alt="Typeform" />,
component: Typeform, component: Typeform,
matcher: matcher(Typeform), matcher: matcher(Typeform),
}, },
{ {
title: "Vimeo", title: "Vimeo",
keywords: "video", keywords: "video",
icon: () => <Img src="/images/vimeo.png" alt="Vimeo" />, icon: () => <Img src={cdnPath("/images/vimeo.png")} alt="Vimeo" />,
component: Vimeo, component: Vimeo,
matcher: matcher(Vimeo), matcher: matcher(Vimeo),
}, },
{ {
title: "Whimsical", title: "Whimsical",
keywords: "whiteboard", keywords: "whiteboard",
icon: () => <Img src="/images/whimsical.png" alt="Whimsical" />, icon: () => <Img src={cdnPath("/images/whimsical.png")} alt="Whimsical" />,
component: Whimsical, component: Whimsical,
matcher: matcher(Whimsical), matcher: matcher(Whimsical),
}, },
{ {
title: "YouTube", title: "YouTube",
keywords: "google video", keywords: "google video",
icon: () => <Img src="/images/youtube.png" alt="YouTube" />, icon: () => <Img src={cdnPath("/images/youtube.png")} alt="YouTube" />,
component: YouTube, component: YouTube,
matcher: matcher(YouTube), matcher: matcher(YouTube),
}, },