-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a useSdk hook. Move bundle sources to sdk file
- Loading branch information
1 parent
2693fee
commit 677c684
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import useScript from './useScript'; | ||
import useStylesheet from './useStylesheet'; | ||
import { JS_BUNDLE, CSS_BUNDLE } from '../utils/sdk'; | ||
|
||
const useSdk = () => { | ||
const scriptLoaded = useScript(JS_BUNDLE); | ||
const stylesheetLoaded = useStylesheet(CSS_BUNDLE); | ||
|
||
return scriptLoaded && stylesheetLoaded; | ||
}; | ||
|
||
export default useSdk; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const BASE_URL = | ||
'//hypertext-sandbox.nr-assets.net/wanda--wanda-ec-ui--nr1-docs'; | ||
const RELEASE = 'release-1093'; | ||
|
||
export const JS_BUNDLE = `${BASE_URL}-${RELEASE}.js`; | ||
export const CSS_BUNDLE = `${BASE_URL}-${RELEASE}.css`; |