-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: delete AltinnContentIcon (#13893)
- Loading branch information
Showing
2 changed files
with
10 additions
and
30 deletions.
There are no files selected for viewing
21 changes: 0 additions & 21 deletions
21
frontend/packages/shared/src/components/atoms/AltinnContentIcon.tsx
This file was deleted.
Oops, something went wrong.
19 changes: 10 additions & 9 deletions
19
frontend/packages/shared/src/components/molecules/AltinnContentLoader.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,23 +1,24 @@ | ||
import React from 'react'; | ||
import React, { type ReactNode } from 'react'; | ||
import type { IContentLoaderProps } from 'react-content-loader'; | ||
import ContentLoader from 'react-content-loader'; | ||
import AltinnContentIconComponent from '../atoms/AltinnContentIcon'; | ||
|
||
export type IAltinnContentLoaderProps = { | ||
/** The height of the loader, defaults to 200 */ | ||
height?: number; | ||
/** The width of the loader, defaults to 400 */ | ||
width?: number; | ||
children: ReactNode; | ||
} & IContentLoaderProps; | ||
|
||
export const AltinnContentLoader = (props: React.PropsWithChildren<IAltinnContentLoaderProps>) => { | ||
export const AltinnContentLoader = ({ | ||
height, | ||
width, | ||
children, | ||
...rest | ||
}: IAltinnContentLoaderProps) => { | ||
return ( | ||
<ContentLoader | ||
height={props.height ? props.height : 200} | ||
width={props.width ? props.width : 400} | ||
{...props} | ||
> | ||
{props.children ? props.children : <AltinnContentIconComponent />} | ||
<ContentLoader height={height ? height : 200} width={width ? width : 400} {...rest}> | ||
{children} | ||
</ContentLoader> | ||
); | ||
}; |