manual improvement 2 & add telegram bot
This commit is contained in:
@@ -4,19 +4,30 @@ import { useTranslations } from 'next-intl';
|
||||
import { NotificationBell } from '@/components/notifications';
|
||||
import { ROUTES } from '@/constants';
|
||||
import { LinkToPage } from '@/utils';
|
||||
import { useNurseRequestInbox } from '@/services/bookingRequests';
|
||||
import { useSupportUnreadTotal } from '@/services/tickets';
|
||||
import MobileShell from './MobileShell';
|
||||
|
||||
/**
|
||||
* Nurse app shell — the "نمای پرستار" workspace. Four bottom-nav destinations, one per group the
|
||||
* sidebar used to hide behind a hamburger: امروز (the operational home), حرفهٔ من, مالی, and a
|
||||
* بیشتر hub carrying support, notifications and settings. The identity card that lived in the
|
||||
* drawer header now opens from that hub, where it can be read rather than glanced at.
|
||||
* Nurse app shell — the "نمای پرستار" workspace. Five bottom-nav destinations: امروز (the
|
||||
* operational home), درخواستها, حرفهٔ من, مالی, and a بیشتر hub carrying support, notifications and
|
||||
* settings.
|
||||
*
|
||||
* **درخواستها is a tab, not a link.** It was previously reachable only from a strip on the
|
||||
* dashboard — which meant the one screen in the whole nurse app with a *deadline* on it (a pending
|
||||
* request expires unanswered) lived one tab-plus-a-scroll away, and had no way to signal that
|
||||
* something was waiting from anywhere else in the app. As a tab it carries the pending count as a
|
||||
* badge, so the nurse sees the queue filling up from any screen. The inbox query is the same cached
|
||||
* one the dashboard strip and the inbox page already read — no extra request.
|
||||
*
|
||||
* Identity lives in the «بیشتر» hub only — never in the top bar. One tap from any screen via the
|
||||
* nav is close enough for a preference-and-account surface, and the header stays a title bar.
|
||||
* @layout NurseLayout
|
||||
*/
|
||||
const NurseLayout: FunctionComponent<PropsWithChildren> = ({ children }) => {
|
||||
const t = useTranslations('nav');
|
||||
const supportUnreadTotal = useSupportUnreadTotal();
|
||||
const { data: pendingRequests } = useNurseRequestInbox();
|
||||
|
||||
const tabs: Array<LinkToPage> = useMemo(
|
||||
() => [
|
||||
@@ -25,6 +36,12 @@ const NurseLayout: FunctionComponent<PropsWithChildren> = ({ children }) => {
|
||||
path: ROUTES.NURSE,
|
||||
icon: 'today',
|
||||
},
|
||||
{
|
||||
title: t('requests'),
|
||||
path: ROUTES.NURSE_REQUESTS,
|
||||
icon: 'requests',
|
||||
badgeCount: pendingRequests?.total || undefined,
|
||||
},
|
||||
{
|
||||
title: t('group_profession'),
|
||||
path: ROUTES.NURSE_PRACTICE,
|
||||
@@ -50,7 +67,7 @@ const NurseLayout: FunctionComponent<PropsWithChildren> = ({ children }) => {
|
||||
badgeCount: supportUnreadTotal ?? undefined,
|
||||
},
|
||||
],
|
||||
[t, supportUnreadTotal]
|
||||
[t, supportUnreadTotal, pendingRequests]
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user