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

Add icon buttons #3589

Merged
merged 9 commits into from
Aug 12, 2024
Merged

Add icon buttons #3589

merged 9 commits into from
Aug 12, 2024

Conversation

tinykite
Copy link
Contributor

@tinykite tinykite commented Aug 8, 2024

What this does

  • Adds a new component, IconButton for use with many of the standalone icon buttons throughout Perma:
image
  • Adds a new css class, c-button--icon to style them.

Notes

A small handful of the icons used on the Perma Dashboard are from Font Awesome. Others don't appear to be — for example, the Perma dashboard licenses Font Awesome 3.0.2, which includes a much chunkier chevron style than the one featured throughout the dashboard.

This component intends to make it easy to use:

  • Font Awesome icons (which rely on an icon font)
  • New, svg versions of the 18x9px up and down chevrons. These should resize gracefully, and can be stylized however we need, as an improvement on the original base-64 encoded png in use.

Linear Issue

Satisfies LIL-2312

Screenshot

image

How to test

  • To test this out, you'll need to enable both the vue-dashboard and developer-playground Django flags
  • Once both flags are enabled (either through a query parameter or through the Django admin) you should be able to see several buttons just above the GUI developer playground editing UI.
  • Clicking any of the buttons should console.log the name of each button.

Comment on lines 16 to 17
return ["download-alt", "plus", "edit", "trash", "chevron-down", "chevron-up"].includes(value);
},
Copy link
Contributor Author

@tinykite tinykite Aug 8, 2024

Choose a reason for hiding this comment

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

I didn't include "search" as one of the icon options here because it differs in more than a couple of ways in use from these other icons — it's a smaller size, etc.

It should be easy to add it (and any others) in if we decide to reuse the IconButton component within the search functionality on the page.

Copy link

codecov bot commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.03%. Comparing base (1dbeec8) to head (8b14ea6).
Report is 26 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3589   +/-   ##
========================================
  Coverage    69.03%   69.03%           
========================================
  Files           48       48           
  Lines         6978     6978           
========================================
  Hits          4817     4817           
  Misses        2161     2161           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tinykite tinykite changed the title Add action buttons Add icon buttons Aug 12, 2024
@tinykite tinykite marked this pull request as ready for review August 12, 2024 14:54
@tinykite tinykite requested a review from a team as a code owner August 12, 2024 14:54
@tinykite tinykite requested review from cmsetzer and removed request for a team August 12, 2024 14:54
Copy link
Contributor

@cmsetzer cmsetzer left a comment

Choose a reason for hiding this comment

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

Good idea to abstract this into a component!

@tinykite tinykite merged commit bd0e967 into harvard-lil:develop Aug 12, 2024
2 checks passed
@tinykite tinykite deleted the add-action-buttons branch August 12, 2024 20:02
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.

2 participants