diff --git a/README.md b/README.md index f47a03e8b..10ff24b06 100644 --- a/README.md +++ b/README.md @@ -56,11 +56,6 @@ Coming Soon application --- Coming Soon applications (or apps) are defined in your Cozy's [configuration file](https://github.com/cozy/cozy-stack/blob/master/docs/config.md#main-configuration-file). See the `cozy.example.yaml` file [provided by the stack](https://github.com/cozy/cozy-stack/blob/master/cozy.example.yaml#L80). -Claudy actions list ---- -Claudy actions are declared in `src/config/claudy.yaml` with a slug as property name and some options (icon name and link options for example). The slugs list that will be used for Claudy is defined in your Cozy's [configuration file](https://github.com/cozy/cozy-stack/blob/master/docs/config.md#main-configuration-file). See the `cozy.example.yaml` file [provided by the stack](https://github.com/cozy/cozy-stack/blob/master/cozy.example.yaml#L101). -If no `claudy_actions` property is defined in the configuration, Claudy won't be displayed. - Customizing the content of the bar --- From within your app, you can decide to take over certain areas of the cozy-bar. This might especially be useful on mobile where the area it occupies is prime real estate — we generally don't recommend to use this option on larger screen resolutions. diff --git a/src/assets/icons/16/icon-claudy.svg b/src/assets/icons/16/icon-claudy.svg deleted file mode 100644 index af4de8dc2..000000000 --- a/src/assets/icons/16/icon-claudy.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/assets/icons/32/icon-claudy.svg b/src/assets/icons/32/icon-claudy.svg deleted file mode 100644 index 1cfd78b0f..000000000 --- a/src/assets/icons/32/icon-claudy.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/assets/icons/claudyActions/icon-bills.svg b/src/assets/icons/claudyActions/icon-bills.svg deleted file mode 100644 index 3f880858f..000000000 --- a/src/assets/icons/claudyActions/icon-bills.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/assets/icons/claudyActions/icon-laptop.svg b/src/assets/icons/claudyActions/icon-laptop.svg deleted file mode 100644 index 7e6a63d1e..000000000 --- a/src/assets/icons/claudyActions/icon-laptop.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/assets/icons/claudyActions/icon-phone.svg b/src/assets/icons/claudyActions/icon-phone.svg deleted file mode 100644 index d6041e6ad..000000000 --- a/src/assets/icons/claudyActions/icon-phone.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/assets/icons/claudyActions/icon-question-mark.svg b/src/assets/icons/claudyActions/icon-question-mark.svg deleted file mode 100644 index 271e0938a..000000000 --- a/src/assets/icons/claudyActions/icon-question-mark.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/components/Bar.jsx b/src/components/Bar.jsx index 95dc7328e..6d9023705 100644 --- a/src/components/Bar.jsx +++ b/src/components/Bar.jsx @@ -13,7 +13,6 @@ import Drawer from 'components/Drawer' import Settings from 'components/Settings' import Apps from 'components/Apps' import SearchBar from 'components/SearchBar' -import Claudy from 'components/Claudy' import { getTheme, hasFetched, @@ -22,7 +21,6 @@ import { fetchApps, fetchContext, fetchSettingsData, - shouldEnableClaudy, getWebviewContext } from 'lib/reducers' @@ -32,8 +30,6 @@ export class Bar extends Component { constructor(props) { super(props) this.state = { - claudyFired: false, // true to fire claudy (used by the drawer) - claudyOpened: false, drawerVisible: false, searchBarEnabled: props.isDrive && !props.isPublic && !isMobileApp() && !isFlagshipApp() @@ -83,26 +79,12 @@ export class Bar extends Component { } toggleDrawer = () => { - // don't allow to toggle the drawer if claudy opened or is opening - if (this.state.claudyOpened || this.state.claudyFired) return const drawerVisible = !this.state.drawerVisible // don't wait for transitionend if displaying if (drawerVisible) this.props.onDrawer(drawerVisible) this.setState({ drawerVisible }) } - toggleClaudy = (isFromDrawer = false) => { - if (!this.props.claudyEnabled) return - const { claudyOpened } = this.state - if (isFromDrawer && !claudyOpened) { - // if opened from drawer - // reset to toggle via the Claudy component - return this.setState({ claudyFired: true }) - } - if (this.state.claudyFired) this.setState({ claudyFired: false }) - this.setState({ claudyOpened: !claudyOpened }) - } - renderCenter() { const { appName, @@ -158,12 +140,7 @@ export class Bar extends Component { } render() { - const { - claudyFired, - claudyOpened, - drawerVisible, - searchBarEnabled - } = this.state + const { drawerVisible, searchBarEnabled } = this.state const { theme, @@ -172,7 +149,6 @@ export class Bar extends Component { barRight, barCenter, barSearch, - claudyEnabled, onDrawer, isPublic, onLogOut, @@ -207,22 +183,11 @@ export class Bar extends Component { this.toggleClaudy(true))) || false - } - isClaudyLoading={claudyFired} drawerListener={() => onDrawer(drawerVisible)} onLogOut={onLogOut} isInvertedTheme={isInvertedTheme} /> ) : null} - {claudyEnabled && ( - this.toggleClaudy(false)} - opened={claudyOpened} - /> - )} {userActionRequired && } @@ -254,7 +219,6 @@ export const mapStateToProps = state => ({ barCenter: getContent(state, 'center'), barSearch: getContent(state, 'search'), isDrive: isCurrentApp(state, { slug: 'drive' }), - claudyEnabled: shouldEnableClaudy(state), hasFetchedApps: hasFetched(state), webviewContext: getWebviewContext(state) }) diff --git a/src/components/Claudy.jsx b/src/components/Claudy.jsx deleted file mode 100644 index 000e28efc..000000000 --- a/src/components/Claudy.jsx +++ /dev/null @@ -1,81 +0,0 @@ -import React, { Component } from 'react' -import { getIntents } from 'lib/stack' - -class Claudy extends Component { - constructor(props, context) { - super(props) - this.store = context.barStore - this.state = { - isLoading: false, - isActive: false - } - this.intents = getIntents() - } - - UNSAFE_componentWillReceiveProps(nextProps) { - if (nextProps.claudyFired) this.toggle() - } - - componentWillReceiveProps(nextProps) { - return this.UNSAFE_componentWillReceiveProps(nextProps) - } - - toggle = () => { - if (!this.props.opened && !this.intentWrapperRef.childNodes.length) { - this.setState({ isLoading: true }) - // init Claudy intent - this.intents - .create('CLAUDY', 'io.cozy.settings', { - exposeIntentFrameRemoval: true - }) - .start(this.intentWrapperRef, () => { - this.setState({ isLoading: false, isActive: true }) - this.props.onToggle() // toggle claudy when the intent is loaded - }) - .then(({ removeIntentIframe }) => { - // exposeFrameRemoval intent event - // remove the intent frame at the end of the menu closing transition - const closedListener = e => { - if (e.propertyName === 'transform') { - removeIntentIframe() - this.setState({ isActive: false }) - e.target.removeEventListener('transitionend', closedListener) - } - } - this.intentWrapperRef.addEventListener( - 'transitionend', - closedListener, - false - ) - this.props.onToggle() - }) - } else { - this.setState({ isActive: !this.state.isActive }) - this.props.onToggle() - } - } - - render() { - const { opened } = this.props - const { isLoading, isActive } = this.state - return ( -
-