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

[Plugin] Backup: Update initial backup screen #21559

Merged
merged 2 commits into from
Oct 28, 2021
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
4 changes: 4 additions & 0 deletions projects/plugins/backup/changelog/modify-no-backups-screen
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Change initial screen for first backup.
17 changes: 2 additions & 15 deletions projects/plugins/backup/src/js/components/Backups.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import BackupAnim3 from './icons/backup-animation-3.svg';
/* eslint react/react-in-jsx-scope: 0 */
const Backups = () => {
// State information
const [ progress, setProgress ] = useState( null );
const [ progress, setProgress ] = useState( 0 );
const [ trackProgress, setTrackProgress ] = useState( 0 );
const [ latestTime, setLatestTime ] = useState( '' );
const [ stats, setStats ] = useState( {
Expand Down Expand Up @@ -271,27 +271,14 @@ const Backups = () => {
);
};

const renderNoBackups = () => {
return (
<div class="jp-row">
<div class="lg-col-span-5 md-col-span-4 sm-col-span-4">
<h1>{ __( 'Welcome to Jetpack Backup!', 'jetpack-backup' ) }</h1>
<p>{ __( "You're all set! Your first backup will start soon.", 'jetpack-backup' ) }</p>
</div>
<div class="lg-col-span-1 md-col-span-4 sm-col-span-0"></div>
<div class="lg-col-span-6 md-col-span-2 sm-col-span-2"></div>
</div>
);
};

const renderLoading = () => {
return <div class="jp-row"></div>;
};

return (
<div className="jp-wrap">
{ BACKUP_STATE.LOADING === backupState && renderLoading() }
{ BACKUP_STATE.NO_BACKUPS === backupState && renderNoBackups() }
{ BACKUP_STATE.NO_BACKUPS === backupState && renderInProgressBackup() }
{ BACKUP_STATE.IN_PROGRESS === backupState && renderInProgressBackup() }
{ BACKUP_STATE.COMPLETE === backupState && renderCompleteBackup() }
{ BACKUP_STATE.NO_GOOD_BACKUPS === backupState && renderNoGoodBackups() }
Expand Down