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

Remove Card component from migration credentials screen #94729

Merged
merged 2 commits into from
Sep 20, 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
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,31 @@ export const BackupFileField: React.FC< CredentialsFormFieldProps > = ( { contro

return (
<div className="site-migration-credentials">
<div className="site-migration-credentials__form">
<div className="site-migration-credentials__form-field">
<FormLabel htmlFor="backup-file">{ translate( 'Backup file location' ) }</FormLabel>
<Controller
control={ control }
name="backupFileLocation"
rules={ {
required: translate( 'Please enter a valid URL.' ),
validate: isBackupFileLocationValid,
} }
render={ ( { field } ) => (
<FormTextInput
id="backup-file"
type="text"
isError={ !! errors?.backupFileLocation }
placeholder={ translate( 'Enter your backup file location' ) }
{ ...field }
/>
) }
/>
</div>
<ErrorMessage error={ errors?.backupFileLocation } />
<div className="site-migration-credentials__form-note site-migration-credentials__backup-note">
{ translate(
"Upload your file to a service like Dropbox or Google Drive to get a link. Don't forget to make sure that anyone with the link can access it."
<div className="site-migration-credentials__form-field">
<FormLabel htmlFor="backup-file">{ translate( 'Backup file location' ) }</FormLabel>
<Controller
control={ control }
name="backupFileLocation"
rules={ {
required: translate( 'Please enter a valid URL.' ),
validate: isBackupFileLocationValid,
} }
render={ ( { field } ) => (
<FormTextInput
id="backup-file"
type="text"
isError={ !! errors?.backupFileLocation }
placeholder={ translate( 'Enter your backup file location' ) }
{ ...field }
/>
) }
</div>
/>
</div>
<ErrorMessage error={ errors?.backupFileLocation } />
<div className="site-migration-credentials__form-note site-migration-credentials__backup-note">
{ translate(
"Upload your file to a service like Dropbox or Google Drive to get a link. Don't forget to make sure that anyone with the link can access it."
) }
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Card } from '@automattic/components';
import { useIsEnglishLocale } from '@automattic/i18n-utils';
import { NextButton } from '@automattic/onboarding';
import { useTranslate } from 'i18n-calypso';
Expand Down Expand Up @@ -35,7 +34,7 @@ export const CredentialsForm: FC< CredentialsFormProps > = ( { onSubmit, onSkip
const queryError = useQuery().get( 'error' ) || null;

return (
<form onSubmit={ handleSubmit( submitHandler ) }>
<form className="site-migration-credentials__form" onSubmit={ handleSubmit( submitHandler ) }>
{ queryError === 'ticket-creation' && (
<Banner
className="site-migration-credentials__error-banner"
Expand All @@ -46,22 +45,20 @@ export const CredentialsForm: FC< CredentialsFormProps > = ( { onSubmit, onSkip
) }
></Banner>
) }
<Card>
<div className="site-migration-credentials__content">
<AccessMethodPicker control={ control } />

<hr />

{ accessMethod === 'credentials' && (
<div className="site-migration-credentials">
<div className="site-migration-credentials__form">
<SiteAddressField
control={ control }
errors={ errors }
importSiteQueryParam={ importSiteQueryParam }
/>
<UsernameField control={ control } errors={ errors } />
<PasswordField control={ control } errors={ errors } />
</div>
<SiteAddressField
control={ control }
errors={ errors }
importSiteQueryParam={ importSiteQueryParam }
/>
<UsernameField control={ control } errors={ errors } />
<PasswordField control={ control } errors={ errors } />
</div>
) }

Expand All @@ -76,7 +73,7 @@ export const CredentialsForm: FC< CredentialsFormProps > = ( { onSubmit, onSkip
{ translate( 'Continue' ) }
</NextButton>
</div>
</Card>
</div>

<div className="site-migration-credentials__skip">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@
}
}

.card {
&__form {
margin-bottom: 60px;
}

.site-migration-credentials__content,
.site-migration-credentials__error-banner {
margin: 0 auto 16px;
max-width: 500px;
padding: 2em;

@media (max-width: $break-mobile) {
padding: 1.25em;
@media (min-width: $break-mobile) {
margin-bottom: 16px;
}

hr {
margin-top: 1em;
background: var(--color-border-subtle);
Expand Down Expand Up @@ -120,7 +126,8 @@
}
.site-migration-credentials__error-banner {
border-left-color: var(--color-error);
&.card {

&.site-migration-credentials__content {
padding: 1rem;
}
}
Expand Down
Loading