Skip to content

Commit

Permalink
Security: update notice styles in backup section
Browse files Browse the repository at this point in the history
1) Refactor header to use `Notice` component instead of custom styles:
  - Improves accessibility by following WCAG AA guidelines for contrast ratio.
  - Matches with other Calypso notifications, updated in #17796

2) Use `SectionHeader` component for positioning elements
  • Loading branch information
simison committed Mar 21, 2018
1 parent 2eb40f4 commit 0f8566b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
22 changes: 10 additions & 12 deletions client/my-sites/site-settings/jetpack-credentials/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import { some } from 'lodash';
import CompactCard from 'components/card/compact';
import CredentialsSetupFlow from './credentials-setup-flow';
import CredentialsConfigured from './credentials-configured';
import Gridicon from 'gridicons';
import Notice from 'components/notice';
import QueryRewindState from 'components/data/query-rewind-state';
import SectionHeader from 'components/section-header';
import { getSelectedSiteId } from 'state/ui/selectors';
import { getRewindState } from 'state/selectors';
import { getSiteSlug } from 'state/sites/selectors';
Expand All @@ -28,19 +29,16 @@ class JetpackCredentials extends Component {
return (
<div className="jetpack-credentials">
<QueryRewindState siteId={ siteId } />
<CompactCard className="jetpack-credentials__header">
<span>{ translate( 'Backups and security scans' ) }</span>
<SectionHeader label={ translate( 'Backups and security scans' ) }>
{ hasAuthorized && (
<span className="jetpack-credentials__connected">
<Gridicon
icon="checkmark"
size={ 18 }
className="jetpack-credentials__connected-checkmark"
/>
{ translate( 'Connected' ) }
</span>
<Notice
icon="checkmark"
isCompact
status="is-success"
text={ translate( 'Connected' ) }
/>
) }
</CompactCard>
</SectionHeader>
{ hasCredentials ? (
<CredentialsConfigured siteId={ siteId } />
) : (
Expand Down
14 changes: 0 additions & 14 deletions client/my-sites/site-settings/jetpack-credentials/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,3 @@
.jetpack-credentials .foldable-card.card.is-expanded {
margin: 0;
}

.jetpack-credentials__connected {
float: right;
background: $alert-green;
padding: 4px 8px;
border-radius: 2px;
font-size: 12px;
color: $white;
}

.jetpack-credentials__connected-checkmark {
vertical-align: top;
margin-right: 4px;
}

0 comments on commit 0f8566b

Please sign in to comment.