Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"add second device" dialog improvements #3748

Merged
merged 4 commits into from
Apr 8, 2024
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

### Changed
- Update translations (2024-04-04) #3746
- minor improvements to "add second device" dialog #3748
- Remove deprecated translations #3756

### Fixed
- fix chat audit dialog was going out of viewport on smaller screens #3736
- fix long names breaking layout of reactions dialog #3736
- hide "add second device" instructions when transfer has started #3748
- improve chat scroll performance #3743

<a id="1_44_1"></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,25 @@ export function SendBackupDialog({ onClose }: DialogProps) {
<DialogContent>
<SendBackup>
<SendBackupMain>
{error}
{stage === 'awaiting_scan' && svgUrl && qrContent && (
<img className={styles.qrCode} src={svgUrl} />
)}
{stage === 'preparing' && <>{tx('preparing_account')}</>}
{stage === 'transferring' && <>{tx('transferring')}</>}
{progress && stage !== 'awaiting_scan' && (
<>
<br />
<progress value={progress} max={1000} />
</>
)}
<SendBackupMainProgress
style={stage === 'transferring' ? { width: '100%' } : {}}
>
{stage === 'preparing' && <>{tx('preparing_account')}</>}
{stage === 'transferring' && <>{tx('transferring')}</>}
{progress && stage !== 'awaiting_scan' && (
<>
<br />
<progress value={progress} max={1000} />
</>
)}
</SendBackupMainProgress>
</SendBackupMain>
<SendBackupSteps />
{stage !== 'transferring' && <SendBackupSteps />}
</SendBackup>
{error}
</DialogContent>
</DialogBody>
<DialogFooter>
Expand Down Expand Up @@ -212,6 +216,17 @@ function SendBackupMain({ children }: PropsWithChildren<{}>) {
return <div className={styles.sendBackupMain}>{children}</div>
}

function SendBackupMainProgress({
children,
style,
}: PropsWithChildren<{ style: React.CSSProperties }>) {
return (
<div className={styles.sendBackupMainProgress} style={style}>
{children}
</div>
)
}

function SendBackupSteps() {
const tx = useTranslationFunction()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@
display: flex;
flex-wrap: wrap;
min-width: 300px;
justify-content: space-between;
}

.sendBackupMain {
max-width: 339px;
min-width: 200px;
display: flex;
flex-grow: 1;
align-items: center;
justify-content: center;
}

.sendBackupMainProgress {
display: flex;
flex-direction: column;

progress {
width: 100%;
}
}

.sendBackupSteps {
Expand Down
Loading