aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-21 10:04:59 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-21 10:06:58 +0530
commitee7d9b0af920cc2021028faa52efe78d6ce0880a (patch)
treedba27bf1ee3b63c1e890f7a42436248d5e5c0067
parentchore: set stricter rules for typescript conversion (diff)
downloadferdium-app-ee7d9b0af920cc2021028faa52efe78d6ce0880a.tar.gz
ferdium-app-ee7d9b0af920cc2021028faa52efe78d6ce0880a.tar.zst
ferdium-app-ee7d9b0af920cc2021028faa52efe78d6ce0880a.zip
chore: remove 'shareFranz' feature since its always turned off for Ferdi
-rw-r--r--package.json2
-rw-r--r--src/components/layout/AppLayout.js2
-rw-r--r--src/features/nightlyBuilds/Component.js4
-rw-r--r--src/features/shareFranz/Component.js159
-rw-r--r--src/features/shareFranz/index.js35
-rw-r--r--src/features/shareFranz/store.js8
-rw-r--r--src/i18n/locales/defaultMessages.json96
-rw-r--r--src/i18n/locales/en-US.json7
-rw-r--r--src/i18n/messages/src/features/shareFranz/Component.json93
-rw-r--r--src/stores/FeaturesStore.js2
10 files changed, 3 insertions, 405 deletions
diff --git a/package.json b/package.json
index 87e18f1c7..47b0806cb 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,7 @@
24 "dev": "cross-env NODE_ENV=development gulp dev", 24 "dev": "cross-env NODE_ENV=development gulp dev",
25 "test": "jest", 25 "test": "jest",
26 "test:watch": "jest --watch", 26 "test:watch": "jest --watch",
27 "lint": "eslint \"{src,packages,uidev}/**/*.{js,jsx,ts,tsx}\" --quiet --fix", 27 "lint": "eslint \"{src,scripts,packages,uidev}/**/*.{js,jsx,ts,tsx}\" --quiet --fix",
28 "manage-translations": "node ./src/i18n/manage-translations.js", 28 "manage-translations": "node ./src/i18n/manage-translations.js",
29 "prebuild": "preval-build-info-cli && gulp build", 29 "prebuild": "preval-build-info-cli && gulp build",
30 "build": "electron-builder", 30 "build": "electron-builder",
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js
index d5e1deb39..00d7a759b 100644
--- a/src/components/layout/AppLayout.js
+++ b/src/components/layout/AppLayout.js
@@ -7,7 +7,6 @@ import injectSheet from 'react-jss';
7 7
8import InfoBar from '../ui/InfoBar'; 8import InfoBar from '../ui/InfoBar';
9import { Component as BasicAuth } from '../../features/basicAuth'; 9import { Component as BasicAuth } from '../../features/basicAuth';
10import { Component as ShareFranz } from '../../features/shareFranz';
11import { Component as QuickSwitch } from '../../features/quickSwitch'; 10import { Component as QuickSwitch } from '../../features/quickSwitch';
12import { Component as NightlyBuilds } from '../../features/nightlyBuilds'; 11import { Component as NightlyBuilds } from '../../features/nightlyBuilds';
13import { Component as PublishDebugInfo } from '../../features/publishDebugInfo'; 12import { Component as PublishDebugInfo } from '../../features/publishDebugInfo';
@@ -204,7 +203,6 @@ class AppLayout extends Component {
204 /> 203 />
205 )} 204 )}
206 <BasicAuth /> 205 <BasicAuth />
207 <ShareFranz />
208 <QuickSwitch /> 206 <QuickSwitch />
209 <NightlyBuilds /> 207 <NightlyBuilds />
210 <PublishDebugInfo /> 208 <PublishDebugInfo />
diff --git a/src/features/nightlyBuilds/Component.js b/src/features/nightlyBuilds/Component.js
index 5a809aaf2..6e5941948 100644
--- a/src/features/nightlyBuilds/Component.js
+++ b/src/features/nightlyBuilds/Component.js
@@ -55,7 +55,7 @@ const styles = () => ({
55 }, 55 },
56}); 56});
57 57
58export default @injectSheet(styles) @inject('stores', 'actions') @observer class nightlyBuildsModal extends Component { 58export default @injectSheet(styles) @inject('stores', 'actions') @observer class NightlyBuildsModal extends Component {
59 static contextTypes = { 59 static contextTypes = {
60 intl: intlShape, 60 intl: intlShape,
61 }; 61 };
@@ -124,7 +124,7 @@ export default @injectSheet(styles) @inject('stores', 'actions') @observer class
124 } 124 }
125} 125}
126 126
127nightlyBuildsModal.wrappedComponent.propTypes = { 127NightlyBuildsModal.wrappedComponent.propTypes = {
128 stores: PropTypes.shape({ 128 stores: PropTypes.shape({
129 settings: PropTypes.instanceOf(SettingsStore).isRequired, 129 settings: PropTypes.instanceOf(SettingsStore).isRequired,
130 }).isRequired, 130 }).isRequired,
diff --git a/src/features/shareFranz/Component.js b/src/features/shareFranz/Component.js
deleted file mode 100644
index cc2e81b70..000000000
--- a/src/features/shareFranz/Component.js
+++ /dev/null
@@ -1,159 +0,0 @@
1import React, { Component } from 'react';
2import PropTypes from 'prop-types';
3import { observer, inject } from 'mobx-react';
4import injectSheet from 'react-jss';
5import { defineMessages, intlShape } from 'react-intl';
6import { Button } from '@meetfranz/forms';
7import { H1, Icon } from '@meetfranz/ui';
8
9import {
10 mdiHeart, mdiEmail, mdiFacebookBox, mdiTwitter,
11} from '@mdi/js';
12import Modal from '../../components/ui/Modal';
13import { state } from './store';
14import ServicesStore from '../../stores/ServicesStore';
15
16const messages = defineMessages({
17 headline: {
18 id: 'feature.shareFranz.headline',
19 defaultMessage: '!!!Ferdi is better together!',
20 },
21 text: {
22 id: 'feature.shareFranz.text',
23 defaultMessage: '!!!Tell your friends and colleagues how awesome Ferdi is and help us to spread the word.',
24 },
25 actionsEmail: {
26 id: 'feature.shareFranz.action.email',
27 defaultMessage: '!!!Share as email',
28 },
29 actionsFacebook: {
30 id: 'feature.shareFranz.action.facebook',
31 defaultMessage: '!!!Share on Facebook',
32 },
33 actionsTwitter: {
34 id: 'feature.shareFranz.action.twitter',
35 defaultMessage: '!!!Share on Twitter',
36 },
37 shareTextEmail: {
38 id: 'feature.shareFranz.shareText.email',
39 defaultMessage: '!!! I\'ve added {count} services to Ferdi! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com',
40 },
41 shareTextTwitter: {
42 id: 'feature.shareFranz.shareText.twitter',
43 defaultMessage: '!!! I\'ve added {count} services to Ferdi! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com /cc @FranzMessenger',
44 },
45});
46
47const styles = (theme) => ({
48 modal: {
49 width: '80%',
50 maxWidth: 600,
51 background: theme.styleTypes.primary.accent,
52 textAlign: 'center',
53 color: theme.styleTypes.primary.contrast,
54 },
55 heartContainer: {
56 display: 'flex',
57 justifyContent: 'center',
58 borderRadius: '100%',
59 background: theme.brandDanger,
60 padding: 20,
61 width: 100,
62 height: 100,
63 margin: [-70, 'auto', 30],
64 },
65 heart: {
66 fill: theme.styleTypes.primary.contrast,
67 },
68 headline: {
69 textAlign: 'center',
70 fontSize: 40,
71 marginBottom: 20,
72 },
73 actions: {
74 display: 'flex',
75 justifyContent: 'space-between',
76 marginTop: 30,
77 },
78 cta: {
79 background: theme.styleTypes.primary.contrast,
80 color: `${theme.styleTypes.primary.accent} !important`,
81
82 '& svg': {
83 fill: theme.styleTypes.primary.accent,
84 },
85 },
86});
87
88export default @injectSheet(styles) @inject('stores') @observer class ShareFranzModal extends Component {
89 static propTypes = {
90 classes: PropTypes.object.isRequired,
91 };
92
93 static contextTypes = {
94 intl: intlShape,
95 };
96
97 close() {
98 state.isModalVisible = false;
99 }
100
101 render() {
102 const { isModalVisible } = state;
103
104 const {
105 classes,
106 stores,
107 } = this.props;
108
109 const serviceCount = stores.services.all.length;
110
111 const { intl } = this.context;
112
113 return (
114 <Modal
115 isOpen={isModalVisible}
116 className={classes.modal}
117 shouldCloseOnOverlayClick
118 close={this.close.bind(this)}
119 >
120 <div className={classes.heartContainer}>
121 <Icon icon={mdiHeart} className={classes.heart} size={4} />
122 </div>
123 <H1 className={classes.headline}>
124 {intl.formatMessage(messages.headline)}
125 </H1>
126 <p>{intl.formatMessage(messages.text)}</p>
127 <div className={classes.actions}>
128 <Button
129 label={intl.formatMessage(messages.actionsEmail)}
130 className={classes.cta}
131 icon={mdiEmail}
132 href={`mailto:?subject=Meet the cool app Franz&body=${intl.formatMessage(messages.shareTextEmail, { count: serviceCount })}}`}
133 target="_blank"
134 />
135 <Button
136 label={intl.formatMessage(messages.actionsFacebook)}
137 className={classes.cta}
138 icon={mdiFacebookBox}
139 href="https://www.facebook.com/sharer/sharer.php?u=https://www.meetfranz.com?utm_source=facebook&utm_medium=referral&utm_campaign=share-button"
140 target="_blank"
141 />
142 <Button
143 label={intl.formatMessage(messages.actionsTwitter)}
144 className={classes.cta}
145 icon={mdiTwitter}
146 href={`http://twitter.com/intent/tweet?status=${intl.formatMessage(messages.shareTextTwitter, { count: serviceCount })}`}
147 target="_blank"
148 />
149 </div>
150 </Modal>
151 );
152 }
153}
154
155ShareFranzModal.wrappedComponent.propTypes = {
156 stores: PropTypes.shape({
157 services: PropTypes.instanceOf(ServicesStore).isRequired,
158 }).isRequired,
159};
diff --git a/src/features/shareFranz/index.js b/src/features/shareFranz/index.js
deleted file mode 100644
index 9add0f65e..000000000
--- a/src/features/shareFranz/index.js
+++ /dev/null
@@ -1,35 +0,0 @@
1import { reaction } from 'mobx';
2import ms from 'ms';
3import { state as ModalState } from './store';
4
5export { default as Component } from './Component';
6
7const debug = require('debug')('Ferdi:feature:shareFranz');
8
9const state = ModalState;
10
11export default function initialize(stores) {
12 debug('Initialize shareFerdi feature');
13
14 window.ferdi.features.shareFerdi = {
15 state,
16 };
17
18 function showModal() {
19 debug('Would have showed share window');
20 }
21
22 reaction(
23 () => stores.user.isLoggedIn,
24 () => {
25 setTimeout(() => {
26 if (stores.settings.stats.appStarts % 50 === 0) {
27 showModal();
28 }
29 }, ms('2s'));
30 },
31 {
32 fireImmediately: true,
33 },
34 );
35}
diff --git a/src/features/shareFranz/store.js b/src/features/shareFranz/store.js
deleted file mode 100644
index c637e9eff..000000000
--- a/src/features/shareFranz/store.js
+++ /dev/null
@@ -1,8 +0,0 @@
1import { observable } from 'mobx';
2
3const defaultState = {
4 isModalVisible: false,
5 lastShown: null,
6};
7
8export const state = observable(defaultState);
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json
index 5e4ffd113..bc3024c88 100644
--- a/src/i18n/locales/defaultMessages.json
+++ b/src/i18n/locales/defaultMessages.json
@@ -5265,102 +5265,6 @@
5265 { 5265 {
5266 "descriptors": [ 5266 "descriptors": [
5267 { 5267 {
5268 "defaultMessage": "!!!Ferdi is better together!",
5269 "end": {
5270 "column": 3,
5271 "line": 20
5272 },
5273 "file": "src/features/shareFranz/Component.js",
5274 "id": "feature.shareFranz.headline",
5275 "start": {
5276 "column": 12,
5277 "line": 17
5278 }
5279 },
5280 {
5281 "defaultMessage": "!!!Tell your friends and colleagues how awesome Ferdi is and help us to spread the word.",
5282 "end": {
5283 "column": 3,
5284 "line": 24
5285 },
5286 "file": "src/features/shareFranz/Component.js",
5287 "id": "feature.shareFranz.text",
5288 "start": {
5289 "column": 8,
5290 "line": 21
5291 }
5292 },
5293 {
5294 "defaultMessage": "!!!Share as email",
5295 "end": {
5296 "column": 3,
5297 "line": 28
5298 },
5299 "file": "src/features/shareFranz/Component.js",
5300 "id": "feature.shareFranz.action.email",
5301 "start": {
5302 "column": 16,
5303 "line": 25
5304 }
5305 },
5306 {
5307 "defaultMessage": "!!!Share on Facebook",
5308 "end": {
5309 "column": 3,
5310 "line": 32
5311 },
5312 "file": "src/features/shareFranz/Component.js",
5313 "id": "feature.shareFranz.action.facebook",
5314 "start": {
5315 "column": 19,
5316 "line": 29
5317 }
5318 },
5319 {
5320 "defaultMessage": "!!!Share on Twitter",
5321 "end": {
5322 "column": 3,
5323 "line": 36
5324 },
5325 "file": "src/features/shareFranz/Component.js",
5326 "id": "feature.shareFranz.action.twitter",
5327 "start": {
5328 "column": 18,
5329 "line": 33
5330 }
5331 },
5332 {
5333 "defaultMessage": "!!! I've added {count} services to Ferdi! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com",
5334 "end": {
5335 "column": 3,
5336 "line": 40
5337 },
5338 "file": "src/features/shareFranz/Component.js",
5339 "id": "feature.shareFranz.shareText.email",
5340 "start": {
5341 "column": 18,
5342 "line": 37
5343 }
5344 },
5345 {
5346 "defaultMessage": "!!! I've added {count} services to Ferdi! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com /cc @FranzMessenger",
5347 "end": {
5348 "column": 3,
5349 "line": 44
5350 },
5351 "file": "src/features/shareFranz/Component.js",
5352 "id": "feature.shareFranz.shareText.twitter",
5353 "start": {
5354 "column": 20,
5355 "line": 41
5356 }
5357 }
5358 ],
5359 "path": "src/features/shareFranz/Component.json"
5360 },
5361 {
5362 "descriptors": [
5363 {
5364 "defaultMessage": "!!!Home", 5268 "defaultMessage": "!!!Home",
5365 "end": { 5269 "end": {
5366 "column": 3, 5270 "column": 3,
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json
index 1afa2c183..fe2eb6ec3 100644
--- a/src/i18n/locales/en-US.json
+++ b/src/i18n/locales/en-US.json
@@ -26,13 +26,6 @@
26 "feature.quickSwitch.info": "Select a service with TAB, ↑ and ↓. Open a service with ENTER.", 26 "feature.quickSwitch.info": "Select a service with TAB, ↑ and ↓. Open a service with ENTER.",
27 "feature.quickSwitch.search": "Search...", 27 "feature.quickSwitch.search": "Search...",
28 "feature.quickSwitch.title": "QuickSwitch", 28 "feature.quickSwitch.title": "QuickSwitch",
29 "feature.shareFranz.action.email": "Send as email",
30 "feature.shareFranz.action.facebook": "Share on Facebook",
31 "feature.shareFranz.action.twitter": "Share on Twitter",
32 "feature.shareFranz.headline": "Ferdi is better together!",
33 "feature.shareFranz.shareText.email": "I've added {count} services to Ferdi! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.getferdi.com",
34 "feature.shareFranz.shareText.twitter": "I've added {count} services to Ferdi! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.getferdi.com /cc @FerdiMessenger",
35 "feature.shareFranz.text": "Tell your friends and colleagues how awesome Ferdi is and help us to spread the word.",
36 "global.api.unhealthy": "Can't connect to Ferdi online services", 29 "global.api.unhealthy": "Can't connect to Ferdi online services",
37 "global.notConnectedToTheInternet": "You are not connected to the internet.", 30 "global.notConnectedToTheInternet": "You are not connected to the internet.",
38 "global.spellchecker.useDefault": "Use System Default ({default})", 31 "global.spellchecker.useDefault": "Use System Default ({default})",
diff --git a/src/i18n/messages/src/features/shareFranz/Component.json b/src/i18n/messages/src/features/shareFranz/Component.json
deleted file mode 100644
index 428bd5fbc..000000000
--- a/src/i18n/messages/src/features/shareFranz/Component.json
+++ /dev/null
@@ -1,93 +0,0 @@
1[
2 {
3 "id": "feature.shareFranz.headline",
4 "defaultMessage": "!!!Ferdi is better together!",
5 "file": "src/features/shareFranz/Component.js",
6 "start": {
7 "line": 17,
8 "column": 12
9 },
10 "end": {
11 "line": 20,
12 "column": 3
13 }
14 },
15 {
16 "id": "feature.shareFranz.text",
17 "defaultMessage": "!!!Tell your friends and colleagues how awesome Ferdi is and help us to spread the word.",
18 "file": "src/features/shareFranz/Component.js",
19 "start": {
20 "line": 21,
21 "column": 8
22 },
23 "end": {
24 "line": 24,
25 "column": 3
26 }
27 },
28 {
29 "id": "feature.shareFranz.action.email",
30 "defaultMessage": "!!!Share as email",
31 "file": "src/features/shareFranz/Component.js",
32 "start": {
33 "line": 25,
34 "column": 16
35 },
36 "end": {
37 "line": 28,
38 "column": 3
39 }
40 },
41 {
42 "id": "feature.shareFranz.action.facebook",
43 "defaultMessage": "!!!Share on Facebook",
44 "file": "src/features/shareFranz/Component.js",
45 "start": {
46 "line": 29,
47 "column": 19
48 },
49 "end": {
50 "line": 32,
51 "column": 3
52 }
53 },
54 {
55 "id": "feature.shareFranz.action.twitter",
56 "defaultMessage": "!!!Share on Twitter",
57 "file": "src/features/shareFranz/Component.js",
58 "start": {
59 "line": 33,
60 "column": 18
61 },
62 "end": {
63 "line": 36,
64 "column": 3
65 }
66 },
67 {
68 "id": "feature.shareFranz.shareText.email",
69 "defaultMessage": "!!! I've added {count} services to Ferdi! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com",
70 "file": "src/features/shareFranz/Component.js",
71 "start": {
72 "line": 37,
73 "column": 18
74 },
75 "end": {
76 "line": 40,
77 "column": 3
78 }
79 },
80 {
81 "id": "feature.shareFranz.shareText.twitter",
82 "defaultMessage": "!!! I've added {count} services to Ferdi! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com /cc @FranzMessenger",
83 "file": "src/features/shareFranz/Component.js",
84 "start": {
85 "line": 41,
86 "column": 20
87 },
88 "end": {
89 "line": 44,
90 "column": 3
91 }
92 }
93] \ No newline at end of file
diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js
index ac623c258..0dff2fda2 100644
--- a/src/stores/FeaturesStore.js
+++ b/src/stores/FeaturesStore.js
@@ -13,7 +13,6 @@ import workspaces from '../features/workspaces';
13import quickSwitch from '../features/quickSwitch'; 13import quickSwitch from '../features/quickSwitch';
14import nightlyBuilds from '../features/nightlyBuilds'; 14import nightlyBuilds from '../features/nightlyBuilds';
15import publishDebugInfo from '../features/publishDebugInfo'; 15import publishDebugInfo from '../features/publishDebugInfo';
16import shareFranz from '../features/shareFranz';
17import announcements from '../features/announcements'; 16import announcements from '../features/announcements';
18import settingsWS from '../features/settingsWS'; 17import settingsWS from '../features/settingsWS';
19import communityRecipes from '../features/communityRecipes'; 18import communityRecipes from '../features/communityRecipes';
@@ -73,7 +72,6 @@ export default class FeaturesStore extends Store {
73 quickSwitch(this.stores, this.actions); 72 quickSwitch(this.stores, this.actions);
74 nightlyBuilds(this.stores, this.actions); 73 nightlyBuilds(this.stores, this.actions);
75 publishDebugInfo(this.stores, this.actions); 74 publishDebugInfo(this.stores, this.actions);
76 shareFranz(this.stores, this.actions);
77 announcements(this.stores, this.actions); 75 announcements(this.stores, this.actions);
78 settingsWS(this.stores, this.actions); 76 settingsWS(this.stores, this.actions);
79 communityRecipes(this.stores, this.actions); 77 communityRecipes(this.stores, this.actions);