-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add remove llama model setting (#71)
* use general confirmation dialog instead of just for DeleteConfirm Signed-off-by: cbh778899 <[email protected]> * add deleteModel function Signed-off-by: cbh778899 <[email protected]> * update styles Signed-off-by: cbh778899 <[email protected]> * move to ConfirmationDialog component Signed-off-by: cbh778899 <[email protected]> * add ButtonComponent for one-click settings Signed-off-by: cbh778899 <[email protected]> * add validation for current selected item Signed-off-by: cbh778899 <[email protected]> * implement delete model function Signed-off-by: cbh778899 <[email protected]> --------- Signed-off-by: cbh778899 <[email protected]>
- Loading branch information
Showing
13 changed files
with
214 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useEffect, useRef } from "react"; | ||
|
||
export default function ConfirmationDialog({children, open_status, setOpenStatus, callback}) { | ||
const dialogRef = useRef(null); | ||
|
||
useEffect(()=>{ | ||
if(dialogRef.current) { | ||
if(open_status) dialogRef.current.showModal(); | ||
else dialogRef.current.close(); | ||
} | ||
}, [open_status]) | ||
|
||
return ( | ||
<dialog className="confirmation-dialog" ref={dialogRef} onClose={()=>setOpenStatus(false)}> | ||
{ children } | ||
<div | ||
className="button clickable" | ||
onClick={()=>callback(true)} | ||
>Yes, Continue</div> | ||
<div | ||
className="button clickable" | ||
onClick={()=>callback(false)} | ||
>No, Go Back</div> | ||
</dialog> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default function ButtonComponent({ cb, value, disabled, title, description, className }) { | ||
return ( | ||
<div className="component"> | ||
<div className="title">{title}</div> | ||
{ description && <div className="description">{description}</div> } | ||
<div className={`main-part button ${className||''}${disabled ? ' disabled':""}`} onClick={cb}>{ value }</div> | ||
</div> | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.confirmation-dialog { | ||
border: 2px solid black; | ||
padding: 30px; | ||
border-radius: 10px; | ||
text-align: center; | ||
max-width: 60%; | ||
} | ||
|
||
.confirmation-dialog > .button { | ||
border-bottom: 1px solid; | ||
width: fit-content; | ||
margin: auto; | ||
margin-top: 7px; | ||
padding: 0px 7px; | ||
color: rgb(70, 70, 70); | ||
} | ||
|
||
.confirmation-dialog > .button:hover { | ||
color: black; | ||
} |
Oops, something went wrong.