-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathclientContext.ts
34 lines (30 loc) · 1.07 KB
/
clientContext.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React, {Context} from 'react';
import {RequestedTime} from 'utils/date';
export interface ClientProps {
nationalAvalancheCenterHost: string;
nationalAvalancheCenterWordpressHost: string;
snowboundHost: string;
nwacHost: string;
requestedTime: RequestedTime;
setRequestedTime: (requestedTime: RequestedTime) => void;
}
export const productionHosts = {
nationalAvalancheCenterHost: 'https://api.avalanche.org',
nationalAvalancheCenterWordpressHost: 'https://forecasts.avalanche.org',
snowboundHost: 'https://api.snowobs.com',
nwacHost: 'https://nwac.us',
};
export const stagingHosts = {
nationalAvalancheCenterHost: 'https://staging-api.avalanche.org',
nationalAvalancheCenterWordpressHost: 'https://devavycenters.wpengine.com',
// TODO(brian): what's the Staging version for Snowbound?
snowboundHost: 'https://api.snowobs.com',
nwacHost: 'https://staging.nwac.us',
};
export const ClientContext: Context<ClientProps> = React.createContext<ClientProps>({
...productionHosts,
requestedTime: 'latest',
setRequestedTime: () => {
undefined;
},
});