forked from binary-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from niloo-fs/niloo/75857/convert-shared-to-TS
Niloofar Sadeghi / Convert brand, browser, cfd, config to TS [shared-utiles] binary-com#6429
- Loading branch information
Showing
13 changed files
with
149 additions
and
53 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 was deleted.
Oops, something went wrong.
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,42 @@ | ||
import config_data from '../../../brand.config.json'; | ||
|
||
type TLandingCompany = { | ||
fx: string; | ||
malta: string; | ||
maltainvest: string; | ||
mx: string; | ||
samoa: string; | ||
svg: string; | ||
v: string; | ||
}; | ||
|
||
type TPlatform = { | ||
name: string; | ||
icon?: string; | ||
}; | ||
|
||
type TPlatforms = { | ||
trader: TPlatform; | ||
dbot: TPlatform; | ||
mt5: TPlatform; | ||
dxtrade: TPlatform; | ||
smarttrader: TPlatform; | ||
bbot: TPlatform; | ||
go: TPlatform; | ||
}; | ||
|
||
export const getBrandName = () => { | ||
return config_data.brand_name; | ||
}; | ||
|
||
export const getLegalEntityName = (landing_company: keyof TLandingCompany) => { | ||
return config_data.legal_entities[landing_company]; | ||
}; | ||
|
||
export const getBrandWebsiteName = () => { | ||
return config_data.domain_name; | ||
}; | ||
|
||
export const getPlatformSettings = (platform_key: keyof TPlatforms): TPlatform => { | ||
return config_data.platforms[platform_key]; | ||
}; |
File renamed without changes.
9 changes: 8 additions & 1 deletion
9
...hared/src/utils/browser/browser_detect.js → ...hared/src/utils/browser/browser_detect.ts
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,8 +1,15 @@ | ||
declare global { | ||
interface Window { | ||
safari?: any; | ||
HTMLElement: any; | ||
} | ||
} | ||
|
||
export const isSafari = () => { | ||
return ( | ||
/constructor/i.test(window.HTMLElement) || | ||
(function (p) { | ||
return p.toString() === '[object SafariRemoteNotification]'; | ||
})(!window.safari || (typeof safari !== 'undefined' && window.safari.pushNotification)) | ||
})(!window.safari || (typeof window.safari !== 'undefined' && window.safari.pushNotification)) | ||
); | ||
}; |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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