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

[#8546] Style statistics #5750

Merged
merged 1 commit into from
Nov 19, 2024
Merged

[#8546] Style statistics #5750

merged 1 commit into from
Nov 19, 2024

Conversation

sevfurneaux
Copy link
Collaborator

Describe your changes
This PR styles the statistics box

Screenshot 2024-11-18 at 15 39 38

Tasks

  • PR name contains story or task reference
  • Steps to recreate and test the changes
  • Documentation (docs and inline)
  • Tests (including n+1 and django_assert_num_queries where applicable)
  • Changelog

@sevfurneaux sevfurneaux changed the title react/livequestions: style statistics [#8546] Style statistics Nov 18, 2024
Copy link
Collaborator

@vellip vellip left a comment

Choose a reason for hiding this comment

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

Nice job, I left just a few minor notes for you.

Comment on lines 10 to 33

.live_question__progress {
display: flex;
gap: 8px;
margin-bottom: 8px;
position: relative;
}

.live_question__progress-bar {
background-color: $gray-lighter;
border-radius: 10px;
height: 100%;
position: absolute;
z-index: 0;
}

.live_question__progress-text {
padding-left: 8px;
padding-right: 8px;
position: relative;
z-index: 1;
}

.live_question__progress-percentage {
font-weight: bold;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you use live-question instead of live_question? Is more BEM-like and already defined like that in the rest of the file.

Comment on lines 27 to 28
padding-left: 8px;
padding-right: 8px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you use em or rem more, where it makes sense please? I think we prefer that over px, unless its some specific number or similar.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you convert this to a functional component as well? Or did you plan to do that in another PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is now converted.

Comment on lines 44 to 46
const questionAnsweredTag = django.gettext('Questions Answered')
const categoriesTag = django.gettext('Categories')
const categoriesAnsweredTag = django.gettext('Affiliation Of Answered Questions')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you move these outside the component, if possible? Thanks!

const countPerCategory = this.countCategory(category)
const style = { width: countPerCategory + '%' }
return (
<div className="live_question__progress" key={index}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know it's been like that in the code before, but could you change it to use something other than index?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -1,13 +0,0 @@
import StatisticsBox from './StatisticsBox'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@vellip I noticed that <StatisticsBox /> was also rendered in react_questions_statistics.jsx, but react_questions_statistics.jsx isn't used anywhere or referenced in webpack.common.js, so have removed it.

@sevfurneaux
Copy link
Collaborator Author

Nice job, I left just a few minor notes for you.

Thanks for the review, I've now made the changes 👍

@vellip vellip merged commit c3e5599 into dev Nov 19, 2024
2 checks passed
@vellip vellip deleted the sf-2024-style-event-statistics branch November 19, 2024 09:55
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