diff --git a/net/web/src/App.js b/net/web/src/App.js index a573fdf8..63813e15 100644 --- a/net/web/src/App.js +++ b/net/web/src/App.js @@ -4,6 +4,7 @@ import { Home } from './Home/Home'; import { Login } from './Login/Login'; import { Create } from './Create/Create'; import { User } from './User/User'; +import { Profile } from './User/Profile/Profile'; import { HashRouter as Router, Routes, Route } from "react-router-dom"; import 'antd/dist/antd.min.css'; @@ -20,7 +21,9 @@ function App() { } /> } /> } /> - } /> + }> + } /> + diff --git a/net/web/src/User/Profile/Profile.jsx b/net/web/src/User/Profile/Profile.jsx new file mode 100644 index 00000000..2316920d --- /dev/null +++ b/net/web/src/User/Profile/Profile.jsx @@ -0,0 +1,18 @@ +import React from 'react' +import { ProfileWrapper } from './Profile.styled'; +import { CloseOutlined } from '@ant-design/icons'; +import { useProfile } from './useProfile.hook'; + +export function Profile(props) { + + const { state, actions } = useProfile(); + + return ( + +
actions.close()}> + +
+
+ ) +} + diff --git a/net/web/src/User/Profile/Profile.styled.js b/net/web/src/User/Profile/Profile.styled.js new file mode 100644 index 00000000..b1dc6cd3 --- /dev/null +++ b/net/web/src/User/Profile/Profile.styled.js @@ -0,0 +1,21 @@ +import { Input, Button, Spin } from 'antd'; +import styled from 'styled-components'; + +export const ProfileWrapper = styled.div` + display: flex; + width: 100%; + height: 100%; + background-color: #f6f5ed; + border-radius: 8px; + + .close { + position: absolute; + right: 0px; + padding-right: 16px; + padding-top: 8px; + font-size: 1.5em; + color: #888; + cursor: pointer; + } +`; + diff --git a/net/web/src/User/Profile/useProfile.hook.js b/net/web/src/User/Profile/useProfile.hook.js new file mode 100644 index 00000000..286d0a7c --- /dev/null +++ b/net/web/src/User/Profile/useProfile.hook.js @@ -0,0 +1,22 @@ +import { useContext, useState, useEffect } from 'react'; +import { AppContext } from '../../AppContext/AppContext'; +import { useNavigate } from "react-router-dom"; + +export function useProfile() { + + const [state, setState] = useState({}); + + const navigate = useNavigate(); + const app = useContext(AppContext); + + const actions = { + close: () => { + navigate('/user') + }, + }; + + useEffect(() => { + }, [app]) + + return { state, actions }; +} diff --git a/net/web/src/User/SideBar/Contacts/Contacts.styled.jsx b/net/web/src/User/SideBar/Contacts/Contacts.styled.jsx index dcc93901..1e660d11 100644 --- a/net/web/src/User/SideBar/Contacts/Contacts.styled.jsx +++ b/net/web/src/User/SideBar/Contacts/Contacts.styled.jsx @@ -4,8 +4,7 @@ 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; + border-radius: 8px; background-color: #f6f5ed; border-top: 1px solid #8fbea7; border-right: 1px solid #8fbea7; diff --git a/net/web/src/User/SideBar/Identity/Identity.jsx b/net/web/src/User/SideBar/Identity/Identity.jsx index 8e69c25a..cbf7839a 100644 --- a/net/web/src/User/SideBar/Identity/Identity.jsx +++ b/net/web/src/User/SideBar/Identity/Identity.jsx @@ -22,7 +22,7 @@ export function Identity() { const menu = ( -
{}}>Edit Profile
+
actions.editProfile()}>Edit Profile
actions.logout()}>Sign Out
diff --git a/net/web/src/User/SideBar/Identity/useIdentity.hook.js b/net/web/src/User/SideBar/Identity/useIdentity.hook.js index 1f3ecf6e..2f21b45d 100644 --- a/net/web/src/User/SideBar/Identity/useIdentity.hook.js +++ b/net/web/src/User/SideBar/Identity/useIdentity.hook.js @@ -1,5 +1,6 @@ import { useContext, useState, useEffect } from 'react'; import { AppContext } from '../../../AppContext/AppContext'; +import { useNavigate } from "react-router-dom"; export function useIdentity() { @@ -13,9 +14,13 @@ export function useIdentity() { const actions = { logout: async () => { app.actions.logout() + }, + editProfile: () => { + navigate('/user/profile'); } }; + const navigate = useNavigate(); const app = useContext(AppContext); const updateState = (value) => { diff --git a/net/web/src/User/SideBar/SideBar.styled.js b/net/web/src/User/SideBar/SideBar.styled.js index 01a8b939..e43e41ba 100644 --- a/net/web/src/User/SideBar/SideBar.styled.js +++ b/net/web/src/User/SideBar/SideBar.styled.js @@ -9,4 +9,7 @@ export const SideBarWrapper = styled.div` background-color: #8fbea7; display: flex; flex-direction: column; + padding-top: 2px; + padding-left: 4px; + padding-bottom: 4px; `; diff --git a/net/web/src/User/User.jsx b/net/web/src/User/User.jsx index f1108774..01afbf1c 100644 --- a/net/web/src/User/User.jsx +++ b/net/web/src/User/User.jsx @@ -1,4 +1,5 @@ import React from 'react' +import { Outlet } from 'react-router-dom'; import { useUser } from './useUser.hook'; import { Button } from 'antd'; import { UserWrapper } from './User.styled'; @@ -15,6 +16,9 @@ export function User() {
+
+ +
) diff --git a/net/web/src/User/User.styled.js b/net/web/src/User/User.styled.js index 2e1fd651..b79740f3 100644 --- a/net/web/src/User/User.styled.js +++ b/net/web/src/User/User.styled.js @@ -19,9 +19,23 @@ export const UserWrapper = styled.div` } .connect { + position: absolute; width: 33%; height: 33%; object-fit: contain; } + + .page { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + padding-left: 8px; + padding-top: 4px; + padding-bottom: 4px; + padding-right: 4px; + z-index: 1; + } `;