File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,21 @@ const bootstrapVersion = require('bootstrap/package.json').version;
1313
1414const shortVersion = bootstrapVersion . split ( '.' ) . slice ( 0 , 2 ) . join ( '.' ) ;
1515
16+ const netlify =
17+ process . env . NETLIFY === 'true'
18+ ? {
19+ pullRequest : process . env . PULL_REQUEST ,
20+ reviewId : process . env . REVIEW_ID ,
21+ branch : process . env . BRANCH ,
22+ }
23+ : null ;
24+
1625const config = {
1726 bootstrapVersion,
1827 docsUrl : `https://getbootstrap.com/docs/${ shortVersion } ` ,
1928 version : require ( '../package.json' ) . version ,
2029 cssHash : getIntegrity ( 'bootstrap/dist/css/bootstrap.min.css' ) ,
30+ netlify,
2131} ;
2232
2333module . exports = config ;
Original file line number Diff line number Diff line change @@ -3,25 +3,26 @@ import Alert from 'react-bootstrap/Alert';
33import Container from 'react-bootstrap/Container' ;
44import Row from 'react-bootstrap/Row' ;
55
6- function MasterDocsAlert ( ) {
6+ export default function MasterDocsAlert ( ) {
7+ const { netlify } = config ;
78 let deploymentDetails = null ;
8- if ( process . env . NETLIFY ) {
9- if ( process . env . PULL_REQUEST === 'true' ) {
9+ if ( netlify ) {
10+ if ( netlify . pullRequest ) {
1011 deploymentDetails = (
1112 < span >
1213 a{ ' ' }
1314 < Alert . Link
14- href = { `https://github.com/react-bootstrap/react-bootstrap/pull/${ process . env . REVIEW_ID } ` }
15+ href = { `https://github.com/react-bootstrap/react-bootstrap/pull/${ netlify . reviewId } ` }
1516 >
1617 pull request
1718 </ Alert . Link >
1819 </ span >
1920 ) ;
2021 } else {
21- deploymentDetails = `the ${ process . env . BRANCH } branch` ;
22+ deploymentDetails = `the ${ netlify . branch } branch` ;
2223 }
2324 }
24- return process . env . NETLIFY ? (
25+ return netlify ? (
2526 < Container fluid >
2627 < Row >
2728 < Alert variant = "warning" className = "w-100" >
@@ -35,5 +36,3 @@ function MasterDocsAlert() {
3536 </ Container >
3637 ) : null ;
3738}
38-
39- export default MasterDocsAlert ;
You can’t perform that action at this time.
0 commit comments