-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathclientContext.ts
More file actions
31 lines (27 loc) · 1018 Bytes
/
clientContext.ts
File metadata and controls
31 lines (27 loc) · 1018 Bytes
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
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',
snowboundHost: 'https://dev.snowobs.com',
nwacHost: 'https://staging.nwac.us',
};
export const ClientContext: Context<ClientProps> = React.createContext<ClientProps>({
...productionHosts,
requestedTime: 'latest',
setRequestedTime: () => {},
});