Skip to content

Commit

Permalink
🔥 TYPOOOOO
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrognes committed Oct 6, 2023
1 parent abdca87 commit eaa4e03
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/aap-felles-react/src/FileInput/FileInput.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, StoryFn } from '@storybook/react';

import { FileInput, FileInputProps, Vedleggg } from './FileInput';
import { FileInput, FileInputProps, Vedlegg } from './FileInput';
import React, { useState } from 'react';

// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
Expand All @@ -10,7 +10,7 @@ export default {
} as Meta;

export const Primary: StoryFn<FileInputProps> = (args) => {
const [files, setFiles] = useState<Vedleggg[]>([]);
const [files, setFiles] = useState<Vedlegg[]>([]);
return (
<FileInput
{...args}
Expand Down
4 changes: 2 additions & 2 deletions packages/aap-felles-react/src/FileInput/FileInput.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { enableFetchMocks } from 'jest-fetch-mock';
import { v4 as uuidV4 } from 'uuid';
import React, { ReactElement, useState } from 'react';
import { FileInput, FileInputProps, Vedleggg } from './FileInput';
import { FileInput, FileInputProps, Vedlegg } from './FileInput';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';

import userEvent from '@testing-library/user-event';
Expand Down Expand Up @@ -211,7 +211,7 @@ export function FileInputWithState(
'onChange' | 'uploadUrl' | 'heading' | 'id' | 'deleteUrl' | 'onUpload' | 'onDelete' | 'files'
>
): ReactElement {
const [files, setFiles] = useState<Vedleggg[]>([]);
const [files, setFiles] = useState<Vedlegg[]>([]);

return (
<FileInput
Expand Down
12 changes: 6 additions & 6 deletions packages/aap-felles-react/src/FileInput/FileInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import { FilePanelSuccess } from './FilePanelSuccess';
export interface FileInputProps extends InputHTMLAttributes<HTMLInputElement> {
heading: string;
id: string;
onUpload: (attachments: Vedleggg[]) => void;
onDelete: (attachment: Vedleggg) => void;
onUpload: (attachments: Vedlegg[]) => void;
onDelete: (attachment: Vedlegg) => void;
deleteUrl: string;
uploadUrl: string;
files: Vedleggg[];
files: Vedlegg[];
ingress?: string;
}

export interface Vedleggg {
export interface Vedlegg {
id: string;
errorMessage?: string;
size: number;
Expand Down Expand Up @@ -46,10 +46,10 @@ export const FileInput = (props: FileInputProps) => {

async function validateAndSetFiles(filelist: FileList) {
setIsUploading(true);
const uploadedFiles: Vedleggg[] = await Promise.all(
const uploadedFiles: Vedlegg[] = await Promise.all(
Array.from(filelist).map(async (file) => {
const internalErrorMessage = internalValidate(file);
let uploadResult: Vedleggg = {
let uploadResult: Vedlegg = {
id: uuidV4(),
errorMessage: '',
type: file.type,
Expand Down
4 changes: 2 additions & 2 deletions packages/aap-felles-react/src/FileInput/FilePanelError.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { BodyShort, Label, Panel } from '@navikt/ds-react';
import { ArrowUndoIcon, FileTextIcon } from '@navikt/aksel-icons';
import React from 'react';
import { Vedleggg } from './FileInput';
import { Vedlegg } from './FileInput';

interface Props {
file: Vedleggg;
file: Vedlegg;
deleteUrl: string;
onDelete: () => void;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/aap-felles-react/src/FileInput/FilePanelSuccess.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { CheckmarkIcon, XMarkIcon } from '@navikt/aksel-icons';
import { BodyShort, Detail, Link, Panel } from '@navikt/ds-react';
import React from 'react';
import { Vedleggg } from './FileInput';
import { Vedlegg } from './FileInput';

interface Props {
file: Vedleggg;
file: Vedlegg;
onDelete: () => void;
}

Expand Down

0 comments on commit eaa4e03

Please sign in to comment.