-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: page reorder with toasts notifications
- Loading branch information
Showing
11 changed files
with
99 additions
and
41 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
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 @@ | ||
import Toast from 'react-bootstrap/Toast'; | ||
|
||
type Args = { | ||
text: string; | ||
} | ||
|
||
function Message({text}: Args) { | ||
return ( | ||
<Toast> | ||
<div className='d-flex'> | ||
<div className='toast-body'> | ||
{text} | ||
</div> | ||
<button type="button" className="btn-close me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button> | ||
</div> | ||
</Toast> | ||
); | ||
} | ||
|
||
export default Message; |
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,15 @@ | ||
import ToastContainer from 'react-bootstrap/ToastContainer'; | ||
import Message from './Message'; | ||
|
||
|
||
function NotificationsContainer() { | ||
return ( | ||
<ToastContainer position='bottom-end'> | ||
<Message text={"Message 1"} /> | ||
<Message text={"Message 2"} /> | ||
<Message text={"Message 3"} /> | ||
</ToastContainer> | ||
); | ||
} | ||
|
||
export default NotificationsContainer; |
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import type { PageAndRotOp, PageType } from "types"; | ||
import { fetcher_post } from "utils/fetcher"; | ||
|
||
|
||
export async function apply_page_op_changes( | ||
pages: PageAndRotOp[] | ||
): Promise<PageType[]> { | ||
return fetcher_post<PageAndRotOp[], PageType[]>('/pages/reorder', pages); | ||
export async function apply_page_op_changes<In, Out>( | ||
pages: In | ||
): Promise<Out> { | ||
return fetcher_post<In, Out>('/api/pages/', pages); | ||
} |