adding contact menu

This commit is contained in:
Roland Osborne 2022-08-12 11:48:55 -07:00
parent 77156fadda
commit 22f3cc1612
11 changed files with 78 additions and 16 deletions

View File

@ -1,7 +1,8 @@
const Colors = { const Colors = {
background: '#8fbea7', background: '#8fbea7',
primary: '#448866', primary: '#448866',
formBackground: '#f4f4f4', formBackground: '#f2f2f2',
formFocus: '#f8f8f8',
formHover: '#e8e8e8', formHover: '#e8e8e8',
grey: '#888888', grey: '#888888',
white: '#ffffff', white: '#ffffff',

View File

@ -35,7 +35,7 @@ export function Session() {
{ (viewport.state.display === 'xlarge') && ( { (viewport.state.display === 'xlarge') && (
<div class="desktop-layout noselect"> <div class="desktop-layout noselect">
<div class="left"> <div class="left">
<Identity /> <Identity openCards={actions.openCards} />
<div class="bottom"> <div class="bottom">
<Channels /> <Channels />
</div> </div>
@ -75,7 +75,7 @@ export function Session() {
{ (viewport.state.display === 'large' || viewport.state.display === 'medium') && ( { (viewport.state.display === 'large' || viewport.state.display === 'medium') && (
<div class="tablet-layout noselect"> <div class="tablet-layout noselect">
<div class="left"> <div class="left">
<Identity /> <Identity openCards={actions.openCards} />
<div class="bottom"> <div class="bottom">
<Channels /> <Channels />
</div> </div>
@ -87,16 +87,16 @@ export function Session() {
<Conversation cardId={state.cardId} conversationId={state.conversationId} /> <Conversation cardId={state.cardId} conversationId={state.conversationId} />
</div> </div>
)} )}
<Drawer width={'33%'} closable={false} onClose={actions.closeDetails} visible={state.details} zIndex={10}> <Drawer bodyStyle={{ padding: 0 }} width={'33%'} closable={false} onClose={actions.closeDetails} visible={state.details} zIndex={10}>
{ state.details && ( { state.details && (
<Details cardId={state.cardId} conversationId={state.conversationId} /> <Details cardId={state.cardId} conversationId={state.conversationId} />
)} )}
</Drawer> </Drawer>
<Drawer width={'33%'} closable={false} onClose={actions.closeCards} visible={state.cards} zIndex={20}> <Drawer bodyStyle={{ padding: 0 }} width={'33%'} closable={false} onClose={actions.closeCards} visible={state.cards} zIndex={20}>
{ state.cards && ( { state.cards && (
<Cards /> <Cards />
)} )}
<Drawer width={'33%'} closable={false} onClose={actions.closeContact} visible={state.contact} zIndex={30}> <Drawer bodyStyle={{ padding: 0 }} width={'33%'} closable={false} onClose={actions.closeContact} visible={state.contact} zIndex={30}>
{ state.contact && ( { state.contact && (
<Contact guid={state.contactGuid} /> <Contact guid={state.contactGuid} />
)} )}

View File

@ -68,9 +68,13 @@ export const SessionWrapper = styled.div`
height: calc(100% - 64px); height: calc(100% - 64px);
} }
} }
.center { .right {
flex-grow: 1; flex-grow: 1;
position: relative; position: relative;
.drawer {
padding: 0px;
}
} }
} }
@ -87,7 +91,7 @@ export const SessionWrapper = styled.div`
.bottom { .bottom {
height: 48px; height: 48px;
position: relative; position: relative;
box-shadow: 0px -8px 16px 0px rgba(0,0,0,0.3); box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.3);
} }
} }
`; `;

View File

@ -8,7 +8,7 @@ export const BottomNavWrapper = styled.div`
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: ${Colors.formBackground}; background-color: ${Colors.primary};
.nav-item { .nav-item {
width: 33%; width: 33%;
@ -27,7 +27,7 @@ export const BottomNavWrapper = styled.div`
.nav-active { .nav-active {
width: 100%; width: 100%;
height: 100%; height: 100%;
color: ${Colors.enabled}; color: ${Colors.formFocus};
padding-top: 8px; padding-top: 8px;
padding-bottom: 8px; padding-bottom: 8px;
font-size: 24px; font-size: 24px;

View File

@ -1,4 +1,28 @@
import { Input, List } from 'antd';
import { CardsWrapper } from './Cards.styled';
import { SearchOutlined } from '@ant-design/icons';
import { useCards } from './useCards.hook';
import { CardItem } from './cardItem/CardItem';
export function Cards() { export function Cards() {
return <div>CARDS</div>
const { state, actions } = useCards();
return (
<CardsWrapper>
<div class="view">
<div class="search">
<div class="filter">
<Input bordered={false} allowClear={true} placeholder="Contacts" prefix={<SearchOutlined />}
size="large" spellCheck="false" onChange={(e) => actions.onFilter(e.target.value)} />
</div>
</div>
<List local={{ emptyText: '' }} itemLayout="horizontal" dataSource={state.cards} gutter="0"
renderItem={item => (
<CardItem item={item} />
)} />
</div>
</CardsWrapper>
);
} }

View File

@ -0,0 +1,3 @@
export function CardItem() {
return <div>CARD ITEM</div>
}

View File

@ -0,0 +1,29 @@
import { useContext, useState, useEffect } from 'react';
import { CardContext } from 'context/CardContext';
export function useCards() {
const [filter, setFilter] = useState(null);
const [state, setState] = useState({
cards: [],
busy: false }
);
const card = useContext(CardContext);
const updateState = (value) => {
setState((s) => ({ ...s, ...value }));
}
const actions = {
onFilter: (value) => {
setFilter(value.toUpperCase());
},
};
useEffect(() => {
}, [card]);
return { state, actions };
}

View File

@ -6,7 +6,7 @@ export const ChannelsWrapper = styled.div`
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-color: ${Colors.formBackground}; background-color: ${Colors.formFocus};
.view { .view {
min-height: 0; min-height: 0;

View File

@ -12,12 +12,12 @@ export function AddTopic() {
<div class="bar"> <div class="bar">
<div class="add"> <div class="add">
<CommentOutlined /> <CommentOutlined />
<div class="label">New Topic</div> <div class="label">New Channel</div>
</div> </div>
</div> </div>
)} )}
{ state.mode === 'button' && ( { state.mode === 'button' && (
<div class="button">New Topic</div> <div class="button">New Channel</div>
)} )}
</AddTopicWrapper> </AddTopicWrapper>
); );

View File

@ -2,6 +2,7 @@ import styled from 'styled-components';
import Colors from 'constants/Colors'; import Colors from 'constants/Colors';
export const AddTopicWrapper = styled.div` export const AddTopicWrapper = styled.div`
background-color: ${Colors.formBackground};
.button { .button {
position: absolute; position: absolute;

View File

@ -4,7 +4,7 @@ import { IdentityWrapper } from './Identity.styled';
import { useIdentity } from './useIdentity.hook'; import { useIdentity } from './useIdentity.hook';
import { ExclamationCircleOutlined, DownOutlined } from '@ant-design/icons'; import { ExclamationCircleOutlined, DownOutlined } from '@ant-design/icons';
export function Identity() { export function Identity({ openCards }) {
const { state, actions } = useIdentity(); const { state, actions } = useIdentity();
@ -14,7 +14,7 @@ export function Identity() {
<div>Edit Profile</div> <div>Edit Profile</div>
</Menu.Item> </Menu.Item>
<Menu.Item key="1"> <Menu.Item key="1">
<div>Change Login</div> <div onClick={openCards} >Manage Contacts</div>
</Menu.Item> </Menu.Item>
<Menu.Item key="2"> <Menu.Item key="2">
<div onClick={actions.logout}>Logout</div> <div onClick={actions.logout}>Logout</div>