Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
feat: improve statistics bar chart rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
MitanOmar committed Apr 26, 2023
1 parent 16fda79 commit b1f1d98
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
17 changes: 17 additions & 0 deletions app/components/statistic-list/bar/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Component from "@glimmer/component";

export default class StatisticListBar extends Component {
get didFinishEffortsInBudget() {
if (this.args.remaining === 0 && this.args.value < this.args.goal) {
return true;
}
return false;
}

get didFinishEffortsOverBudget() {
if (this.args.value > this.args.goal) {
return true;
}
return false;
}
}
5 changes: 4 additions & 1 deletion app/components/statistic-list/bar/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

<div
...attributes
class="statistic-list-bar"
class="statistic-list-bar
{{if this.didFinishEffortsInBudget 'strong-success'}}
{{if this.didFinishEffortsOverBudget 'strong-danger'}}
"
{{style --value=(concat @value)}}
></div>
{{#if (and @remaining (lte @remaining 1))}}
Expand Down
8 changes: 8 additions & 0 deletions app/styles/components/statistic-list-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
animation: slide-in-statistic-bar 0.5s cubic-bezier(0.86, 0, 0.07, 1);
}

&.strong-success::before {
background-color: $color-success;
}

&.strong-danger::before {
background-color: $color-danger;
}

&.success::before {
background-color: $color-success-lighter;
}
Expand Down

0 comments on commit b1f1d98

Please sign in to comment.