-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4352212
commit 2f215f9
Showing
3 changed files
with
12 additions
and
8 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
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
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 |
---|---|---|
@@ -1,15 +1,19 @@ | ||
import Storefront from '@fleetbase/storefront'; | ||
import config from 'config'; | ||
|
||
import { get } from 'utils/Storage'; | ||
const { STOREFRONT_KEY, FLEETBASE_HOST } = config; | ||
let storefront, adapter; | ||
|
||
let { STOREFRONT_KEY, FLEETBASE_HOST } = config; | ||
try { | ||
storefront = new Storefront('network_f7c72f15ff4be9fd3f6fa25ed30271af', { host: FLEETBASE_HOST }); | ||
adapter = storefront.getAdapter(); | ||
} catch (error) { | ||
storefront = error; | ||
} | ||
|
||
const useStorefront = () => { | ||
const storefront = new Storefront(STOREFRONT_KEY || 'store_726cc5fe346591e99edfa2aed2102148', { host: 'https://460a-202-131-229-106.ngrok-free.app' }); | ||
const adapter = storefront.getAdapter(); | ||
|
||
return storefront; | ||
}; | ||
|
||
export default useStorefront; | ||
export { adapter }; |