Skip to content

Commit

Permalink
Restyle relink dialog
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Perez <60019601+josh-signal@users.noreply.github.com>
  • Loading branch information
automated-signal and josh-signal committed Aug 24, 2021
1 parent cf323cc commit b2ccd9e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,7 @@
"description": "When a person inputs a number that is invalid"
},
"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": {
"message": "Unlinked"
Expand Down
5 changes: 5 additions & 0 deletions stylesheets/components/LeftPaneDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
margin-right: 18px;
background-color: $color-white;

&--relink {
-webkit-mask: url('../images/icons/v2/link-broken-16.svg') no-repeat
center;
}

&--network {
-webkit-mask: url('../images/icons/v2/offline-22.svg') no-repeat center;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { storiesOf } from '@storybook/react';
import { boolean } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';

import { RelinkDialog } from './RelinkDialog';
import { DialogRelink } from './DialogRelink';
import { setup as setupI18n } from '../../js/modules/i18n';
import enMessages from '../../_locales/en/messages.json';

Expand All @@ -27,19 +27,19 @@ const permutations = [
},
];

storiesOf('Components/RelinkDialog', module)
storiesOf('Components/DialogRelink', module)
.add('Knobs Playground', () => {
const isRegistrationDone = boolean('isRegistrationDone', false);

return (
<RelinkDialog {...defaultProps} isRegistrationDone={isRegistrationDone} />
<DialogRelink {...defaultProps} isRegistrationDone={isRegistrationDone} />
);
})
.add('Iterations', () => {
return permutations.map(({ props, title }) => (
<>
<h3>{title}</h3>
<RelinkDialog {...defaultProps} {...props} />
<DialogRelink {...defaultProps} {...props} />
</>
));
});
18 changes: 11 additions & 7 deletions ts/components/RelinkDialog.tsx → ts/components/DialogRelink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type PropsType = {
relinkDevice: () => void;
};

export const RelinkDialog = ({
export const DialogRelink = ({
i18n,
isRegistrationDone,
relinkDevice,
Expand All @@ -22,14 +22,18 @@ export const RelinkDialog = ({

return (
<div className="LeftPaneDialog LeftPaneDialog--warning">
<div className="LeftPaneDialog__icon LeftPaneDialog__icon--relink" />
<div className="LeftPaneDialog__message">
<h3>{i18n('unlinked')}</h3>
<span>{i18n('unlinkedWarning')}</span>
</div>
<div className="LeftPaneDialog__actions">
<button onClick={relinkDevice} type="button">
{i18n('relink')}
</button>
<div>
<button
className="LeftPaneDialog__action-text"
onClick={relinkDevice}
type="button"
>
{i18n('unlinkedWarning')}
</button>
</div>
</div>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions ts/state/smart/RelinkDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { connect } from 'react-redux';
import { mapDispatchToProps } from '../actions';
import { RelinkDialog } from '../../components/RelinkDialog';
import { DialogRelink } from '../../components/DialogRelink';
import { StateType } from '../reducer';
import { getIntl } from '../selectors/user';
import { isDone } from '../../util/registration';
Expand All @@ -17,4 +17,4 @@ const mapStateToProps = (state: StateType) => {

const smart = connect(mapStateToProps, mapDispatchToProps);

export const SmartRelinkDialog = smart(RelinkDialog);
export const SmartRelinkDialog = smart(DialogRelink);

0 comments on commit b2ccd9e

Please sign in to comment.