#Is there a cleaner way to model this small popover?

1 messages · Page 1 of 1 (latest)

violet pivot
#

I have different actions depending on whether my popover is in the creation flow or details flow. The part that gets 'dirty' is when i'm in the popover > open state and i can switch between details or create. I may be overthinking things.

fair bolt
#

Can you explain the actions you'd like to add?

violet pivot
#

Certainly. With details, I'd like to update the context with an appointmentId that i'll be using to resolve the appointment details in the calendar.

context: {
  popover: {
    appointmentId?: number
    ... other variables like offset x | y 
  }
}

i was also hoping to use tags to help me figure out if I'm opening a details popover or a create popover. This way i'm able to render the correct component.

open: {
            states: {
              details: {
                tags: ["popoverDetails"],
              },
              create: {
                tags: ["popoverCreate"]
              },
            },

thinking about it out loud, it's making me wonder if I should just store details / create as a context variable...

fair bolt