|
1 | 1 | import { useEffect, useState } from "react";
|
2 | 2 | import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react";
|
3 |
| -import { RadioIcon, SpeechIcon, TelescopeIcon, VoteIcon } from "lucide-react"; |
| 3 | +import { BarChartBigIcon, GlassWater, Guitar, PenBoxIcon, RadioIcon, SpeechIcon, TelescopeIcon, VoteIcon } from "lucide-react"; |
4 | 4 | import MissionShell from "../../BasePlate";
|
5 | 5 | import { DailyMinorPlanet } from "@/components/Projects/Telescopes/DailyMinorPlanet";
|
6 | 6 | import VoteDMPClassifications from "./DMPVote";
|
@@ -59,11 +59,60 @@ const DailyMinorPlanetMissions = () => {
|
59 | 59 | icon: VoteIcon,
|
60 | 60 | points: 3,
|
61 | 61 | completedCount: 0,
|
62 |
| - internalComponent: () => <div></div>, |
| 62 | + // internalComponent: () => <div></div>, |
63 | 63 | color: "text-red-700",
|
64 | 64 | shadow: true,
|
65 | 65 | action: () => {},
|
66 | 66 | },
|
| 67 | + { |
| 68 | + id: 5, |
| 69 | + chapter: 2, |
| 70 | + title: "Make an active asteroid classification", |
| 71 | + description: |
| 72 | + "The next step in your asteroid research involves finding asteroids with tails, helping us find clues about water on smaller objects", |
| 73 | + icon: Guitar, |
| 74 | + points: 2, |
| 75 | + completedCount: 0, |
| 76 | + // internalComponent: () => <div></div>, |
| 77 | + color: 'text-green-300', |
| 78 | + shadow: true, |
| 79 | + action: () => {}, |
| 80 | + }, |
| 81 | + { |
| 82 | + id: 6, |
| 83 | + chapter: 2, |
| 84 | + title: "Compare AA & DMP Classification", |
| 85 | + description: |
| 86 | + "Pick out classifications you've made from both datasets and compare the differences and potential validity", |
| 87 | + icon: BarChartBigIcon, |
| 88 | + points: 2, |
| 89 | + color: 'text-green-700', |
| 90 | + shadow: true, |
| 91 | + action: () => {}, |
| 92 | + }, |
| 93 | + { |
| 94 | + id: 7, |
| 95 | + chapter: 2, |
| 96 | + title: "Comment & Vote on AA candidates", |
| 97 | + description: "Work with other players to confirm classifications and provide feedback & consensus", |
| 98 | + icon: PenBoxIcon, |
| 99 | + points: 1, |
| 100 | + color: 'text-blue-300', |
| 101 | + shadow: true, |
| 102 | + action: () => [], |
| 103 | + }, |
| 104 | + { |
| 105 | + id: 8, |
| 106 | + chapter: 2, |
| 107 | + title: "Propose tail, dust cloud, or null value", |
| 108 | + description: |
| 109 | + "Go through verified AA & DMP anomalies and propose what's going on specifically", |
| 110 | + icon: GlassWater, |
| 111 | + points: 1, |
| 112 | + color: 'text-blue-700', |
| 113 | + shadow: true, |
| 114 | + action: () => {}, |
| 115 | + }, |
67 | 116 | ]);
|
68 | 117 |
|
69 | 118 | const [experiencePoints, setExperiencePoints] = useState(0);
|
@@ -126,30 +175,32 @@ const DailyMinorPlanetMissions = () => {
|
126 | 175 |
|
127 | 176 | const mission3CompletedCount = mission3CommentCount + mission3VoteCount;
|
128 | 177 |
|
129 |
| - // Mission 4: Check classifications with 5+ votes |
130 | 178 | const mission4CompletedCount = classificationsData?.filter(({ id: classificationId }) => {
|
131 | 179 | const voteCount = voteData?.filter(({ classification_id }) => classification_id === classificationId)
|
132 | 180 | .length;
|
133 |
| - return voteCount > 4.9999; // Greater than 5 votes |
| 181 | + return voteCount > 4.9999; |
134 | 182 | }).length || 0;
|
135 | 183 |
|
136 | 184 | setMissions((prevMissions) =>
|
137 | 185 | prevMissions.map((mission) => {
|
138 | 186 | if (mission.id === 1) {
|
139 |
| - return { ...mission, completedCount: mission1CompletedCount }; |
| 187 | + return { ...mission, completedCount: mission1CompletedCount, points: mission.points || 0 }; |
140 | 188 | }
|
141 | 189 | if (mission.id === 2) {
|
142 |
| - return { ...mission, completedCount: mission2CompletedCount }; |
| 190 | + return { ...mission, completedCount: mission2CompletedCount, points: mission.points || 0 }; |
143 | 191 | }
|
144 | 192 | if (mission.id === 3) {
|
145 |
| - return { ...mission, completedCount: mission3CompletedCount }; |
| 193 | + return { ...mission, completedCount: mission3CompletedCount, points: mission.points || 0 }; |
146 | 194 | }
|
147 | 195 | if (mission.id === 4) {
|
148 |
| - return { ...mission, completedCount: mission4CompletedCount }; |
| 196 | + return { ...mission, completedCount: mission4CompletedCount, points: mission.points || 0 }; |
| 197 | + } |
| 198 | + if (mission.id === 5) { |
| 199 | + return { ...mission, completedCount: mission4CompletedCount, points: mission.points || 0 }; |
149 | 200 | }
|
150 | 201 | return mission;
|
151 | 202 | })
|
152 |
| - ); |
| 203 | + ); |
153 | 204 |
|
154 | 205 | const totalPoints =
|
155 | 206 | mission1CompletedCount * 2 +
|
|
0 commit comments