Fix initial project loading for client

This commit is contained in:
Hazem Krimi
2023-05-28 16:31:53 +01:00
parent d4f75aa8c8
commit bd462d7fb7
5 changed files with 14 additions and 55 deletions
+5 -5
View File
@@ -6,7 +6,7 @@ import {
Box,
ContextMenu,
IconButton,
MessagingSidebar,
SupportSidebar,
SidebarItem,
} from '..';
import { Add, Messaging } from '../../assets';
@@ -44,7 +44,7 @@ const Sidebar = () => {
const [templates, setTemplates] = useState<Array<TemplateOutput>>();
const [features, setFeatures] = useState<Array<FeatureOutput>>();
const [categories, setCategories] = useState<Array<CategoryOutput>>();
const [messagingSidebarOpen, setMessagingSidebarOpen] =
const [supportSideBarOpen, setSupportSideBarOpen] =
useState<boolean>(false);
const [getProjectsByClientId] = useLazyQuery<
@@ -268,7 +268,7 @@ const Sidebar = () => {
icon={<Messaging />}
color={role}
onClick={() =>
setMessagingSidebarOpen(!messagingSidebarOpen)
setSupportSideBarOpen(!supportSideBarOpen)
}
/>
</Box>
@@ -276,8 +276,8 @@ const Sidebar = () => {
</Box>
</>
)}
{messagingSidebarOpen && (
<MessagingSidebar onClose={() => setMessagingSidebarOpen(false)} />
{supportSideBarOpen && (
<SupportSidebar onClose={() => setSupportSideBarOpen(false)} />
)}
</Wrapper>
);
@@ -13,11 +13,11 @@ import { GET_PROJECT_THREADS } from '../../graphql/chat.api.support';
import { Add, Empty } from '../../assets';
import { clientSupport } from '../..';
type MessagingSidebarProps = {
type SupportSideBarProps = {
onClose: () => void;
};
const MessagingSidebar = ({ onClose }: MessagingSidebarProps) => {
const SupportSidebar = ({ onClose }: SupportSideBarProps) => {
const role = useReactiveVar(roleVar);
const location = useLocation();
const navigate = useNavigate();
@@ -110,4 +110,4 @@ const MessagingSidebar = ({ onClose }: MessagingSidebarProps) => {
);
};
export default MessagingSidebar;
export default SupportSidebar;
+2 -2
View File
@@ -28,7 +28,7 @@ import Specification from './Specification';
import Chip from './Chip';
import CategoryCard from './CategoryCard';
import TemplateCard from './TemplateCard';
import MessagingSidebar from './MessagingSidebar';
import SupportSidebar from './SupportSidebar';
export {
Button,
@@ -61,5 +61,5 @@ export {
Chip,
CategoryCard,
TemplateCard,
MessagingSidebar,
SupportSidebar,
};