Skip to content

Commit

Permalink
Legg til antall uleste-varsel
Browse files Browse the repository at this point in the history
  • Loading branch information
tu55eladd committed Sep 4, 2023
1 parent cc6c4ef commit e11e829
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface DialogIkonUtenUlesteProps {
className?: string;
}

function DialogIkonUtenUleste(props: DialogIkonUtenUlesteProps) {
export function DialogIkonUtenUleste(props: DialogIkonUtenUlesteProps) {
const { className } = props;

return (
Expand Down
14 changes: 13 additions & 1 deletion src/moduler/verktoylinje/Navigasjonslinje.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ import { ARBEIDSRETTET_DIALOG_URL, MINSIDE_URL } from '../../constant';
import useAppDispatch from '../../felles-komponenter/hooks/useAppDispatch';
import loggEvent, { APNE_OM_TJENESTEN } from '../../felles-komponenter/utils/logging';
import { useErVeileder } from '../../Provider';
import { selectSistOppdatert } from '../dialog/dialog-selector';
import { selectDialogerData, selectSistOppdatert } from '../dialog/dialog-selector';
import { hentDialoger } from '../dialog/dialog-slice';
import { selectCanPrint } from '../feilmelding/feil-selector';
import DialogIkon, { DialogIkonUtenUleste } from '../aktivitet/visning/underelement-for-aktivitet/dialog/DialogIkon';

function Navigasjonslinje() {
const erVeileder = useErVeileder();
const sistOppdatert = useSelector(selectSistOppdatert, shallowEqual);
const antallUlesteDialoger = (useSelector(selectDialogerData) || []).filter(
(dialog) => !dialog.erLestAvBruker,
).length;

const dispatch = useAppDispatch();

Expand Down Expand Up @@ -51,6 +55,14 @@ function Navigasjonslinje() {
<Link href={MINSIDE_URL}>Min side</Link>
<Link href={ARBEIDSRETTET_DIALOG_URL}>
<span>Min dialog med veileder</span>
{antallUlesteDialoger > 0 ? (
<>
<DialogIkonUtenUleste />
<span className="relative no-underline right-2 bottom-1 bg-red-500 w-5 h-5 flex items-center justify-center rounded-full text-white">
{antallUlesteDialoger}
</span>
</>
) : null}
</Link>
</>
) : null}
Expand Down

0 comments on commit e11e829

Please sign in to comment.