Skip to content

Dialogs in custom hook #286

Description

@basmasking

In the PostDetails feature we have a dialog for the user when (s)he tries to delete a post with a confirmation message. The logic for this is still defined in the Feature itself and not in a hook.

const deletePost = useCallback(async (post: PostView) =>
{
    const panel = <ConfirmationPanel
        message='Are you sure you want to delete this post?'
        onConfirm={() => { closeModal(); removePost(post); }}
        onCancel={() => closeModal()} />;

    showModal(panel);

}, [showModal, closeModal, removePost]);

We want to have this logic in a custom hook, but we need to figure out how we can do this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreweb-uiAll issues related to the web user interface

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions