Skip to content

Commit 6cbdefe

Browse files
authored
Merge pull request #93 from filecoin-project/bp/update-upload-steps
[UXIT-3481] Update upload steps
2 parents b6ccd81 + e50a2d4 commit 6cbdefe

File tree

5 files changed

+5
-67
lines changed

5 files changed

+5
-67
lines changed

src/components/upload/car-upload-and-ipni-card.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { Card } from '../ui/card.tsx'
88
import { DownloadButton } from '../ui/download-button.tsx'
99
import { TextWithCopyToClipboard } from '../ui/text-with-copy-to-clipboard.tsx'
1010
import { ProgressCard } from './progress-card.tsx'
11-
import { ProgressCardCombined } from './progress-card-combined.tsx'
1211

1312
interface CarUploadAndIpniCardProps {
1413
stepStates: StepState[]
@@ -31,7 +30,7 @@ export const CarUploadAndIpniCard = ({ stepStates, cid, fileName }: CarUploadAnd
3130

3231
const { hasIpniAnnounceFailure } = uploadOutcome
3332

34-
const { announcingCidsStep, uploadingCarStep } = useStepStates(stepStates)
33+
const { creatingCarStep, uploadingCarStep, announcingCidsStep } = useStepStates(stepStates)
3534

3635
const shouldShowCidCard =
3736
uploadingCarStep?.status === 'completed' &&
@@ -59,7 +58,8 @@ export const CarUploadAndIpniCard = ({ stepStates, cid, fileName }: CarUploadAnd
5958

6059
return (
6160
<>
62-
<ProgressCardCombined stepStates={stepStates} />
61+
{creatingCarStep && <ProgressCard stepState={creatingCarStep} />}
62+
{uploadingCarStep && <ProgressCard stepState={uploadingCarStep} />}
6363
{announcingCidsStep && <ProgressCard stepState={announcingCidsStep} />}
6464
</>
6565
)

src/components/upload/progress-card-combined.tsx

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/hooks/use-first-stage-state.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/utils/upload/step-utils.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ export function getStepLabel(step: StepState['step']) {
44
switch (step) {
55
case 'creating-car':
66
case 'checking-readiness':
7+
return 'Creating CAR file'
78
case 'uploading-car':
8-
return 'Preparing service, creating CAR file, and uploading to the Filecoin SP'
9+
return 'Uploading to Filecoin SP'
910
case 'announcing-cids':
1011
return 'Announcing IPFS CIDs to IPNI'
1112
case 'finalizing-transaction':
@@ -15,10 +16,6 @@ export function getStepLabel(step: StepState['step']) {
1516

1617
export function getStepEstimatedTime(step: StepState['step']) {
1718
switch (step) {
18-
case 'creating-car':
19-
case 'checking-readiness':
20-
case 'uploading-car':
21-
return 'Estimated time: ~30 seconds'
2219
case 'announcing-cids':
2320
return 'Estimated time: ~30 seconds'
2421
case 'finalizing-transaction':

src/utils/upload/upload-progress.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ function getFirstStageState(stepStates: StepState[]) {
3131
)
3232
}
3333

34-
// Calculate combined progress for the first stage (creating CAR + checking readiness + uploading)
35-
export function getFirstStageProgress(stepStates: StepState[]) {
36-
const { creatingCar, checkingReadiness, uploadingCar } = getFirstStageState(stepStates)
37-
const total = creatingCar.progress + checkingReadiness.progress + uploadingCar.progress
38-
return Math.round(total / 3)
39-
}
40-
4134
export function getFirstStageStatus(stepStates: StepState[]) {
4235
const firstStageState = getFirstStageState(stepStates)
4336

0 commit comments

Comments
 (0)