Skip to content

Commit

Permalink
Ryddet opp
Browse files Browse the repository at this point in the history
  • Loading branch information
ebelegu committed Aug 25, 2023
1 parent ba7eddd commit 5795386
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 26 deletions.
31 changes: 12 additions & 19 deletions src/App/Hovedside/Sak/SakPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ import { BodyShort, Button, Detail, Heading } from '@navikt/ds-react';
import React, { useState } from 'react';
import './SaksListe.css';
import {
BeskjedIkon,
NyOppgaveIkon,
OppgaveUtfortIkon,
BeskjedIkon,
TidslinjeLinjeIkon,
TidslinjeLinjeIkonKort,
} from './OppgaveBeskjedIkoner';
import {
BeskjedTidslinjeElement,
OppgaveTidslinjeElement,
OppgaveTilstand,
Sak,
TidslinjeElement,
} from '../../../api/graphql-types';
import { LenkeMedLogging } from '../../../GeneriskeElementer/LenkeMedLogging';
import { StatusLinje } from '../../../GeneriskeElementer/StatusLinje';
import { Collapse, Expand } from '@navikt/ds-icons';
import { undefined } from 'zod';

export const dateFormat = new Intl.DateTimeFormat('no', {
year: 'numeric',
Expand All @@ -32,7 +32,7 @@ type SakPanelProps = {

export const SakPanel = ({
placeholder,
sak: { id, lenke, tittel, virksomhet, sisteStatus, tidslinje },
sak: { lenke, tittel, virksomhet, sisteStatus, tidslinje },
}: SakPanelProps) => {
const fake = placeholder ?? false;
const style: React.CSSProperties = fake ? { visibility: 'hidden' } : {};
Expand All @@ -59,7 +59,7 @@ export const SakPanel = ({
<div>
{tidslinje.map((tidslinjeelement, i) => (
<Tidslinjeelement
key={id}
key={tidslinjeelement.id}
tidslinjeelement={tidslinjeelement}
indeks={i}
apen={tidslinjeOpen}
Expand All @@ -73,16 +73,9 @@ export const SakPanel = ({
className='tidslinje-vis-mer-knapp'
variant='tertiary'
onClick={() => setTidslinjeOpen(!tidslinjeOpen)}
icon={tidslinjeOpen ? <Collapse/> : <Expand/>}
>
{tidslinjeOpen ? (
<div className='tidslinje-vis-mer'>
<Collapse /> <BodyShort> Vis mindre </BodyShort>
</div>
) : (
<div className='tidslinje-vis-mer'>
<Expand /> <BodyShort> Vis mer </BodyShort>
</div>
)}
{tidslinjeOpen ? <>Vis mindre</> : <>Vis mer</>}
</Button>
) : null}
</div>
Expand Down Expand Up @@ -172,12 +165,12 @@ const OppgaveElement = ({ tidslinjeelement, erSist, tidslinjeOpen }: Tidslinjeel
/>
</div>
<div className='tidslinje-linje'>
{erSist || !tidslinjeOpen ? null : frist === null &&
paaminnelseTidspunkt === null ? (
<TidslinjeLinjeIkonKort />
) : (
<TidslinjeLinjeIkon />
)}
{erSist || !tidslinjeOpen ? null
: (tilstand === OppgaveTilstand.Ny && frist === null && paaminnelseTidspunkt === null) ? (
<TidslinjeLinjeIkonKort />
) : (
<TidslinjeLinjeIkon />
)}
</div>
</div>
);
Expand Down
7 changes: 1 addition & 6 deletions src/App/Hovedside/Sak/SaksListe.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,7 @@ ul.saks-liste .sakscontainer .tidslinje-element {

.tidslinje-vis-mer-knapp{
max-width: 8rem;
padding: 8px 0 0 0 ;
}

.tidslinje-vis-mer {
display: flex;
gap: 8px;
padding: 8px 0 0 0;
}


5 changes: 5 additions & 0 deletions src/GeneriskeElementer/StatusLinje.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
align-items: center;
gap: 0.5ch;
}

.statuslinje_tekstmedikon {
display: flex;
gap: 4px;
}
2 changes: 1 addition & 1 deletion src/GeneriskeElementer/StatusLinje.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ type StatusIkonMedTekstProps = {
};

const StatusIkonMedTekst: FC<StatusIkonMedTekstProps> = ({ icon, className, children }) => (
<span className={className}>
<span className={`statuslinje_tekstmedikon ${className}`} >
{icon} {children}
</span>
);

0 comments on commit 5795386

Please sign in to comment.