-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
12 changed files
with
137 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
WS_CORETIME_CHAIN="WSS endpoint of the coretime chain" | ||
WS_RELAY_CHAIN="WSS endpoint of the coretime relay chain" | ||
WS_ROCOCO_CORETIME_CHAIN="WSS endpoint of the coretime chain" | ||
WS_KUSAMA_CORETIME_CHAIN="WSS endpoint of the coretime chain" | ||
WS_ROCOCO_RELAY_CHAIN="WSS endpoint of the coretime relay chain" | ||
WS_KUSAMA_RELAY_CHAIN="WSS endpoint of the coretime relay chain" |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useNetwork } from '@/contexts/network'; | ||
import { FormControl, InputLabel, MenuItem, Select } from '@mui/material'; | ||
|
||
const RelaySelect = () => { | ||
const { network, setNetwork } = useNetwork(); | ||
const handleChange = (e: any) => { | ||
setNetwork(e.target.value); | ||
}; | ||
|
||
return ( | ||
<FormControl sx={{ m: 2, minWidth: 200 }} fullWidth> | ||
<InputLabel id='demo-simple-select-label'>Network</InputLabel> | ||
<Select | ||
id='network-select' | ||
value={network} | ||
label='Relay chain' | ||
onChange={handleChange} | ||
> | ||
<MenuItem value='rococo'>Rococo</MenuItem> | ||
<MenuItem value='kusama'>Kusama</MenuItem> | ||
</Select> | ||
</FormControl> | ||
); | ||
}; | ||
|
||
export default RelaySelect; |
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
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,2 +1,6 @@ | ||
export const WS_RELAY_CHAIN = process.env.WS_RELAY_CHAIN ?? ''; | ||
export const WS_CORETIME_CHAIN = process.env.WS_CORETIME_CHAIN ?? ''; | ||
export const WS_ROCOCO_RELAY_CHAIN = process.env.WS_ROCOCO_RELAY_CHAIN ?? ''; | ||
export const WS_KUSAMA_RELAY_CHAIN = process.env.WS_ROCOCO_KUSAMA_CHAIN ?? ''; | ||
export const WS_ROCOCO_CORETIME_CHAIN = | ||
process.env.WS_ROCOCO_CORETIME_CHAIN ?? ''; | ||
export const WS_KUSAMA_CORETIME_CHAIN = | ||
process.env.WS_KUSAMA_CORETIME_CHAIN ?? ''; |
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,30 @@ | ||
import React, { createContext, useContext, useState } from 'react'; | ||
|
||
import { Network, NetworkContext } from '@/models'; | ||
|
||
const defaultNetworkData = { | ||
network: 'rococo', | ||
setNetwork: (_n: Network): void => { | ||
/** */ | ||
}, | ||
}; | ||
|
||
const NetworkContextData = createContext<NetworkContext>(defaultNetworkData); | ||
|
||
interface Props { | ||
children: React.ReactNode; | ||
} | ||
|
||
const NetworkDataProvider = ({ children }: Props) => { | ||
const [network, setNetwork] = useState<Network>('rococo'); | ||
|
||
return ( | ||
<NetworkContextData.Provider value={{ network, setNetwork }}> | ||
{children} | ||
</NetworkContextData.Provider> | ||
); | ||
}; | ||
|
||
const useNetwork = () => useContext(NetworkContextData); | ||
|
||
export { NetworkDataProvider, useNetwork }; |
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