From ee7d9b0af920cc2021028faa52efe78d6ce0880a Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sat, 21 Aug 2021 10:04:59 +0530 Subject: chore: remove 'shareFranz' feature since its always turned off for Ferdi --- src/components/layout/AppLayout.js | 2 - src/features/nightlyBuilds/Component.js | 4 +- src/features/shareFranz/Component.js | 159 --------------------- src/features/shareFranz/index.js | 35 ----- src/features/shareFranz/store.js | 8 -- src/i18n/locales/defaultMessages.json | 96 ------------- src/i18n/locales/en-US.json | 7 - .../src/features/shareFranz/Component.json | 93 ------------ src/stores/FeaturesStore.js | 2 - 9 files changed, 2 insertions(+), 404 deletions(-) delete mode 100644 src/features/shareFranz/Component.js delete mode 100644 src/features/shareFranz/index.js delete mode 100644 src/features/shareFranz/store.js delete mode 100644 src/i18n/messages/src/features/shareFranz/Component.json (limited to 'src') 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'; import InfoBar from '../ui/InfoBar'; import { Component as BasicAuth } from '../../features/basicAuth'; -import { Component as ShareFranz } from '../../features/shareFranz'; import { Component as QuickSwitch } from '../../features/quickSwitch'; import { Component as NightlyBuilds } from '../../features/nightlyBuilds'; import { Component as PublishDebugInfo } from '../../features/publishDebugInfo'; @@ -204,7 +203,6 @@ class AppLayout extends Component { /> )} - 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 = () => ({ }, }); -export default @injectSheet(styles) @inject('stores', 'actions') @observer class nightlyBuildsModal extends Component { +export default @injectSheet(styles) @inject('stores', 'actions') @observer class NightlyBuildsModal extends Component { static contextTypes = { intl: intlShape, }; @@ -124,7 +124,7 @@ export default @injectSheet(styles) @inject('stores', 'actions') @observer class } } -nightlyBuildsModal.wrappedComponent.propTypes = { +NightlyBuildsModal.wrappedComponent.propTypes = { stores: PropTypes.shape({ settings: PropTypes.instanceOf(SettingsStore).isRequired, }).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 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { observer, inject } from 'mobx-react'; -import injectSheet from 'react-jss'; -import { defineMessages, intlShape } from 'react-intl'; -import { Button } from '@meetfranz/forms'; -import { H1, Icon } from '@meetfranz/ui'; - -import { - mdiHeart, mdiEmail, mdiFacebookBox, mdiTwitter, -} from '@mdi/js'; -import Modal from '../../components/ui/Modal'; -import { state } from './store'; -import ServicesStore from '../../stores/ServicesStore'; - -const messages = defineMessages({ - headline: { - id: 'feature.shareFranz.headline', - defaultMessage: '!!!Ferdi is better together!', - }, - text: { - id: 'feature.shareFranz.text', - defaultMessage: '!!!Tell your friends and colleagues how awesome Ferdi is and help us to spread the word.', - }, - actionsEmail: { - id: 'feature.shareFranz.action.email', - defaultMessage: '!!!Share as email', - }, - actionsFacebook: { - id: 'feature.shareFranz.action.facebook', - defaultMessage: '!!!Share on Facebook', - }, - actionsTwitter: { - id: 'feature.shareFranz.action.twitter', - defaultMessage: '!!!Share on Twitter', - }, - shareTextEmail: { - id: 'feature.shareFranz.shareText.email', - defaultMessage: '!!! I\'ve added {count} services to Ferdi! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com', - }, - shareTextTwitter: { - id: 'feature.shareFranz.shareText.twitter', - 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', - }, -}); - -const styles = (theme) => ({ - modal: { - width: '80%', - maxWidth: 600, - background: theme.styleTypes.primary.accent, - textAlign: 'center', - color: theme.styleTypes.primary.contrast, - }, - heartContainer: { - display: 'flex', - justifyContent: 'center', - borderRadius: '100%', - background: theme.brandDanger, - padding: 20, - width: 100, - height: 100, - margin: [-70, 'auto', 30], - }, - heart: { - fill: theme.styleTypes.primary.contrast, - }, - headline: { - textAlign: 'center', - fontSize: 40, - marginBottom: 20, - }, - actions: { - display: 'flex', - justifyContent: 'space-between', - marginTop: 30, - }, - cta: { - background: theme.styleTypes.primary.contrast, - color: `${theme.styleTypes.primary.accent} !important`, - - '& svg': { - fill: theme.styleTypes.primary.accent, - }, - }, -}); - -export default @injectSheet(styles) @inject('stores') @observer class ShareFranzModal extends Component { - static propTypes = { - classes: PropTypes.object.isRequired, - }; - - static contextTypes = { - intl: intlShape, - }; - - close() { - state.isModalVisible = false; - } - - render() { - const { isModalVisible } = state; - - const { - classes, - stores, - } = this.props; - - const serviceCount = stores.services.all.length; - - const { intl } = this.context; - - return ( - -
- -
-

- {intl.formatMessage(messages.headline)} -

-

{intl.formatMessage(messages.text)}

-
-
-
- ); - } -} - -ShareFranzModal.wrappedComponent.propTypes = { - stores: PropTypes.shape({ - services: PropTypes.instanceOf(ServicesStore).isRequired, - }).isRequired, -}; 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 @@ -import { reaction } from 'mobx'; -import ms from 'ms'; -import { state as ModalState } from './store'; - -export { default as Component } from './Component'; - -const debug = require('debug')('Ferdi:feature:shareFranz'); - -const state = ModalState; - -export default function initialize(stores) { - debug('Initialize shareFerdi feature'); - - window.ferdi.features.shareFerdi = { - state, - }; - - function showModal() { - debug('Would have showed share window'); - } - - reaction( - () => stores.user.isLoggedIn, - () => { - setTimeout(() => { - if (stores.settings.stats.appStarts % 50 === 0) { - showModal(); - } - }, ms('2s')); - }, - { - fireImmediately: true, - }, - ); -} 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 @@ -import { observable } from 'mobx'; - -const defaultState = { - isModalVisible: false, - lastShown: null, -}; - -export 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 @@ -5262,102 +5262,6 @@ ], "path": "src/features/recipeConnectionLost/components/WebControls.json" }, - { - "descriptors": [ - { - "defaultMessage": "!!!Ferdi is better together!", - "end": { - "column": 3, - "line": 20 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.headline", - "start": { - "column": 12, - "line": 17 - } - }, - { - "defaultMessage": "!!!Tell your friends and colleagues how awesome Ferdi is and help us to spread the word.", - "end": { - "column": 3, - "line": 24 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.text", - "start": { - "column": 8, - "line": 21 - } - }, - { - "defaultMessage": "!!!Share as email", - "end": { - "column": 3, - "line": 28 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.action.email", - "start": { - "column": 16, - "line": 25 - } - }, - { - "defaultMessage": "!!!Share on Facebook", - "end": { - "column": 3, - "line": 32 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.action.facebook", - "start": { - "column": 19, - "line": 29 - } - }, - { - "defaultMessage": "!!!Share on Twitter", - "end": { - "column": 3, - "line": 36 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.action.twitter", - "start": { - "column": 18, - "line": 33 - } - }, - { - "defaultMessage": "!!! I've added {count} services to Ferdi! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com", - "end": { - "column": 3, - "line": 40 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.shareText.email", - "start": { - "column": 18, - "line": 37 - } - }, - { - "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", - "end": { - "column": 3, - "line": 44 - }, - "file": "src/features/shareFranz/Component.js", - "id": "feature.shareFranz.shareText.twitter", - "start": { - "column": 20, - "line": 41 - } - } - ], - "path": "src/features/shareFranz/Component.json" - }, { "descriptors": [ { 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 @@ "feature.quickSwitch.info": "Select a service with TAB, ↑ and ↓. Open a service with ENTER.", "feature.quickSwitch.search": "Search...", "feature.quickSwitch.title": "QuickSwitch", - "feature.shareFranz.action.email": "Send as email", - "feature.shareFranz.action.facebook": "Share on Facebook", - "feature.shareFranz.action.twitter": "Share on Twitter", - "feature.shareFranz.headline": "Ferdi is better together!", - "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", - "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", - "feature.shareFranz.text": "Tell your friends and colleagues how awesome Ferdi is and help us to spread the word.", "global.api.unhealthy": "Can't connect to Ferdi online services", "global.notConnectedToTheInternet": "You are not connected to the internet.", "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 @@ -[ - { - "id": "feature.shareFranz.headline", - "defaultMessage": "!!!Ferdi is better together!", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 20, - "column": 3 - } - }, - { - "id": "feature.shareFranz.text", - "defaultMessage": "!!!Tell your friends and colleagues how awesome Ferdi is and help us to spread the word.", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 24, - "column": 3 - } - }, - { - "id": "feature.shareFranz.action.email", - "defaultMessage": "!!!Share as email", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 25, - "column": 16 - }, - "end": { - "line": 28, - "column": 3 - } - }, - { - "id": "feature.shareFranz.action.facebook", - "defaultMessage": "!!!Share on Facebook", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 29, - "column": 19 - }, - "end": { - "line": 32, - "column": 3 - } - }, - { - "id": "feature.shareFranz.action.twitter", - "defaultMessage": "!!!Share on Twitter", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 36, - "column": 3 - } - }, - { - "id": "feature.shareFranz.shareText.email", - "defaultMessage": "!!! I've added {count} services to Ferdi! Get the free app for WhatsApp, Messenger, Slack, Skype and co at www.meetfranz.com", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 37, - "column": 18 - }, - "end": { - "line": 40, - "column": 3 - } - }, - { - "id": "feature.shareFranz.shareText.twitter", - "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", - "file": "src/features/shareFranz/Component.js", - "start": { - "line": 41, - "column": 20 - }, - "end": { - "line": 44, - "column": 3 - } - } -] \ 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'; import quickSwitch from '../features/quickSwitch'; import nightlyBuilds from '../features/nightlyBuilds'; import publishDebugInfo from '../features/publishDebugInfo'; -import shareFranz from '../features/shareFranz'; import announcements from '../features/announcements'; import settingsWS from '../features/settingsWS'; import communityRecipes from '../features/communityRecipes'; @@ -73,7 +72,6 @@ export default class FeaturesStore extends Store { quickSwitch(this.stores, this.actions); nightlyBuilds(this.stores, this.actions); publishDebugInfo(this.stores, this.actions); - shareFranz(this.stores, this.actions); announcements(this.stores, this.actions); settingsWS(this.stores, this.actions); communityRecipes(this.stores, this.actions); -- cgit v1.2.3-70-g09d2