2022-08-07 06:41:09 +00:00
|
|
|
import { BottomNavWrapper } from './BottomNav.styled';
|
2022-08-19 19:15:10 +00:00
|
|
|
import { CommentOutlined, ContactsOutlined, UserOutlined } from '@ant-design/icons';
|
2022-08-07 06:41:09 +00:00
|
|
|
|
|
|
|
export function BottomNav({ state, actions }) {
|
|
|
|
|
|
|
|
const tab = () => {
|
2022-08-18 19:57:54 +00:00
|
|
|
if (state.profile || state.account) {
|
2022-08-07 06:41:09 +00:00
|
|
|
return 'profile';
|
|
|
|
}
|
|
|
|
if (state.cards || state.contact) {
|
|
|
|
return 'cards';
|
|
|
|
}
|
|
|
|
return 'channels';
|
|
|
|
}
|
|
|
|
|
|
|
|
const setChannels = () => {
|
|
|
|
actions.closeDetails();
|
|
|
|
actions.closeCards();
|
2022-08-17 20:05:01 +00:00
|
|
|
actions.closeListing();
|
2022-08-07 06:41:09 +00:00
|
|
|
actions.closeContact();
|
|
|
|
actions.closeProfile();
|
2022-08-16 19:13:17 +00:00
|
|
|
actions.closeAccount();
|
2022-08-07 06:41:09 +00:00
|
|
|
actions.closeConversation();
|
|
|
|
}
|
|
|
|
|
|
|
|
const setProfile = () => {
|
|
|
|
actions.closeDetails();
|
|
|
|
actions.closeCards();
|
2022-08-17 20:05:01 +00:00
|
|
|
actions.closeListing();
|
2022-08-07 06:41:09 +00:00
|
|
|
actions.closeContact();
|
|
|
|
actions.openProfile();
|
|
|
|
actions.closeConversation();
|
|
|
|
}
|
|
|
|
|
|
|
|
const setCards = () => {
|
|
|
|
actions.closeDetails();
|
|
|
|
actions.openCards();
|
|
|
|
actions.closeContact();
|
|
|
|
actions.closeProfile();
|
2022-08-16 19:13:17 +00:00
|
|
|
actions.closeAccount();
|
2022-08-07 06:41:09 +00:00
|
|
|
actions.closeConversation();
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<BottomNavWrapper>
|
|
|
|
{ !state.cards && !state.contact && !state.profile && (
|
|
|
|
<div class="nav-item">
|
|
|
|
<div class="nav-active">
|
|
|
|
<div class="nav-div-right">
|
|
|
|
<CommentOutlined />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
{ (state.cards || state.contact || state.profile) && (
|
2022-08-08 01:05:54 +00:00
|
|
|
<div class="nav-item" onClick={() => setChannels()}>
|
2022-08-07 06:41:09 +00:00
|
|
|
<div class="nav-inactive">
|
|
|
|
<div class="nav-div-right">
|
2022-08-08 01:05:54 +00:00
|
|
|
<CommentOutlined />
|
2022-08-07 06:41:09 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
{ state.profile && (
|
|
|
|
<div class="nav-item">
|
|
|
|
<div class="nav-active">
|
|
|
|
<div class="nav-div-right nav-div-left">
|
|
|
|
<UserOutlined />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
{ !state.profile && (
|
2022-08-08 01:05:54 +00:00
|
|
|
<div class="nav-item" onClick={() => setProfile()}>
|
2022-08-07 06:41:09 +00:00
|
|
|
<div class="nav-inactive">
|
|
|
|
<div class="nav-div-right nav-div-left">
|
2022-08-08 01:05:54 +00:00
|
|
|
<UserOutlined />
|
2022-08-07 06:41:09 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
{ (state.cards || state.contact) && !state.profile && (
|
|
|
|
<div class="nav-item">
|
|
|
|
<div class="nav-active">
|
2022-08-19 19:15:10 +00:00
|
|
|
<div class="nav-div-left bump">
|
|
|
|
<ContactsOutlined />
|
2022-08-07 06:41:09 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
{ ((!state.cards && !state.contact) || state.profile) && (
|
2022-08-08 01:05:54 +00:00
|
|
|
<div class="nav-item" onClick={() => setCards()}>
|
2022-08-07 06:41:09 +00:00
|
|
|
<div class="nav-inactive">
|
2022-08-19 19:15:10 +00:00
|
|
|
<div class="nav-div-left bump">
|
|
|
|
<ContactsOutlined />
|
2022-08-07 06:41:09 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</BottomNavWrapper>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|