Commit 1de56035 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[ERGO] doc rating star ergonomy

parent dd2842f8
...@@ -71,9 +71,8 @@ ratingCpt = R.hooksComponentWithModule thisModule "rating" cpt ...@@ -71,9 +71,8 @@ ratingCpt = R.hooksComponentWithModule thisModule "rating" cpt
else "fa fa-star" else "fa fa-star"
onClick score c = \_-> do onClick score c = \_-> do
let c' = if score == Star_0 let c' = if score == c
&& c == Star_0 then clickAgain c
then Star_1
else c else c
setLocalCategories $ Map.insert r._id c' setLocalCategories $ Map.insert r._id c'
......
...@@ -41,6 +41,12 @@ star2score Star_2 = 2 ...@@ -41,6 +41,12 @@ star2score Star_2 = 2
star2score Star_3 = 3 star2score Star_3 = 3
star2score Star_4 = 4 star2score Star_4 = 4
clickAgain :: Star -> Star
clickAgain Star_0 = Star_1
clickAgain s = decodeStar (star2score s - 1)
------------------------------------------------------------------------ ------------------------------------------------------------------------
data Category = Trash | UnRead | Checked | Topic | Favorite data Category = Trash | UnRead | Checked | Topic | Favorite
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment