From 0746be84134b8c1b87e3bb3fe9c47c4706439da0 Mon Sep 17 00:00:00 2001
From: Hidayatullah Wildan Ghaly Buchary <16521502@std.stei.itb.ac.id>
Date: Sat, 7 Oct 2023 19:58:34 +0700
Subject: [PATCH] style: add style on obtain-unobtain CHALLENGE

---
 api/challenge/challenge.php | 8 ++++----
 public/css/challenge.css    | 7 +++++++
 2 files changed, 11 insertions(+), 4 deletions(-)
 create mode 100644 public/css/challenge.css

diff --git a/api/challenge/challenge.php b/api/challenge/challenge.php
index 0dd3601..a3ef753 100644
--- a/api/challenge/challenge.php
+++ b/api/challenge/challenge.php
@@ -77,15 +77,15 @@ foreach ($customers as $item) {
     $achievementList .= '<td>'.$item["threshold"].'</td>   ';
     $achievementList .= '<td>';
     if ($claimStatus){
-        $achievementList .= '<button id="cobtain" onclick=#>Obtained </button>';
+        $achievementList .= '<button id="obtain" class="obtain">Obtained </button>';
     } else {
-        $achievementList .= '<button id="obtain-not" onclick=#>Unobtained </button>';
+        $achievementList .= '<button id="obtain-not" class="obtain-not">Unobtained </button>';
     }
     $achievementList .= '</td><td>';
     if (!$claimStatus){
-        $achievementList .= '<button id="claim" onclick=claimFunction(' .$user_id. ',' .$item["id"]. ')>Claim</button>';
+        $achievementList .= '<button id="claim" class="claim" onclick=claimFunction(' .$user_id. ',' .$item["id"]. ')>Claim</button>';
     } else {
-        $achievementList .= '<button id="claim-not" onclick=unclaimFunction(' .$user_id. ',' .$item["id"]. ')>Unclaim</button>';
+        $achievementList .= '<button id="claim-not" class="claim-not" onclick=unclaimFunction(' .$user_id. ',' .$item["id"]. ')>Unclaim</button>';
     }
     $achievementList .= '</td></tr>';   
 }
diff --git a/public/css/challenge.css b/public/css/challenge.css
new file mode 100644
index 0000000..e8fa713
--- /dev/null
+++ b/public/css/challenge.css
@@ -0,0 +1,7 @@
+.obtain {
+    background-color: rgb(0, 255, 0);
+}
+
+.obtain-not {
+    background-color: rgb(255, 0, 0);
+}
\ No newline at end of file
-- 
GitLab