-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from eyra/extraction-status-message
#18 Print state on screen during extraction
- Loading branch information
Showing
15 changed files
with
174 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...ualisation/react/ui/elements/progress.tsx → ...sation/react/ui/elements/progress_bar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Weak } from '../../../../helpers' | ||
import { Translator } from '../../../../translator' | ||
import { ReactFactoryContext } from '../../factory' | ||
import { PropsUIPromptProgress } from '../../../../types/prompts' | ||
import { ProgressBar } from '../elements/progress_bar' | ||
|
||
type Props = Weak<PropsUIPromptProgress> & ReactFactoryContext | ||
|
||
export const Progress = (props: Props): JSX.Element => { | ||
const { resolve, percentage } = props | ||
const { description, message } = prepareCopy(props) | ||
|
||
function progressBar (): JSX.Element { | ||
if (percentage !== undefined) { | ||
return ( | ||
<> | ||
<div className='mt-2' /> | ||
<ProgressBar percentage={percentage} /> | ||
</> | ||
) | ||
} else { | ||
return <></> | ||
} | ||
} | ||
|
||
function autoResolve (): void { | ||
resolve?.({ __type__: 'PayloadTrue', value: true }) | ||
} | ||
|
||
// No user action possible, resolve directly to give control back to script | ||
autoResolve() | ||
|
||
return ( | ||
<> | ||
<div id='select-panel'> | ||
<div className='flex-wrap text-bodylarge font-body text-grey1 text-left'> | ||
{description} | ||
</div> | ||
<div className='mt-8' /> | ||
<div className='p-6 border-grey4 border-2 rounded'> | ||
<div className='flex-wrap text-bodylarge font-body text-grey2 text-left'> | ||
{message} | ||
</div> | ||
{progressBar()} | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
interface Copy { | ||
description: string | ||
message: string | ||
} | ||
|
||
function prepareCopy ({ description, message, locale }: Props): Copy { | ||
return { | ||
description: Translator.translate(description, locale), | ||
message: message | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters