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

Toggle switch #1321

Merged
merged 15 commits into from
Aug 23, 2022
Merged

Toggle switch #1321

merged 15 commits into from
Aug 23, 2022

Conversation

camertron
Copy link
Contributor

@camertron camertron commented Aug 18, 2022

This PR moves the ToggleSwitch component out of dotcom and into PVC. Along for the ride are the following new features:

  1. JavaScript behavior! When a ToggleSwitch is toggled, it will now make a POST request to the configured src.
  2. A spinner has been added to indicate when a POST request is in-flight.
  3. An error icon is displayed if the POST request fails.

Off

image

On

image

Toggling off

image

Toggling on

image

On error

image

@changeset-bot
Copy link

changeset-bot bot commented Aug 18, 2022

🦋 Changeset detected

Latest commit: a2ecb78

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

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

@camertron camertron temporarily deployed to github-pages August 18, 2022 21:10 Inactive
@camertron camertron temporarily deployed to github-pages August 18, 2022 21:28 Inactive
@camertron camertron temporarily deployed to github-pages August 18, 2022 21:36 Inactive
@camertron camertron temporarily deployed to github-pages August 18, 2022 22:58 Inactive
@camertron camertron temporarily deployed to github-pages August 18, 2022 23:34 Inactive
@camertron camertron temporarily deployed to github-pages August 19, 2022 02:37 Inactive
@camertron camertron marked this pull request as ready for review August 19, 2022 21:11
@camertron camertron requested review from a team and keithamus August 19, 2022 21:11
@camertron camertron temporarily deployed to github-pages August 19, 2022 21:15 Inactive
@jonrohan jonrohan requested a review from neall August 22, 2022 17:58
@jonrohan jonrohan enabled auto-merge (squash) August 23, 2022 22:34
@jonrohan jonrohan temporarily deployed to github-pages August 23, 2022 22:41 Inactive
@jonrohan jonrohan merged commit f18ef0f into main Aug 23, 2022
@jonrohan jonrohan deleted the toggle_switch branch August 23, 2022 22:46
@primer-css primer-css mentioned this pull request Aug 23, 2022
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.

4 participants