✨ Ved lagring av redigering lukkes modal
This commit is contained in:
		
							parent
							
								
									89954388b4
								
							
						
					
					
						commit
						44e9ccb26c
					
				
					 4 changed files with 12 additions and 14 deletions
				
			
		|  | @ -56,6 +56,7 @@ const FeilKort = (props: IFeilKort) => { | |||
|                         haster={props.haster} | ||||
|                         arbeidsstatus={props.arbeidsstatus} | ||||
|                         setRedigeringsmodus={setRedigeringsmodus} | ||||
|                         setVisModal={setVisModal} | ||||
|                     /> | ||||
|                 :  | ||||
|                     <FeilmeldingsInnhold | ||||
|  |  | |||
|  | @ -1,15 +1,8 @@ | |||
| import { PencilIcon, XMarkIcon } from "@navikt/aksel-icons" | ||||
| import { Button } from "@navikt/ds-react" | ||||
| import { IFeilmelding } from "../interface" | ||||
| import { FeilmeldingsInnholdInterface } from "../interface" | ||||
| import FeilkortHeader from "./FeilkortHeader" | ||||
| 
 | ||||
| 
 | ||||
| interface FeilmeldingsInnholdInterface extends IFeilmelding { | ||||
|     children: React.ReactNode | ||||
|     setVisModal: (visModal: boolean) => void | ||||
|     setRedigeringsmodus: (redigeringsmodus: boolean) => void | ||||
| } | ||||
| 
 | ||||
| const FeilmeldingsInnhold = (props: FeilmeldingsInnholdInterface) => { | ||||
|     return( | ||||
|         <div> | ||||
|  | @ -34,7 +27,7 @@ const FeilmeldingsInnhold = (props: FeilmeldingsInnholdInterface) => { | |||
|                         onClick={() => { | ||||
|                             props.setVisModal(false) | ||||
|                             props.setRedigeringsmodus(false) | ||||
|                         }} | ||||
|                         } } | ||||
|                     > | ||||
|                         Lukk | ||||
|                     </Button> | ||||
|  |  | |||
|  | @ -1,20 +1,18 @@ | |||
| import { FloppydiskIcon, XMarkIcon } from "@navikt/aksel-icons" | ||||
| import { TextField, Textarea, RadioGroup, Radio, Button } from "@navikt/ds-react" | ||||
| import { useState } from "react" | ||||
| import { IFeilmelding } from "../interface" | ||||
| import { FeilmeldingsInnholdInterface } from "../interface" | ||||
| import axios from "axios" | ||||
| 
 | ||||
| interface RedigeringsInterface extends IFeilmelding { | ||||
|     setRedigeringsmodus: (redigeringsmodus: boolean) => void | ||||
| } | ||||
| 
 | ||||
| const RedigeringsVerktoy = (props: RedigeringsInterface) => { | ||||
| const RedigeringsVerktoy = (props: FeilmeldingsInnholdInterface) => { | ||||
|     const [tittel, setTittel] = useState(props.tittel) | ||||
|     const [beskrivelse, setBeskrivelse] = useState(props.beskrivelse) | ||||
|     const [arbeidsstatus, setArbeidsstatus] = useState(props.arbeidsstatus) | ||||
|     const [haster, setHaster] = useState(props.haster) | ||||
| 
 | ||||
|     const lagreEndringer = () => { | ||||
|         props.setVisModal(false) | ||||
|         props.setRedigeringsmodus(false) | ||||
| 
 | ||||
|         const payload = { | ||||
|  |  | |||
|  | @ -12,6 +12,12 @@ export interface IFeilmelding { | |||
|     arbeidsstatus: number | ||||
| } | ||||
| 
 | ||||
| export interface FeilmeldingsInnholdInterface extends IFeilmelding { | ||||
|     children?: React.ReactNode | ||||
|     setRedigeringsmodus: (redigeringsmodus: boolean) => void | ||||
|     setVisModal: (visModal: boolean) => void | ||||
| } | ||||
| 
 | ||||
| export class Feilmelding implements IFeilmelding { | ||||
|     id: number = 0 | ||||
|     tittel: string = "default tittel" | ||||
|  |  | |||
		Reference in a new issue
	
	 Markus Johansen
						Markus Johansen