Skip to content

Commit b433000

Browse files
authored
Merge pull request #449 from rvsia/replaceButtonScript
Use react-github-buttons instead of outside script
2 parents 499f6a2 + c301364 commit b433000

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

packages/react-renderer-demo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"react-ace": "^6.3.2",
5050
"react-copy-to-clipboard": "^5.0.1",
5151
"react-dom": "^16.13.0",
52+
"react-github-buttons": "^0.4.0",
5253
"react-sticky-box": "^0.8.0"
5354
},
5455
"devDependencies": {

packages/react-renderer-demo/src/app/pages/_document.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class MyDocument extends Document {
2525
<body>
2626
<Main />
2727
<NextScript />
28-
<script async defer src="https://buttons.github.io/buttons.js"></script>
2928
</body>
3029
</html>
3130
);

packages/react-renderer-demo/src/app/pages/index.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { makeStyles } from '@material-ui/core/styles';
33
import Typography from '@material-ui/core/Typography';
44
import Button from '@material-ui/core/Button';
55
import Link from 'next/link';
6+
import { Star } from 'react-github-buttons';
67

78
import LandingPageTitle from '@docs/components/landing-page/landing-page-title';
89
import LandingPageCards from '@docs/components/landing-page/landing-page-cards';
@@ -26,8 +27,8 @@ const useStyles = makeStyles((theme) => ({
2627
marginTop: 48
2728
},
2829
npmLink: {
29-
display: 'block',
30-
textAlign: 'center',
30+
display: 'flex',
31+
justifyContent: 'center',
3132
marginTop: 24
3233
},
3334
getStartedAnchor: {
@@ -40,6 +41,20 @@ const useStyles = makeStyles((theme) => ({
4041
paddingLeft: 16,
4142
paddingRight: 16,
4243
textTransform: 'none'
44+
},
45+
gitHubStar: {
46+
textDecoration: 'none',
47+
'& button': {
48+
lineHeight: 1.43,
49+
padding: '1px 6px',
50+
maxHeight: 20
51+
},
52+
'& a': {
53+
padding: '2px 5px',
54+
lineHeight: 1.43,
55+
fontFamily: 'sans-serif',
56+
maxHeight: 20
57+
}
4358
}
4459
}));
4560

@@ -62,15 +77,9 @@ const LandingPage = () => {
6277
</Link>
6378
</div>
6479
<div className={classes.npmLink}>
65-
<a
66-
className="github-button"
67-
href="https://github.com/data-driven-forms/react-forms"
68-
data-show-count="true"
69-
aria-label="Star data-driven-forms/react-forms on GitHub"
70-
>
71-
Star
80+
<a className={classes.gitHubStar} href="https://github.com/data-driven-forms/react-forms" rel="noopener noreferrer" target="_blank">
81+
<Star owner="data-driven-forms" repo="react-forms" />
7282
</a>
73-
&nbsp;
7483
<a href="https://badge.fury.io/js/%40data-driven-forms%2Freact-form-renderer" rel="noopener noreferrer" target="_blank">
7584
<img src="https://badge.fury.io/js/%40data-driven-forms%2Freact-form-renderer.svg" alt="current version" />
7685
</a>

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16427,6 +16427,11 @@ react-fontawesome@^1.6.1:
1642716427
dependencies:
1642816428
prop-types "^15.5.6"
1642916429

16430+
react-github-buttons@^0.4.0:
16431+
version "0.4.0"
16432+
resolved "https://registry.yarnpkg.com/react-github-buttons/-/react-github-buttons-0.4.0.tgz#ab7870772dea946526c7a7c53fdd8f39a63b6cb5"
16433+
integrity sha512-MG5EnS/V8sIP+ExUnITlz47aSA5QvvwL1lLdQNazXSs0ewoZWTMoAv5FZwkMa7bMAwVOuQg38JtOqCrptKELkw==
16434+
1643016435
react-input-autosize@^2.2.1, react-input-autosize@^2.2.2:
1643116436
version "2.2.2"
1643216437
resolved "https://registry.yarnpkg.com/react-input-autosize/-/react-input-autosize-2.2.2.tgz#fcaa7020568ec206bc04be36f4eb68e647c4d8c2"

0 commit comments

Comments
 (0)