From d39debb9d0498c63dc62af8272376efe161f5c0d Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Fri, 30 Sep 2022 12:15:21 -0400 Subject: [PATCH] Remove react-github-btn dependency --- website/package.json | 1 - website/src/components/github-button.js | 22 +++------------------- website/src/components/header.js | 11 ++--------- website/yarn.lock | 12 ------------ 4 files changed, 5 insertions(+), 41 deletions(-) diff --git a/website/package.json b/website/package.json index aeafdea8..ba3e1c6b 100644 --- a/website/package.json +++ b/website/package.json @@ -37,7 +37,6 @@ "prismjs": "^1.21.0", "react": "^17.0.1", "react-dom": "^17.0.1", - "react-github-btn": "^1.1.1", "react-helmet": "^6.0.0", "react-markdown": "^6.0.0", "smooth-scroll": "^16.1.2" diff --git a/website/src/components/github-button.js b/website/src/components/github-button.js index 10b92c2c..a68d1b12 100644 --- a/website/src/components/github-button.js +++ b/website/src/components/github-button.js @@ -1,30 +1,14 @@ import React, { PureComponent } from 'react'; class GitHubStarButton extends PureComponent { - async componentDidMount() { - const gitHubButtonModule = await import('github-buttons/dist/react'); - - this.GitHubButton = gitHubButtonModule.default; - - this.forceUpdate(); - } - render() { - const GitHubButton = this.GitHubButton; - - if (!GitHubButton) { - return null; - } - return ( - - Star - + Star SimpleCMS/simple-cms on GitHub + ); } } diff --git a/website/src/components/header.js b/website/src/components/header.js index c1170ae6..e998c6c7 100644 --- a/website/src/components/header.js +++ b/website/src/components/header.js @@ -2,8 +2,8 @@ import React, { useState, useEffect } from 'react'; import { Link, graphql, StaticQuery } from 'gatsby'; import styled from '@emotion/styled'; import { css } from '@emotion/core'; -import GitHubButton from 'react-github-btn'; +import GitHubStarButton from './github-button'; import Container from './container'; import Notifications from './notifications'; import DocSearch from './docsearch'; @@ -214,14 +214,7 @@ function Header({ hasHeroBelow }) { margin-top: 8px; `} > - - Star - + Docs diff --git a/website/yarn.lock b/website/yarn.lock index 17254e47..6db0ce39 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -6064,11 +6064,6 @@ git-up@^4.0.5: is-ssh "^1.3.0" parse-url "^6.0.0" -github-buttons@^2.21.1: - version "2.21.1" - resolved "https://registry.yarnpkg.com/github-buttons/-/github-buttons-2.21.1.tgz#9e55eb83b70c9149a21c235db2e971c53d4d98a2" - integrity sha512-n9bCQ8sj+5oX1YH5NeyWGbAclRDtHEhMBzqw2ctsWpdEHOwVgfruRu0VIVy01Ah10dd/iFajMHYU71L7IBWBOw== - github-from-package@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" @@ -10685,13 +10680,6 @@ react-frame-component@^5.2.1: resolved "https://registry.yarnpkg.com/react-frame-component/-/react-frame-component-5.2.1.tgz#6bd5ec73ef7d720f57ee8f259546ed926a941267" integrity sha512-nrSh1OZuHlX69eWqJPiUkPT9S6/wxc4PpJV+vOQ4pHQQ8XmIsIT+utWT+nX32ZfANHZuKONA7JsWMUGT36CqaQ== -react-github-btn@^1.1.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/react-github-btn/-/react-github-btn-1.2.2.tgz#9aab2498ff311b9f9c448a2d2b902d0277037d5c" - integrity sha512-X4IcX2qwaLciSa4wcUsrFgF2PcT+ukMbZZRBT50ZvO2HJMyqQJNYNHErCN2R0sgZfSFQHUuUHlGndF15VQUhPA== - dependencies: - github-buttons "^2.21.1" - react-helmet@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726"