diff --git a/net/web/src/User/SideBar/Contacts/Contacts.jsx b/net/web/src/User/SideBar/Contacts/Contacts.jsx new file mode 100644 index 00000000..0aeef56f --- /dev/null +++ b/net/web/src/User/SideBar/Contacts/Contacts.jsx @@ -0,0 +1,14 @@ +import { Avatar, Image } from 'antd'; +import React from 'react' +import { ContactsWrapper } from './Contacts.styled'; +import { useContacts } from './useContacts.hook'; + +export function Contacts() { + + const { state, actions } = useContacts() + + return ( + + + ) +} diff --git a/net/web/src/User/SideBar/Contacts/Contacts.styled.jsx b/net/web/src/User/SideBar/Contacts/Contacts.styled.jsx new file mode 100644 index 00000000..dcc93901 --- /dev/null +++ b/net/web/src/User/SideBar/Contacts/Contacts.styled.jsx @@ -0,0 +1,12 @@ +import { Button } from 'antd'; +import styled from 'styled-components'; + +export const ContactsWrapper = styled.div` + width: 100%; + flex-grow: 1; + border-top-left-radius: 8px; + border-top-right-radius: 8px; + background-color: #f6f5ed; + border-top: 1px solid #8fbea7; + border-right: 1px solid #8fbea7; +`; diff --git a/net/web/src/User/SideBar/Contacts/useContacts.hook.js b/net/web/src/User/SideBar/Contacts/useContacts.hook.js new file mode 100644 index 00000000..7ae38064 --- /dev/null +++ b/net/web/src/User/SideBar/Contacts/useContacts.hook.js @@ -0,0 +1,19 @@ +import { useContext, useState, useEffect } from 'react'; +import { AppContext } from '../../../AppContext/AppContext'; + +export function useContacts() { + + const [state, setState] = useState({}); + + const actions = {}; + + const app = useContext(AppContext); + + const updateState = (value) => { + setState((s) => ({ ...s, ...value })); + } + + useEffect(() => {}, [app]) + + return { state, actions }; +} diff --git a/net/web/src/User/SideBar/Identity/Identity.jsx b/net/web/src/User/SideBar/Identity/Identity.jsx index a93e4d58..8e69c25a 100644 --- a/net/web/src/User/SideBar/Identity/Identity.jsx +++ b/net/web/src/User/SideBar/Identity/Identity.jsx @@ -1,7 +1,7 @@ import { Avatar, Image } from 'antd'; import React from 'react' import { IdentityWrapper } from './Identity.styled'; -import { DownOutlined, EditOutlined, UserOutlined } from '@ant-design/icons'; +import { RightOutlined, EditOutlined, UserOutlined } from '@ant-design/icons'; import { useIdentity } from './useIdentity.hook'; import { Menu, Dropdown } from 'antd'; @@ -10,10 +10,13 @@ export function Identity() { const { state, actions } = useIdentity() const Logo = () => { - if (state.imageUrl === '') { - return } /> + if (state.imageUrl != null) { + if (state.imageUrl === '') { + return + } + return } - return } /> + return <> } const menu = ( @@ -29,17 +32,17 @@ export function Identity() { return ( - +
-
diff --git a/net/web/src/User/SideBar/Identity/Identity.styled.js b/net/web/src/User/SideBar/Identity/Identity.styled.js index 0fbdde75..bc1e02f4 100644 --- a/net/web/src/User/SideBar/Identity/Identity.styled.js +++ b/net/web/src/User/SideBar/Identity/Identity.styled.js @@ -2,12 +2,11 @@ import { Button } from 'antd'; import styled from 'styled-components'; export const IdentityWrapper = styled.div` - background-color: #f6f5ed; - border-bottom: 2px solid #8fbea7; border-top: 1px solid #8fbea7; - border-left: 0px; - border-right: 0px; - border-radius: 0px; + border-right: 1px solid #8fbea7; + border-bottom: 1px solid #8fbea7; + overflow: hidden; + border-radius: 8px; &:hover { cursor: pointer; } @@ -19,19 +18,14 @@ export const IdentityWrapper = styled.div` justify-content: center; padding-left: 16px; padding-right: 16px; - } - - .menu { - min-width: 0px; + padding-top: 4px; + padding-bottom: 4px; + background-color: #f6f5ed; } .logo { - width: 33% - display: flex; - align-items: center; - justify-content: center; - padding-top: 4px; - padding-bottom: 4px; + width: 100%; + height: 100%; } .username { @@ -43,12 +37,16 @@ export const IdentityWrapper = styled.div` padding-right: 8px; } - .edit { - position: absolute; + .avatar { + color: #888888; + font-size: 3em; + width: 64px; + height: 64px; + border-radius: 6px; + overflow: hidden; display: flex; - align-items: flex-end; - right: 0; - bottom: 0; + align-items: center; + justify-content: center; } .name { @@ -59,10 +57,7 @@ export const IdentityWrapper = styled.div` .handle { font-size: 1em; color: #444444; + font-weight: bold; } - .domain { - font-size: 1em; - color: #444444; - } `; diff --git a/net/web/src/User/SideBar/Identity/useIdentity.hook.js b/net/web/src/User/SideBar/Identity/useIdentity.hook.js index d111ab09..1f3ecf6e 100644 --- a/net/web/src/User/SideBar/Identity/useIdentity.hook.js +++ b/net/web/src/User/SideBar/Identity/useIdentity.hook.js @@ -7,7 +7,7 @@ export function useIdentity() { name: '', handle: '', domain: '', - imageUrl: '' + imageUrl: null }); const actions = { diff --git a/net/web/src/User/SideBar/SideBar.jsx b/net/web/src/User/SideBar/SideBar.jsx index 8a48a8b8..34c05892 100644 --- a/net/web/src/User/SideBar/SideBar.jsx +++ b/net/web/src/User/SideBar/SideBar.jsx @@ -1,12 +1,14 @@ import React from 'react' import { SideBarWrapper } from './SideBar.styled'; import { Identity } from './Identity/Identity'; +import { Contacts } from './Contacts/Contacts'; export function SideBar() { return ( + ) } diff --git a/net/web/src/User/SideBar/SideBar.styled.js b/net/web/src/User/SideBar/SideBar.styled.js index 3fb04ebf..01a8b939 100644 --- a/net/web/src/User/SideBar/SideBar.styled.js +++ b/net/web/src/User/SideBar/SideBar.styled.js @@ -6,6 +6,7 @@ export const SideBarWrapper = styled.div` max-width: 300px; min-width: 200px; border: 1px solid #8fbea7; + background-color: #8fbea7; display: flex; flex-direction: column; `; diff --git a/net/web/src/User/User.jsx b/net/web/src/User/User.jsx index fe88aecc..f1108774 100644 --- a/net/web/src/User/User.jsx +++ b/net/web/src/User/User.jsx @@ -15,7 +15,6 @@ export function User() {
-
) diff --git a/net/web/src/User/User.styled.js b/net/web/src/User/User.styled.js index 6b3323bc..2e1fd651 100644 --- a/net/web/src/User/User.styled.js +++ b/net/web/src/User/User.styled.js @@ -13,7 +13,7 @@ export const UserWrapper = styled.div` flex-direction: column; flex-grow: 1; height: 100%; - border: 1px solid #8fbea7; + background-color: #8fbea7; align-items: center; justify-content: center; } diff --git a/net/web/src/User/useUser.hook.js b/net/web/src/User/useUser.hook.js index c2dc086c..0ab6fc93 100644 --- a/net/web/src/User/useUser.hook.js +++ b/net/web/src/User/useUser.hook.js @@ -10,9 +10,6 @@ export function useUser() { const app = useContext(AppContext); const actions = { - onLogout: async () => { - app.actions.logout() - }, updateState: (value) => { setState((s) => ({ ...s, ...value })); }, diff --git a/net/web/src/connect.png b/net/web/src/connect.png index ed6c4557..5806494b 100644 Binary files a/net/web/src/connect.png and b/net/web/src/connect.png differ