|
1 | | -import { FC } from 'react'; |
| 1 | +import { Menu, Typography } from 'antd'; |
| 2 | +import { FC, useContext } from 'react'; |
| 3 | +import { Link } from 'react-router-dom'; |
2 | 4 | import styled from 'styled-components'; |
3 | 5 |
|
4 | | -const Container = styled.div<{ open: boolean }>` |
5 | | - position: absolute; |
6 | | - top: 0; |
7 | | - right: 0; |
8 | | - width: 250px; |
| 6 | +import { OptionsContext } from '../services/optionsContext'; |
| 7 | + |
| 8 | +const { Title } = Typography; |
| 9 | + |
| 10 | +const Container = styled.div` |
| 11 | + width: 100%; |
9 | 12 | height: 100vh; |
10 | | - background-color: ${({ theme }) => theme.p}; |
11 | | - z-index: 1; |
12 | 13 | `; |
13 | 14 |
|
14 | | -const Content = styled.div``; |
| 15 | +const TitleContainer = styled.div` |
| 16 | + background-color: ${({ theme }) => theme.p}; |
| 17 | + color: ${({ theme }) => theme.c}; |
| 18 | + height: 5%; |
| 19 | + width: 100%; |
| 20 | +`; |
15 | 21 |
|
16 | 22 | export const NavBar: FC = () => { |
| 23 | + const options = useContext(OptionsContext); |
| 24 | + |
17 | 25 | return ( |
18 | | - <Container open={true}> |
19 | | - <Content>navbar</Content> |
| 26 | + <Container> |
| 27 | + |
| 28 | + <TitleContainer> |
| 29 | + <Title level={2}> |
| 30 | + Playground |
| 31 | + </Title> |
| 32 | + </TitleContainer> |
| 33 | + |
| 34 | + <Menu |
| 35 | + defaultOpenKeys={['sub1']} |
| 36 | + defaultSelectedKeys={['1']} |
| 37 | + mode="inline" |
| 38 | + > |
| 39 | + <Menu.Item key="editor"> |
| 40 | + <Link to={`/${options.serverId}/playground/editor`}> |
| 41 | + <span>Editor</span> |
| 42 | + </Link> |
| 43 | + </Menu.Item> |
| 44 | + <Menu.Item key="variables"> |
| 45 | + <Link to={`/${options.serverId}/playground/variables`}> |
| 46 | + <span>Variables</span> |
| 47 | + </Link> |
| 48 | + </Menu.Item> |
| 49 | + <Menu.Item key="executions"> |
| 50 | + <Link to={`/${options.serverId}/playground/executions`}> |
| 51 | + <span>Executions</span> |
| 52 | + </Link> |
| 53 | + </Menu.Item> |
| 54 | + <Menu.Item key="settings"> |
| 55 | + <Link to={`/${options.serverId}/playground/settings`}> |
| 56 | + <span>Settings</span> |
| 57 | + </Link> |
| 58 | + </Menu.Item> |
| 59 | + </Menu> |
20 | 60 | </Container> |
21 | 61 | ); |
22 | 62 | }; |
0 commit comments