-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathConnectionError.tsx
More file actions
41 lines (37 loc) · 1.05 KB
/
ConnectionError.tsx
File metadata and controls
41 lines (37 loc) · 1.05 KB
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
35
36
37
38
39
40
41
// Copyright 2022-2024 use-ink/contracts-ui authors & contributors
// SPDX-License-Identifier: GPL-3.0-only
import { Error } from './Error';
import { useApi } from 'ui/contexts';
import { LOCAL } from 'src/constants';
function ContractsNodeHelp() {
return (
<>
<div className="flex flex-col items-center">
<div>
Make sure you are running a local{' '}
<a
className="whitespace-nowrap"
href="https://github.com/use-ink/substrate-contracts-node"
rel="noreferrer"
target="_blank"
>
substrate-contracts-node
</a>
.
</div>
<div className="mt-1 rounded bg-slate-200 px-3 py-1 font-mono text-sm dark:bg-slate-800 dark:text-gray-400">
substrate-contracts-node --dev
</div>
</div>
</>
);
}
export function ConnectionError() {
const { endpoint } = useApi();
return (
<Error>
<div>Could not connect to {endpoint}</div>
{endpoint === LOCAL.rpc && <ContractsNodeHelp />}
</Error>
);
}