-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor. Use skeleton loaders. Clean up styling.
- Loading branch information
Showing
29 changed files
with
256 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
frontend/src/components/behandling/behandlingsdialog/medunderskriver/skeleton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Skeleton } from '@navikt/ds-react'; | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
const SkeletonContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--a-spacing-3); | ||
`; | ||
|
||
export const SKELETON = ( | ||
<SkeletonContainer> | ||
<Skeleton variant="text" width="125px" /> | ||
<Skeleton variant="rounded" width="100%" height="32px" /> | ||
</SkeletonContainer> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
frontend/src/components/behandling/behandlingsdialog/messages/skeleton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Skeleton } from '@navikt/ds-react'; | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
const SkeletonContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--a-spacing-3); | ||
`; | ||
|
||
export const SKELETON = ( | ||
<SkeletonContainer> | ||
<Skeleton variant="text" width="125px" height="24px" /> | ||
<Skeleton variant="rounded" width="100%" height="62px" /> | ||
<Skeleton variant="rounded" width="164px" height="34px" /> | ||
</SkeletonContainer> | ||
); |
3 changes: 2 additions & 1 deletion
3
frontend/src/components/behandling/behandlingsdialog/messages/styled-components.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 22 additions & 1 deletion
23
frontend/src/components/common-table-components/hjemmel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,30 @@ | ||
import React from 'react'; | ||
import { LoadingCellContent } from '@app/components/common-table-components/loading-cell-content'; | ||
import { useInnsendingshjemmelFromId } from '@app/hooks/use-kodeverk-ids'; | ||
import { LabelMain } from '@app/styled-components/labels'; | ||
|
||
interface Props { | ||
hjemmel: string | null; | ||
} | ||
|
||
export const Hjemmel = ({ hjemmel }: Props) => <LabelMain>{useInnsendingshjemmelFromId(hjemmel)}</LabelMain>; | ||
export const Hjemmel = ({ hjemmel }: Props) => { | ||
if (hjemmel === null) { | ||
return null; | ||
} | ||
|
||
return <ResolvedHjemmel hjemmel={hjemmel} />; | ||
}; | ||
|
||
interface ResolvedProps { | ||
hjemmel: string; | ||
} | ||
|
||
const ResolvedHjemmel = ({ hjemmel }: ResolvedProps) => { | ||
const hjemmelName = useInnsendingshjemmelFromId(hjemmel); | ||
|
||
if (hjemmelName === undefined) { | ||
return <LoadingCellContent />; | ||
} | ||
|
||
return <LabelMain>{hjemmelName}</LabelMain>; | ||
}; |
Oops, something went wrong.