funkhaus / fh-components

Reusable components for Vue + Vuehaus
18 stars 1 forks source link

mailing-list enhancements #107

Open SaFrMo opened 5 years ago

SaFrMo commented 5 years ago

From @drewbaker :

Normally clients want it to show X times before never showing again for Y days, and if they have submitted it successfully, then never show again. But then often times we'd use the same component on the contact page, or in a menu, so we need a way to force show it too.

drewbaker commented 5 years ago

And we need to be able to "always show" the same component, like if it's used in the footer o a contact page, or there is a "subscribe" button in the menu that anyone can click.

johndigital commented 5 years ago

Does it make sense to have logic setting cookies and localstorage on this component? Seems like we should split out that type of functionality into a road-block component or something like that. mailing-list was really just intended to deal with relaying info back and forth from Mailchimp or other newsletter services and parsing the responses in a uniform way.

Since a mailing list doesn't always have to live within a roadblock but often can, I imagine we could set it up as 2 components and then do this easily:

<road-block timesToShow="3" removeOnSuccess >
  <mailing-list />
</road-block>

That way pretty much anything can go in the roadblock and it only deals with the logic of cookies, repeated use, etc.

Relatedly, I have also struggled a bit with the way mailing-list is set up. The markup is difficult to control because it's hard-coded in the component. The slots help but I rarely get it to look exactly the way it should without some weird hacking. Have you guys experienced the same thing? Would it make more sense as a mixin that only really handles the logic and not the template?

drewbaker commented 5 years ago

I agree that <road-block as it's own component makes a lot more sense. That would be way more flexible, and we could put anything in it (like an age-checker). Lets do that!

I think the <mailing-list> component is good. I've told design team to only design a mailing list form that is basically the same all the time, so it's worked great. John is if it's Funkhaus work, feel free to change the design a little (or have the team do it). I'd rather that than hacky stuff.