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
import ForgeUI, { ModalDialog, Form, TextField } from "@forge/ui"; | |
import { storage } from "@forge/api"; | |
import uuid from "uuid-random"; | |
export const BookDialog = ({ | |
isOpenModal, | |
setOpenModal, | |
isUpdating, | |
selectedBook, | |
}) => { |
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
import ForgeUI, { | |
Fragment, | |
Text, | |
Table, | |
Head, | |
Row, | |
Cell, | |
Button, | |
ButtonSet, | |
useState, |
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
<BooksTable | |
isOpenModal={isOpenModal} | |
setOpenModal={setOpenModal} | |
setUpdating={setUpdating} | |
setSelectedBook={setSelectedBook} | |
/> | |
<BookDialog | |
isOpenModal={isOpenModal} | |
setOpenModal={setOpenModal} | |
isUpdating={isUpdating} |
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
const [isUpdating, setUpdating] = useState(false); | |
const [selectedBook, setSelectedBook] = useState(undefined); |
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
import ForgeUI, { render, Fragment, Macro, useState } from "@forge/ui"; | |
import { BooksTable } from "./BooksTable"; | |
import { BookDialog } from "./BookDialog"; | |
const App = () => { | |
const [isOpenModal, setOpenModal] = useState(false); | |
return ( | |
<Fragment> | |
<BooksTable isOpenModal={isOpenModal} setOpenModal={setOpenModal} /> | |
<BookDialog isOpenModal={isOpenModal} setOpenModal={setOpenModal} /> |
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
import ForgeUI, { | |
Fragment, | |
Text, | |
Table, | |
Head, | |
Row, | |
Cell, | |
Button, | |
ButtonSet, | |
useState, |
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
import ForgeUI, { ModalDialog, Form, TextField } from "@forge/ui"; | |
import { storage } from "@forge/api"; | |
import uuid from "uuid-random"; | |
export const BookDialog = ({ isOpenModal, setOpenModal }) => { | |
const onSubmit = async (formData) => { | |
const bookId = "book_" + uuid(); | |
await storage.set(bookId, formData); | |
setOpenModal(false); | |
}; |
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
permissions: | |
scopes: | |
- "storage:app" |
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
import ForgeUI, { render, Fragment, Macro, useState } from "@forge/ui"; | |
import { BooksTable } from "./BooksTable"; | |
import { BookDialog } from "./BookDialog"; | |
const App = () => { | |
const [isOpenModal, setOpenModal] = useState(false); | |
const [books, setBooks] = useState([]); | |
return ( | |
<Fragment> |
NewerOlder