Skip to content

Commit 71311c7

Browse files
Adds helper method to color difficulty
1 parent 3bcab66 commit 71311c7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

frontend/src/helper/UIHelper.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// maps difficulty value to appropriate colors
2+
export const diffToScheme = (diff: number) => {
3+
if (diff < 3) {
4+
return "green";
5+
}
6+
if (diff < 6) {
7+
return "yellow";
8+
}
9+
if (diff < 8) {
10+
return "orange";
11+
}
12+
return "red";
13+
};
14+
15+
export const isLoggedin = true;
16+
export const isAdmin = true;

0 commit comments

Comments
 (0)