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

ConditionalEmbed component #4

Open
nzambello opened this issue Dec 31, 2021 · 1 comment
Open

ConditionalEmbed component #4

nzambello opened this issue Dec 31, 2021 · 1 comment
Assignees
Milestone

Comments

@nzambello
Copy link
Member

Make a ConditionalEmbed component which, given a text containing the iframe or given a url, will show or not show its children according to the user's choices. If it does not show the children because the user has denied consent, it must display a message such as: message defined in the configuration + "Click here to enable them, or click here to change your preferences. ".

For example:

const ConditionalEmbed = ({embedCode, embedUrl, children})=>{
.....
 
return enabled
  ? <>{children}</>
  : (
    <div className="conditional-embed-message">
      {config.conditional_embed_text ?? defaultMessage}. Click <a href="" onClick=()=>{enableCookies()}>here</a>
       to enable them or click <a href="" onClick={openCookieBannerPref()}>here</a> to change your preferences.
    </div>
  );
}
@nzambello nzambello self-assigned this Dec 31, 2021
@nzambello
Copy link
Member Author

I'm thinking about renaming it in AllowedEmbed or something more semantic.

@nzambello nzambello added this to the First release milestone Dec 31, 2021
@nzambello nzambello moved this from To do to In progress in First implementation Dec 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant