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

feat: rating button #2820

Merged
merged 9 commits into from
Jun 15, 2023
Merged

feat: rating button #2820

merged 9 commits into from
Jun 15, 2023

Conversation

dkacper
Copy link
Contributor

@dkacper dkacper commented Jun 13, 2023

Related issue

Closes SFUI2-673

Scope of work

This PR adds new base component – SfRatingButton.

Screenshots of visual changes

rating button

Checklist

  • Self code-reviewed
  • Changes documented
  • Semantic HTML
  • SSR-friendly
  • Caching friendly
  • a11y for WCAG 2.0 AA
  • examples created
  • blocks created
  • cypress tests created

@changeset-bot
Copy link

changeset-bot bot commented Jun 13, 2023

⚠️ No Changeset found

Latest commit: 47bea10

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@Szymon-dziewonski Szymon-dziewonski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR !

For vue sizes are not selected and for react all are selected, can we please have it unified
Vue
image

React
image

Comment on lines +55 to +59
const iconSize: Record<SfRatingButtonSize, SfRatingButtonIconSize> = {
[SfRatingButtonSize.sm]: SfIconSize.base,
[SfRatingButtonSize.base]: SfIconSize.lg,
[SfRatingButtonSize.lg]: SfIconSize.xl,
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can extract this outside component as well

Comment on lines 10 to 21
interface Props {
value?: number;
onChange?: (value: number) => void;
max?: number;
name?: string;
disabled?: boolean;
label?: string;
labelClassName?: string;
size?: `${SfRatingButtonSize}`;
getLabelText?: (value: number) => string;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@FRSgit FRSgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good from my side!

@sonarcloud
Copy link

sonarcloud bot commented Jun 15, 2023

[storefront-ui-react] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

95.7% 95.7% Coverage
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Jun 15, 2023

[storefront-ui-vue] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

93.3% 93.3% Coverage
0.0% 0.0% Duplication

@dkacper dkacper merged commit 5a13fef into v2-develop Jun 15, 2023
13 checks passed
@dkacper dkacper deleted the feat/sfui2-673-rating-button branch June 15, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants