Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
import { t } from 'i18next';
import { useParams } from 'react-router-dom';
import { TableButton } from '@/shared/components/ui/table-button';
import { useJobsNotifications } from '../../../hooks';
import { useAssignJobMutation } from '../../hooks/use-assign-job';
import { type AssignJobBody } from '../../../types';
import { useAddThirstyfiInfoModal } from '../../hooks/use-add-thirstyfi-info-modal';

const THIRSTYFI_ADDRESS = '0x5C08438d7d18734c5ee42ECAf81FB1D6A922A9cC';

export function AvailableJobsAssignJobButtonMobile({
assignJobPayload,
}: Readonly<{
assignJobPayload: AssignJobBody;
}>) {
const { address: oracleAddress } = useParams<{ address: string }>();
const { openModal } = useAddThirstyfiInfoModal();
const { onJobAssignmentError, onJobAssignmentSuccess } =
useJobsNotifications();

Expand All @@ -26,20 +20,12 @@ export function AvailableJobsAssignJobButtonMobile({
[`assignJob-${assignJobPayload.escrow_address}`]
);

const isThirstyfi = oracleAddress === THIRSTYFI_ADDRESS;

return (
<TableButton
color="secondary"
fullWidth
loading={isPending}
onClick={() => {
if (isThirstyfi) {
openModal({ ...assignJobPayload });
} else {
assignJobMutation(assignJobPayload);
}
}}
onClick={() => assignJobMutation(assignJobPayload)}
size="small"
sx={{
marginTop: '15px',
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { MRT_ColumnDef } from 'material-react-table';
import { t } from 'i18next';
import { Grid } from '@mui/material';
import { useMemo } from 'react';
import { useParams } from 'react-router-dom';
import { getNetworkName } from '@/modules/smart-contracts/get-network-name';
import { Chip } from '@/shared/components/ui/chip';
import { TableButton } from '@/shared/components/ui/table-button';
Expand All @@ -17,18 +16,13 @@ import {
} from '../components';
import { type AvailableJob } from '../../types';
import { useAssignJobMutation } from './use-assign-job';
import { useAddThirstyfiInfoModal } from './use-add-thirstyfi-info-modal';

const COL_SIZE = 100;
const COL_SIZE_LG = 200;
const THIRSTYFI_ADDRESS = '0x5C08438d7d18734c5ee42ECAf81FB1D6A922A9cC';

export const useGetAvailableJobsColumns = (
chainIdsEnabled: number[]
): MRT_ColumnDef<AvailableJob>[] => {
const { openModal } = useAddThirstyfiInfoModal();
const { address: oracleAddress } = useParams<{ address: string }>();

return useMemo(
() => [
{
Expand Down Expand Up @@ -127,20 +121,12 @@ export const useGetAvailableJobsColumns = (
[`assignJob-${escrow_address}`]
);

const isThirstyfi = oracleAddress === THIRSTYFI_ADDRESS;

return (
<Grid sx={{ display: 'flex', justifyContent: 'flex-end' }}>
<TableButton
sx={{ width: '94px' }}
loading={isPending}
onClick={() => {
if (isThirstyfi) {
openModal({ escrow_address, chain_id });
} else {
assignJobMutation({ escrow_address, chain_id });
}
}}
onClick={() => assignJobMutation({ escrow_address, chain_id })}
>
{t('worker.jobs.selectJob')}
</TableButton>
Expand All @@ -149,6 +135,6 @@ export const useGetAvailableJobsColumns = (
},
},
],
[chainIdsEnabled, openModal, oracleAddress]
[chainIdsEnabled]
);
};

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ export function MyJobsTableActions({
>
{t('worker.jobs.solve')}
</TableButton>
{job.escrow_address !== 'thirstyfi-task' && (
<MoreButton job={job} isDisabled={isDisabled} />
)}
<MoreButton job={job} isDisabled={isDisabled} />
</>
);
}
18 changes: 1 addition & 17 deletions packages/apps/human-app/frontend/src/shared/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -504,22 +504,6 @@
"image_skeletons_from_boxes": "Skeletons from Bounding Boxes",
"image_polygons": "Polygons",
"audio_transcription": "Audio Transcription",
"audio_attribute_annotation": "Audio Attribute Annotation",
"thirstyfi": "ThirstyFi"
},
"thirstyfiModal": {
"title": "This information is required to participate in this task",
"tutorialText1": "Before filling out the form below, please checkout ",
"tutorialText2": " for instructions.",
"tutorialLink": "thirsty.fi",
"walletAddress": "Wallet address",
"walletAddressTooltip": "Your EVM wallet address on Polygon network. Used to receive the rewards.",
"apiKey": "API key",
"apiKeyTooltip": "Your exchange API key (read account details is enough). Stored encrypted and only used server-side to fetch your balance.",
"apiSecret": "API secret",
"apiSecretTooltip": "Your exchange API secret. Stored encrypted and only used server-side to fetch your balance.",
"submitBtn": "Submit",
"walletAddressError": "Wallet address must be exactly 42 characters",
"walletAddressRegexError": "Wallet address must start with 0x"
"audio_attribute_annotation": "Audio Attribute Annotation"
}
}
Loading
Loading