You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
364 B
17 lines
364 B
// @flow
|
|
import { track } from 'analytics/segment'
|
|
|
|
let shell
|
|
if (!process.env.STORYBOOK_ENV) {
|
|
const electron = require('electron')
|
|
shell = electron.shell
|
|
}
|
|
|
|
export const openURL = (
|
|
url: string,
|
|
customEventName: string = 'OpenURL',
|
|
extraParams: Object = {},
|
|
) => {
|
|
track(customEventName, { ...extraParams, url })
|
|
shell && shell.openExternal(url)
|
|
}
|
|
|