From ed201936813d9a720b51e6cb40a05267b94e7314 Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Thu, 10 Sep 2026 17:46:41 -0700 Subject: Typescript prettier Committing seperate so it's easier to see actual changes. --- jb-ui/src/pages/Preview.tsx | 523 +++++++++++++++++++++++--------------------- 1 file changed, 268 insertions(+), 255 deletions(-) (limited to 'jb-ui/src/pages/Preview.tsx') diff --git a/jb-ui/src/pages/Preview.tsx b/jb-ui/src/pages/Preview.tsx index 153b4bb..6e50b0d 100644 --- a/jb-ui/src/pages/Preview.tsx +++ b/jb-ui/src/pages/Preview.tsx @@ -1,287 +1,300 @@ import { - Leaderboard, - LeaderboardApi, - LeaderboardCode, - LeaderboardFrequency, - LeaderboardRow, + Leaderboard, + LeaderboardApi, + LeaderboardCode, + LeaderboardFrequency, + LeaderboardRow, } from "@/api_fsb"; import { useAppSelector } from "@/hooks"; -import { bpid, formatCentsToUSD, truncate, } from "@/lib/utils"; +import { bpid, formatCentsToUSD, truncate } from "@/lib/utils"; import { activeSurveys, activeUsers, maxPayout } from "@/models/grlStatsSlice"; import { clsx } from "clsx"; -import moment from 'moment'; -import { useEffect, useState } from 'react'; +import moment from "moment"; +import { useEffect, useState } from "react"; const showSmartRank = ( - item: LeaderboardRow, - index: number, - items: LeaderboardRow[] | undefined + item: LeaderboardRow, + index: number, + items: LeaderboardRow[] | undefined, ): boolean => { - /** - * Smart rank calculation - this determines if we should show the rank - * value. It's confusing to show people that multiple individuals ranked - * in the same place, so this will only display the next ranked value, eg: - * - * - 1st - * - ___ - * - 3rd - * - ___ - * - ___ - * - 6th - * - * @returns number - */ - if (!items) return false; - - const thisRank = item.rank; - if (index >= 1) { - const prevRank = items[index - 1].rank; - if (thisRank === prevRank) { - return false; - } + /** + * Smart rank calculation - this determines if we should show the rank + * value. It's confusing to show people that multiple individuals ranked + * in the same place, so this will only display the next ranked value, eg: + * + * - 1st + * - ___ + * - 3rd + * - ___ + * - ___ + * - 6th + * + * @returns number + */ + if (!items) return false; + + const thisRank = item.rank; + if (index >= 1) { + const prevRank = items[index - 1].rank; + if (thisRank === prevRank) { + return false; } - return true; + } + return true; }; interface FrequencyButtonsProps { - selected: LeaderboardFrequency; - onChange: (frequency: LeaderboardFrequency) => void; + selected: LeaderboardFrequency; + onChange: (frequency: LeaderboardFrequency) => void; } const frequency_map = [ - { label: 'Day', value: LeaderboardFrequency.Daily }, - { label: 'Week', value: LeaderboardFrequency.Weekly }, - { label: 'Month', value: LeaderboardFrequency.Monthly }, + { label: "Day", value: LeaderboardFrequency.Daily }, + { label: "Week", value: LeaderboardFrequency.Weekly }, + { label: "Month", value: LeaderboardFrequency.Monthly }, ]; const ThreeButtonToggle = ({ selected, onChange }: FrequencyButtonsProps) => { - return ( -
- {dateRange} -
-| Rank | -Bonus | -User | -
|---|---|---|
| Rank | +Bonus | +User | +
| - {dataItem.rank} - | -- {formatCentsToUSD(dataItem.value)} - | -- {truncate(dataItem.bpuid, 6, "*****").toUpperCase()} - | -
| {dataItem.rank} | ++ {formatCentsToUSD(dataItem.value)} + | ++ {truncate(dataItem.bpuid, 6, "*****").toUpperCase()} + | +
| Rank | -Completes | -User | -
|---|---|---|
| Rank | +Completes | +User | +
| - {dataItem.rank ?? showSmartRank(dataItem, index, completes?.rows)} - | -- {dataItem.value} - | -- {truncate(dataItem.bpuid, 6, "*****").toUpperCase()} - | -
- {users_f} people are actively attempting {surveys_f} available surveys right now. -
-- Get paid to take surveys. Our algorithm attempts to pair you with the - highest paying survey available at the moment (right now, the highest - paying survey is {survey_max_cpi_f}) that you are eligible for, - each attempt is a valid HIT. Try as many as you can, our system will - self regulate you: we want to ensure you have a high chance of being - paired with a survey based on what surveys are available, as their - availability constantly changes.
-- Each HIT is paid when you attempt to take a survey and if you complete - the survey, you will be awarded a bonus equal to that in which the - survey pays out.
-+ {users_f} people are actively attempting {surveys_f} available surveys + right now. +
++ Get paid to take surveys. Our algorithm attempts to pair you with the + highest paying survey available at the moment (right now, the highest + paying survey is {survey_max_cpi_f}) that you are eligible for, each + attempt is a valid HIT. Try as many as you can, our system will self + regulate you: we want to ensure you have a high chance of being paired + with a survey based on what surveys are available, as their + availability constantly changes. +
++ Each HIT is paid when you attempt to take a survey and if you complete + the survey, you will be awarded a bonus equal to that in which the + survey pays out. +
+
help:{" "}
support@jamesbillings67.com
diff --git a/jb-ui/src/components/Profiling.tsx b/jb-ui/src/components/Profiling.tsx
index 96b06b2..23b8457 100644
--- a/jb-ui/src/components/Profiling.tsx
+++ b/jb-ui/src/components/Profiling.tsx
@@ -1,4 +1,5 @@
import { UpkQuestionChoice } from "@/api_fsb";
+import { useGetMeQuery } from "@/models/authAPI";
import { ChevronRightIcon } from "lucide-react";
import { KeyboardEvent, MouseEvent, useEffect, useRef, useState } from "react";
@@ -46,7 +47,7 @@ const TextEntry = () => {
// const selectAnswer = useSelector(selectAnswerForQuestion(question));
const metadata = activeQuestion?._metadata;
const validation = activeQuestion?._validation;
- const bpuid = useAppSelector((state) => state.app.bpuid);
+ const { data: user, isLoading, isError } = useGetMeQuery();
if (!metadata) return null;
if (!validation) return null;
@@ -67,11 +68,14 @@ const TextEntry = () => {
const handleKeyPress = (event: KeyboardEvent
No Worker ID found. Please access this page through the Amazon
diff --git a/jb-ui/src/pages/Work.tsx b/jb-ui/src/pages/Work.tsx
index e33328e..84cb946 100644
--- a/jb-ui/src/pages/Work.tsx
+++ b/jb-ui/src/pages/Work.tsx
@@ -51,8 +51,7 @@ import Markdown from "react-markdown";
const Report = ({ onClose }: { onClose: () => void }) => {
const [showComplete, setShowComplete] = useState(false);
const [selectedValues, setSelectedValues] = useState Please finish a Task to report its status. Unable to send the link. Please try again.
+ If you don't recieve anything, please check your spam folder, or try
+ again shortly.
+
- {users_f} people are actively attempting {surveys_f} available surveys
- right now.
-
+ {users_f} people are actively attempting {surveys_f} available
+ surveys right now.
+
- Get paid to take surveys. Our algorithm attempts to pair you with the
- highest paying survey available at the moment (right now, the highest
- paying survey is {survey_max_cpi_f}) that you are eligible for, each
- attempt is a valid HIT. Try as many as you can, our system will self
- regulate you: we want to ensure you have a high chance of being paired
- with a survey based on what surveys are available, as their
- availability constantly changes.
-
- Each HIT is paid when you attempt to take a survey and if you complete
- the survey, you will be awarded a bonus equal to that in which the
- survey pays out.
-
+ Get paid to take surveys. Our algorithm attempts to pair you with
+ the highest paying survey available at the moment (right now, the
+ highest paying survey is {survey_max_cpi_f}) that you are eligible
+ for, each attempt is a valid HIT. Try as many as you can, our system
+ will self regulate you: we want to ensure you have a high chance of
+ being paired with a survey based on what surveys are available, as
+ their availability constantly changes.
+
No Worker ID found. Please access this page through the Amazon
@@ -145,15 +145,6 @@ const Transfer = function () {
);
}
- if (!assignment_id) {
- return (
-
- No Assignment ID found. Please access this page through the Amazon
- Mechanical Turk platform.
- Unable to send the link. Please try again.
+ Please check your email.
+
+
- Please Login
-
-
-
-
- {state === "sent" && (
-
- Check your email to login.
-
- )}
-
- {state === "failed" &&
+ {/* {cashout_methods.length} Redemption Methods */}
+ 30+ Redemption Methods
+
+ >
+ );
+};
+
+const RedemptionModalBody = () => {
+ return (
+
+ {/* (Click to {showRedemption ? "hide" : "show"}) */}
+ Details within 24hr.
+
+
{ts?.user_payout_string}
-- You may close this tab and return to submit the HIT -
+You may close this tab
> ); }; @@ -35,9 +33,7 @@ export const Enter = () => {You're currently in the Survey
-- You may close this tab and return to submit the HIT -
+You may close this tab
> ); }; @@ -50,13 +46,11 @@ export const InComplete = () => { return ( <> -Survey terminated the attempt.
-- You may close this tab and return to submit the HIT -
+You may close this tab
> ); }; @@ -68,9 +62,7 @@ export const Unknown = () => {You're not currently eligible for any Surveys
-- You may close this tab and return to submit the HIT -
+You may close this tab
> ); }; diff --git a/jb-ui/src/pages/Work.tsx b/jb-ui/src/pages/Work.tsx index dbe3601..50ed930 100644 --- a/jb-ui/src/pages/Work.tsx +++ b/jb-ui/src/pages/Work.tsx @@ -1,4 +1,5 @@ import { useGetMeQuery } from "@/models/authAPI"; +import { Link } from "react-router-dom"; import { BucketTask, OfferwallApi, @@ -183,7 +184,7 @@ const Report = ({ onClose }: { onClose: () => void }) => { hover:cursor-pointer hover:bg-rose-400 hover:text-rose-50" onClick={clicked_submit} > - Submit and Complete HIT + Submit and Complete Attempt @@ -306,7 +307,7 @@ const SurveyMonitor = () => { } // This is if they have finished a survey complete and it resulted in a - // COMPLETE or a INCOMPLETE (doesn't matter). They can now submit the HIT. + // COMPLETE or a INCOMPLETE (doesn't matter). They can now submit the Attempt. // // 2 - INCOMPLETE, 3 - COMPLETE return ( @@ -326,7 +327,7 @@ const SurveyMonitor = () => { py-2 text-zinc-500 text-md font-medium text-center" > - You may now submit the HIT. + You may now submit the attempt. )} @@ -351,7 +352,9 @@ const SurveyMonitor = () => { pt-0 pb-4 text-red-950 text-sm font-semibold text-center" > - Please return the HIT to avoid having your assignment rejected. + + Click to Refresh and Try Again + > @@ -368,7 +371,7 @@ const SurveyMonitor = () => { hover:cursor-pointer hover:bg-emerald-400 hover:text-emerald-50" onClick={() => setShowComplete(true)} > - Submit HIT + Finish Attempt