diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000000..7219ee2b423 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,16 @@ +name: Deploy to Netlify +on: + issues: + types: [opened, deleted, closed, reopened, labeled, unlabeled] + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Trigger deploy on Netlify + run: | + curl -X POST "https://api.netlify.com/api/v1/sites/$NETLIFY_SITE_ID/builds" -H "Authorization: Bearer $NETLIFY_AUTH_TOKEN" + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} diff --git a/.gitignore b/.gitignore index 77643b78a52..237b63453f7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ node_modules .next config/posts.json +.env.local +roadmap.json \ No newline at end of file diff --git a/components/InlineHelp.js b/components/InlineHelp.js new file mode 100644 index 00000000000..f052041f30b --- /dev/null +++ b/components/InlineHelp.js @@ -0,0 +1,27 @@ +import { useState, useEffect } from "react" +import QuestionMark from './icons/QuestionMark' +import { registerClickAway } from './helpers/click-away' + +export default function InlineHelp({ + className = 'lg:relative inline-block', + text, +}) { + const [isHelpVisible, setIsHelpVisible] = useState(false) + + useEffect(() => { + if (isHelpVisible) registerClickAway(() => { + setIsHelpVisible(false) + }) + }, [isHelpVisible]) + + return ( +
+ { + isHelpVisible && ( +
{text}
+ ) + } + setIsHelpVisible(!isHelpVisible)} onMouseEnter={() => setIsHelpVisible(true)} onMouseLeave={() => setIsHelpVisible(false)} /> +
+ ) +} \ No newline at end of file diff --git a/components/Warning.js b/components/Warning.js index 77ee47135fe..c7b54e730c2 100644 --- a/components/Warning.js +++ b/components/Warning.js @@ -2,16 +2,16 @@ import IconExclamation from "./icons/Exclamation"; export default function Warning({ className = '', title, description }) { return ( -
-
-
+
+
+
-
-

+
+

{title}

-
+

{description}

diff --git a/components/helpers/click-away.js b/components/helpers/click-away.js index b7661aea06a..a63266ac496 100644 --- a/components/helpers/click-away.js +++ b/components/helpers/click-away.js @@ -3,7 +3,8 @@ export function registerClickAway(callback) { document.addEventListener("click", unregisterClickAway) document.querySelectorAll('iframe').forEach(iframe => { - if (iframe.attributes.src.value.startsWith('/') && !iframe.attributes.src.value.startsWith('//')) { + const src = iframe.attributes.src + if (src && src.value.startsWith('/') && !src.value.startsWith('//')) { iframe.contentWindow.document.removeEventListener("click", unregisterClickAway) iframe.contentWindow.document.addEventListener("click", unregisterClickAway) } @@ -12,7 +13,8 @@ export function registerClickAway(callback) { function unregisterClickAway() { document.removeEventListener("click", unregisterClickAway) document.querySelectorAll('iframe').forEach(iframe => { - if (iframe.attributes.src.value.startsWith('/') && !iframe.attributes.src.value.startsWith('//')) { + const src = iframe.attributes.src + if (src && src.value.startsWith('/') && !src.value.startsWith('//')) { iframe.contentWindow.document.removeEventListener("click", unregisterClickAway) } }) diff --git a/components/icons/ArrowRight.js b/components/icons/ArrowRight.js index 3fbaa29546e..dc995cbc5c5 100644 --- a/components/icons/ArrowRight.js +++ b/components/icons/ArrowRight.js @@ -1,4 +1,4 @@ -export default function ArrowRight ({ className }) { +export default function IconArrowRight ({ className }) { return ( diff --git a/components/icons/Exclamation.js b/components/icons/Exclamation.js index 233b7339157..f0613e84214 100644 --- a/components/icons/Exclamation.js +++ b/components/icons/Exclamation.js @@ -1,6 +1,6 @@ export default function IconExclamation({ className = '' }) { return ( - + ) diff --git a/components/icons/QuestionMark.js b/components/icons/QuestionMark.js new file mode 100644 index 00000000000..3b185896a01 --- /dev/null +++ b/components/icons/QuestionMark.js @@ -0,0 +1,7 @@ +export default function QuestionMark({ className, ...props }) { + return ( + + + + ) +} \ No newline at end of file diff --git a/components/layout/DocsLayout.js b/components/layout/DocsLayout.js index cb01a445d15..7f23adf7213 100644 --- a/components/layout/DocsLayout.js +++ b/components/layout/DocsLayout.js @@ -40,7 +40,7 @@ export default function DocsLayout({ post, navItems = {}, children }) { ) } {/* */} -
+
@@ -57,17 +57,17 @@ export default function DocsLayout({ post, navItems = {}, children }) {
-
-
- +
+
+
-
+
{!showMenu && ( -
+
-