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

Feature: Add Support for position, avatar, and opacity Props in VLibras Widget #9

Closed
lucasferreiralimax opened this issue Oct 24, 2024 · 0 comments · Fixed by #10
Closed
Assignees
Labels
enhancement New feature or request hacktoberfest

Comments

@lucasferreiralimax
Copy link
Member

lucasferreiralimax commented Oct 24, 2024

Currently, the VLibras widget integration within the component supports basic initialization, but there is no support for customizing the widget's position, avatar, and opacity settings. These features are necessary to allow better control over the widget’s appearance and behavior.

Proposal:

Add the following props to the component:

  • position: Specifies the location of the widget on the screen. It should support the following values:
    • 'left', 'right', 'bottom', 'top', 'bottom-left', 'top-left', 'bottom-right', 'top-right'
    • Default: 'right'
  • avatar: Determines which avatar will be displayed in the widget. Supported values:
    • 'icaro', 'hosana', 'guga', 'random'
    • Default: 'random'
  • opacity: Sets the opacity of the widget, allowing values from 0 to 1.
    • Default: 1.0

These props would be mapped to the VLibras widget's internal API as follows:

new window.VLibras.Widget({
  url: props.urlWidget,
  position: mapPosition[props.position],
  avatar: props.avatar,
  opacity: props.opacity,
});

Benefits:

  • Flexibility: Users will have more control over where the widget is displayed and its appearance.
  • Customization: By allowing the selection of avatar and opacity, users can tailor the widget to fit their specific UI needs.

Tasks:

  1. Add position, avatar, and opacity props with default values and validators.
  2. Map the props to the correct internal VLibras widget options.
  3. Update the widget initialization to reflect the new customizations.
  4. Document the new props in the component’s README.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant