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

Create a new CustomLabelTag component #96

Closed
7 of 9 tasks
uparkalau opened this issue Jul 4, 2024 · 0 comments
Closed
7 of 9 tasks

Create a new CustomLabelTag component #96

uparkalau opened this issue Jul 4, 2024 · 0 comments
Assignees
Labels
frontend Frontend task/issue

Comments

@uparkalau
Copy link
Contributor

uparkalau commented Jul 4, 2024

We need to create a new CustomLabelTag component that aligns with our project's design system and can be reused across our application. This component should be versatile enough to handle different types of labels.

To-Do List

  • Create a new branch from the develop branch specifically for this task. feature/96-create-a-new-customlabeltag-component @SimerdeepSinghGrewal
  • Develop the CustomLabelTag component to accept props such as:
    • Label text content
    • Background color (from predefined options)
    • Text color (optional)
    • Additional styles or classes as necessary
  • The CustomLabelTag component should support various UI contexts by allowing different shapes like rounded or squared edges.
  • Use import Chip from '@material-ui/core/Chip';
  • Create ./CustomLabelTagStyles.css with default styling.
  • Define PropTypes
  • Use default JavaScript parameters to set up default props within the CustomLabelTag component.
  • Integrate this new CustomLabelTag component into appropriate places within our application where labels are required.
  • Create a minimum test using vitest for this component.

PropTypes Example, adjust as necessary:

const validateBackgroundColor = (props, propName, componentName) => {
  if (!['orange', 'red', 'purple', 'white'].includes(props[propName])) {
    return new Error(
      `Invalid prop \`${propName}\` supplied to \`${componentName}\`. Validation failed.`
    );
  }
}


CustomLabelTag.propTypes = {
  text: PropTypes.string.isRequired,
  backgroundColor: validateBackgroundColor,
  textColor: PropTypes.string,
  className: PropTypes.string,
};

https://www.figma.com/design/USQRG7Oacv7uXw8XkTPINq/Style-guide?node-id=48-52733&t=nNFDTU9Sv5F8SXq9-0

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Frontend task/issue
Projects
None yet
Development

No branches or pull requests

3 participants