Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialogs in custom hook #286

Open
basmasking opened this issue Jun 21, 2024 · 0 comments
Open

Dialogs in custom hook #286

basmasking opened this issue Jun 21, 2024 · 0 comments
Labels
chore web-ui All issues related to the web user interface

Comments

@basmasking
Copy link
Member

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.

@basmasking basmasking added web-ui All issues related to the web user interface chore labels Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore web-ui All issues related to the web user interface
Projects
None yet
Development

No branches or pull requests

1 participant