Skip to content

Commit

Permalink
fix: connected status
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymond Ottun committed Sep 30, 2021
1 parent ccec31e commit 6a8a65b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ServerControls } from './components/ServerControls';
import { Visualise } from './components/Visualise';
import { Header } from 'antd/lib/layout/layout';
import { ReactComponent as Logo } from './logo.svg';
import { ServerStatus } from './components/ServerStatus';

const { Footer, Content } = Layout;

Expand All @@ -26,7 +27,8 @@ const App = () => {
<Row justify="space-between">
<Row align="middle">
<Logo width="30" />
<span style={{ color: 'white', paddingLeft: '10px' }}>Deputy v{version}</span>
<span style={{ color: 'white', padding: '0 10px' }}>Deputy v{version}</span>
<ServerStatus />
</Row>
<Typography.Link href="https://sayjava.github.io/behave/" target="_blank">
Docs
Expand Down
14 changes: 14 additions & 0 deletions ui/src/components/ServerStatus.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ApiFilled } from '@ant-design/icons';
import { useServerState } from './Provider';

export const ServerStatus = () => {
const {
state: { connected },
} = useServerState();

if (connected) {
return <></>;
}

return <ApiFilled style={{ color: '#ff0000' }} />;
};

0 comments on commit 6a8a65b

Please sign in to comment.