Restyle relink dialog
This commit is contained in:
parent
8045a83374
commit
424d8785b6
5 changed files with 23 additions and 14 deletions
|
@ -2219,7 +2219,7 @@
|
||||||
"description": "When a person inputs a number that is invalid"
|
"description": "When a person inputs a number that is invalid"
|
||||||
},
|
},
|
||||||
"unlinkedWarning": {
|
"unlinkedWarning": {
|
||||||
"message": "Relink Signal Desktop to your mobile device to continue messaging."
|
"message": "Click to relink Signal Desktop to your mobile device to continue messaging."
|
||||||
},
|
},
|
||||||
"unlinked": {
|
"unlinked": {
|
||||||
"message": "Unlinked"
|
"message": "Unlinked"
|
||||||
|
|
|
@ -46,6 +46,11 @@
|
||||||
margin-right: 18px;
|
margin-right: 18px;
|
||||||
background-color: $color-white;
|
background-color: $color-white;
|
||||||
|
|
||||||
|
&--relink {
|
||||||
|
-webkit-mask: url('../images/icons/v2/link-broken-16.svg') no-repeat
|
||||||
|
center;
|
||||||
|
}
|
||||||
|
|
||||||
&--network {
|
&--network {
|
||||||
-webkit-mask: url('../images/icons/v2/offline-22.svg') no-repeat center;
|
-webkit-mask: url('../images/icons/v2/offline-22.svg') no-repeat center;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { storiesOf } from '@storybook/react';
|
||||||
import { boolean } from '@storybook/addon-knobs';
|
import { boolean } from '@storybook/addon-knobs';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import { RelinkDialog } from './RelinkDialog';
|
import { DialogRelink } from './DialogRelink';
|
||||||
import { setup as setupI18n } from '../../js/modules/i18n';
|
import { setup as setupI18n } from '../../js/modules/i18n';
|
||||||
import enMessages from '../../_locales/en/messages.json';
|
import enMessages from '../../_locales/en/messages.json';
|
||||||
|
|
||||||
|
@ -27,19 +27,19 @@ const permutations = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
storiesOf('Components/RelinkDialog', module)
|
storiesOf('Components/DialogRelink', module)
|
||||||
.add('Knobs Playground', () => {
|
.add('Knobs Playground', () => {
|
||||||
const isRegistrationDone = boolean('isRegistrationDone', false);
|
const isRegistrationDone = boolean('isRegistrationDone', false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RelinkDialog {...defaultProps} isRegistrationDone={isRegistrationDone} />
|
<DialogRelink {...defaultProps} isRegistrationDone={isRegistrationDone} />
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.add('Iterations', () => {
|
.add('Iterations', () => {
|
||||||
return permutations.map(({ props, title }) => (
|
return permutations.map(({ props, title }) => (
|
||||||
<>
|
<>
|
||||||
<h3>{title}</h3>
|
<h3>{title}</h3>
|
||||||
<RelinkDialog {...defaultProps} {...props} />
|
<DialogRelink {...defaultProps} {...props} />
|
||||||
</>
|
</>
|
||||||
));
|
));
|
||||||
});
|
});
|
|
@ -11,7 +11,7 @@ export type PropsType = {
|
||||||
relinkDevice: () => void;
|
relinkDevice: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const RelinkDialog = ({
|
export const DialogRelink = ({
|
||||||
i18n,
|
i18n,
|
||||||
isRegistrationDone,
|
isRegistrationDone,
|
||||||
relinkDevice,
|
relinkDevice,
|
||||||
|
@ -22,14 +22,18 @@ export const RelinkDialog = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="LeftPaneDialog LeftPaneDialog--warning">
|
<div className="LeftPaneDialog LeftPaneDialog--warning">
|
||||||
|
<div className="LeftPaneDialog__icon LeftPaneDialog__icon--relink" />
|
||||||
<div className="LeftPaneDialog__message">
|
<div className="LeftPaneDialog__message">
|
||||||
<h3>{i18n('unlinked')}</h3>
|
<h3>{i18n('unlinked')}</h3>
|
||||||
<span>{i18n('unlinkedWarning')}</span>
|
<div>
|
||||||
</div>
|
<button
|
||||||
<div className="LeftPaneDialog__actions">
|
className="LeftPaneDialog__action-text"
|
||||||
<button onClick={relinkDevice} type="button">
|
onClick={relinkDevice}
|
||||||
{i18n('relink')}
|
type="button"
|
||||||
</button>
|
>
|
||||||
|
{i18n('unlinkedWarning')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { mapDispatchToProps } from '../actions';
|
import { mapDispatchToProps } from '../actions';
|
||||||
import { RelinkDialog } from '../../components/RelinkDialog';
|
import { DialogRelink } from '../../components/DialogRelink';
|
||||||
import { StateType } from '../reducer';
|
import { StateType } from '../reducer';
|
||||||
import { getIntl } from '../selectors/user';
|
import { getIntl } from '../selectors/user';
|
||||||
import { isDone } from '../../util/registration';
|
import { isDone } from '../../util/registration';
|
||||||
|
@ -17,4 +17,4 @@ const mapStateToProps = (state: StateType) => {
|
||||||
|
|
||||||
const smart = connect(mapStateToProps, mapDispatchToProps);
|
const smart = connect(mapStateToProps, mapDispatchToProps);
|
||||||
|
|
||||||
export const SmartRelinkDialog = smart(RelinkDialog);
|
export const SmartRelinkDialog = smart(DialogRelink);
|
||||||
|
|
Loading…
Add table
Reference in a new issue