Remove react-github-btn dependency
This commit is contained in:
parent
b7be7ed822
commit
d39debb9d0
@ -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"
|
||||
|
@ -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 (
|
||||
<GitHubButton
|
||||
<a
|
||||
href="https://github.com/SimpleCMS/simple-cms"
|
||||
data-icon="octicon-star"
|
||||
data-show-count="true"
|
||||
aria-label="Star SimpleCMS/simple-cms on GitHub"
|
||||
>
|
||||
Star
|
||||
</GitHubButton>
|
||||
<img alt="Star SimpleCMS/simple-cms on GitHub" src="https://img.shields.io/github/stars/SimpleCMS/simple-cms?style=social" />
|
||||
</a>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
`}
|
||||
>
|
||||
<GitHubButton
|
||||
href="https://github.com/SimpleCMS/simple-cms"
|
||||
data-icon="octicon-star"
|
||||
data-show-count="true"
|
||||
aria-label="Star SimpleCMS/simple-cms on GitHub"
|
||||
>
|
||||
Star
|
||||
</GitHubButton>
|
||||
<GitHubStarButton />
|
||||
</MenuItem>
|
||||
<MenuItem>
|
||||
<NavLink to="/docs/intro/">Docs</NavLink>
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user