ExclusiveContent component... what to do with it?
ekafyi opened this issue Β· comments
I made this component before I realized react-web-monetization library has these conditional components IfWebMonetized
and IfNotWebMonetized
. π€¦π½ββοΈ
That said, I like the idea of one single component where we can optionally pass the "if not web monetized" content as a prop, eg. to use with MDX in a Gatsby site/theme.
Example in an MDX page:
---
title: Some post
---
Regular content everyone can see.
## Appealing subtitle for exclusive web monetized section
<!-- with ExclusiveContent -->
<ExclusiveContent>
This content here is super special monetized content!
</ExclusiveContent>
<!-- with IfWebMonetized & IfNotWebMonetized -->
<IfWebMonetized>
This content here is super special monetized content!
</IfWebMonetized>
<IfNotWebMonetized>
<strong>βοΈ This content is for web monetized users only</strong>
... additional information & call to action
</IfNotWebMonetized>
Does this conciseness justify having a component that actually works the same way as existing components? π€
Or, alternatively, since the potentially repetitive code is just in the IfNotWebMonetized
part, we can make a component that wraps it, with props for title, body message, and CTA (like current ExclusiveContent component's inactive
props)?
Also, name-wise, is there a better name alternative to ExclusiveContent
? We should NOT use WebMonetizedContent
because it's not accurate; the whole page may be monetized (not just this particular content). The more accurate term would be WebMonetizedExclusiveContent
but it's ridiculously long(?).
TO DO NOW: Decide whether to keep or remove this component
- If keeping, decide whether to change the name (and what the new name should be).
- If removing, decide whether to create a new component for the "not web monetized" state.