Open SaFrMo opened 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.
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?
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.
From @drewbaker :
timesToShow
prop to show X times before hiding forcookieLength
daysremoveOnSuccess
prop to hide permanently on success