Skip to content

Commit

Permalink
Add contact support in sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
erikaperugachi committed Dec 7, 2018
1 parent 52fc651 commit 8780c45
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 32 deletions.
2 changes: 1 addition & 1 deletion email_mailbox/src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ button{
color: #0091ff;

i{
font-size: 16px;
font-size: 14px;
}

span{
Expand Down
2 changes: 1 addition & 1 deletion email_mailbox/src/components/CustomTitleBar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { TitleBar } from 'react-desktop/windows';
import { isWindows } from '../containers/Settings';
import { isWindows } from '../utils/OSUtils';
import {
closeMailboxWindow,
maximizeMailboxWindow,
Expand Down
10 changes: 10 additions & 0 deletions email_mailbox/src/components/SideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ const SideBar = props => (
</div>
<span>{string.sidebar.invite_a_friend}</span>
</li>
<li
className="nav-item"
onClick={() => props.onClickComposeContactSupportEmail()}
>
<div className="nav-item-icon">
<i className="icon-ask" />
</div>
<span>{string.settings.contact_support}</span>
</li>
<li className="nav-item" onClick={() => props.onClickSettings()}>
<div className="nav-item-icon">
<i className="icon-settings" />
Expand All @@ -99,6 +108,7 @@ SideBar.propTypes = {
items: PropTypes.array,
labels: PropTypes.object,
mailboxSelected: PropTypes.string,
onClickComposeContactSupportEmail: PropTypes.func,
onClickInviteFriend: PropTypes.func,
onClickSettings: PropTypes.func,
onToggleShowLabelView: PropTypes.func,
Expand Down
2 changes: 1 addition & 1 deletion email_mailbox/src/components/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
flex-grow: 1;
justify-content: flex-end;
margin-top: 25px;
min-height: 80px;
min-height: 115px;

li.nav-item{
span{
Expand Down
31 changes: 4 additions & 27 deletions email_mailbox/src/containers/Settings.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { connect } from 'react-redux';
import randomcolor from 'randomcolor';
import SettingsWrapper from './../components/SettingsWrapper';
import { version } from './../../package.json';
import { addLabel, updateLabel, removeLabel } from './../actions';
import {
cleanDataLogout,
Expand All @@ -20,6 +19,7 @@ import {
import { logoutApp, openFilledComposerWindow } from './../utils/ipc';
import { appDomain, composerEvents } from '../utils/const';
import { defineLastDeviceActivity } from '../utils/TimeUtils';
import { formContactSupportEmailContent } from '../utils/EmailUtils';
import { clearStorage } from '../utils/storage';
import {
sendResetPasswordSendLinkSuccessMessage,
Expand Down Expand Up @@ -73,24 +73,6 @@ const deleteDeviceData = async () => {
await logoutApp();
};

const getOS = () => {
const osName = window.navigator.platform;
return osName.split(' ')[0];
};

const isWindows = () => {
return getOS().toLowerCase() === 'win32';
};

const formContactSupportEmailContent = () => {
const lines = '<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>';
const header = '<strong>Do not write below this line.</strong>';
const separator = '<br/>*****************************<br/>';
const appVersion = `<strong>Version:</strong> ${version}<br/>`;
const OS = `<strong>OS:</strong> ${getOS()}<br/>`;
return lines + header + separator + appVersion + OS;
};

const mapDispatchToProps = dispatch => {
return {
onAddLabel: text => {
Expand All @@ -106,15 +88,10 @@ const mapDispatchToProps = dispatch => {
dispatch(addLabel(label));
},
onComposeContactSupportEmail: () => {
const content = formContactSupportEmailContent();
const data = formContactSupportEmailContent();
openFilledComposerWindow({
type: composerEvents.NEW_WITH_DATA,
data: {
email: { subject: 'Customer Support - Desktop', content },
recipients: {
to: { name: 'Contact Support', email: `support@${appDomain}` }
}
}
data
});
},
onDeleteDeviceData: async () => {
Expand Down Expand Up @@ -190,4 +167,4 @@ const Settings = connect(
mapDispatchToProps
)(SettingsWrapper);

export { Settings as default, deleteDeviceData, isWindows };
export { Settings as default, deleteDeviceData };
8 changes: 8 additions & 0 deletions email_mailbox/src/containers/SideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { loadLabels } from '../actions';
import SideBarView from '../components/SideBarWrapper';
import { IconLabels, SectionType, composerEvents } from './../utils/const';
import { toLowerCaseWithoutSpaces } from './../utils/StringUtils';
import { formContactSupportEmailContent } from '../utils/EmailUtils';
import { openFilledComposerWindow } from './../utils/ipc';
import string from './../lang';

Expand Down Expand Up @@ -53,6 +54,13 @@ const formInviteFriendEmailContent = () => {

const mapDispatchToProps = (dispatch, ownProps) => {
return {
onClickComposeContactSupportEmail: () => {
const data = formContactSupportEmailContent();
openFilledComposerWindow({
type: composerEvents.NEW_WITH_DATA,
data
});
},
onClickInviteFriend: () => {
openFilledComposerWindow({
type: composerEvents.NEW_WITH_DATA,
Expand Down
Binary file modified email_mailbox/src/fonts/icon.eot
Binary file not shown.
4 changes: 2 additions & 2 deletions email_mailbox/src/fonts/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified email_mailbox/src/fonts/icon.ttf
Binary file not shown.
Binary file modified email_mailbox/src/fonts/icon.woff
Binary file not shown.
Loading

0 comments on commit 8780c45

Please sign in to comment.