diff --git a/README.md b/README.md index 3b5c8e49e..68b2ecbb8 100644 --- a/README.md +++ b/README.md @@ -55,14 +55,14 @@ Using a watcher - with Hot Module Replacement: ```sh $ cd cozy-photos $ yarn watch:photos:browser -$ cozy-stack serve --appdir photos://cozy-photos/build/photos --disable-csp +$ cozy-stack serve --appdir photos://cozy-photos/build --disable-csp ``` Or directly build the app (static file generated): ```sh $ cd cozy-photos $ yarn build:photos -$ cozy-stack serve --appdir photos://cozy-photos/build/photos +$ cozy-stack serve --appdir photos://cozy-photos/build ``` Your app is available at http://photos.cozy.localhost:8080/#/folder @@ -81,7 +81,7 @@ $ yarn watch:photos:browser ```sh # in another terminal, run the docker container -$ docker run --rm -it -p 8080:8080 -v "$(pwd)/build/photos":/data/cozy-app/photos cozy/cozy-app-dev +$ docker run --rm -it -p 8080:8080 -v "$(pwd)/build":/data/cozy-app/photos cozy/cozy-app-dev ``` Your app is available at http://photos.cozy.tools:8080. diff --git a/jestHelpers/setup.js b/jestHelpers/setup.js index 27be965ac..ab88753c7 100644 --- a/jestHelpers/setup.js +++ b/jestHelpers/setup.js @@ -1,25 +1,8 @@ import Enzyme from 'enzyme' import Adapter from 'enzyme-adapter-react-16' -// To avoid the errors while creating theme (since no CSS stylesheet -// defining CSS variables is injected during tests) -// Material-UI: the color provided to augmentColor(color) is invalid. -// The color object needs to have a `main` property or a `500` property. -jest.mock('cozy-ui/transpiled/react/utils/color', () => ({ - ...jest.requireActual('cozy-ui/transpiled/react/utils/color'), - getCssVariableValue: () => '#fff' -})) - global.cozy = {} -jest.mock('cozy-bar/transpiled', () => ({ - BarLeft: ({ children }) => children, - BarRight: ({ children }) => children, - BarCenter: ({ children }) => children, - BarSearch: ({ children }) => children, - setTheme: () => null -})) - jest.mock('cozy-intent', () => ({ useWebviewIntent: jest.fn() })) diff --git a/package.json b/package.json index c959b722c..876422a95 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "1.66.0", "main": "src/main.jsx", "scripts": { - "build": "cozy-scripts build --manifest src/photos/targets/manifest.webapp --build-dir build/photos --src-dir src/photos --barV7 false --cozyClientJs", - "watch": "cozy-scripts watch --manifest src/photos/targets/manifest.webapp --build-dir build/photos --src-dir src/photos --barV7 false --cozyClientJs", - "start": "cozy-scripts start --manifest src/photos/targets/manifest.webapp --build-dir build/photos --src-dir src/photos --barV7 false --cozyClientJs", - "deploy": "cozy-app-publish --token $REGISTRY_TOKEN --build-dir 'build/photos/' --prepublish downcloud --postpublish mattermost", + "build": "cozy-scripts build --manifest src/photos/targets/manifest.webapp --build-dir build --src-dir src/photos --barV7 false --cozyClientJs", + "watch": "cozy-scripts watch --manifest src/photos/targets/manifest.webapp --build-dir build --src-dir src/photos --barV7 false --cozyClientJs", + "start": "cozy-scripts start --manifest src/photos/targets/manifest.webapp --build-dir build --src-dir src/photos --barV7 false --cozyClientJs", + "deploy": "cozy-app-publish --token $REGISTRY_TOKEN --build-dir 'build/' --prepublish downcloud --postpublish mattermost", "tx": "tx pull --all || true", "lint": "npm-run-all --parallel 'lint:*'", "lint:styles": "stylint src --config ./node_modules/cozy-scripts/config/.stylintrc", @@ -76,14 +76,14 @@ "@cozy/minilog": "1.0.0", "classnames": "2.3.1", "cozy-authentication": "2.10.10", - "cozy-bar": "10.0.0", + "cozy-bar": "^12.2.4", "cozy-ci": "0.5.2", - "cozy-client": "^45.1.0", + "cozy-client": "^47.6.0", "cozy-client-js": "0.20.0", "cozy-device-helper": "^2.5.0", "cozy-doctypes": "1.85.4", "cozy-flags": "3.0.1", - "cozy-harvest-lib": "18.0.0", + "cozy-harvest-lib": "^25.1.1", "cozy-intent": "^2.18.0", "cozy-keys-lib": "6.0.0", "cozy-logger": "1.9.1", @@ -91,9 +91,9 @@ "cozy-realtime": "4.6.0", "cozy-scanner": "^7.0.0", "cozy-scripts": "^8.2.0", - "cozy-sharing": "10.0.0", - "cozy-stack-client": "^45.0.1", - "cozy-ui": "100.0.0", + "cozy-sharing": "^14.1.0", + "cozy-stack-client": "^47.4.0", + "cozy-ui": "^108.0.0", "date-fns": "1.30.1", "justified-layout": "2.1.2", "kd-tree-javascript": "1.0.3", diff --git a/src/components/Bar.jsx b/src/components/Bar.jsx deleted file mode 100644 index 657ec9555..000000000 --- a/src/components/Bar.jsx +++ /dev/null @@ -1,58 +0,0 @@ -import React from 'react' -import CozyTheme from 'cozy-ui/transpiled/react/providers/CozyTheme' -import cx from 'classnames' -import cozyBar from 'lib/cozyBar' -import { VaultUnlockProvider, VaultProvider } from 'cozy-keys-lib' -import BarContextProvider from 'cozy-ui/transpiled/react/BarContextProvider' -import { useClient } from 'cozy-client' -import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' -import { useWebviewIntent } from 'cozy-intent' -import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints' - -const wrap = (Component, className) => { - const WrappedBarComponent = ({ children }) => { - return ( - - - {children} - - - ) - } - return WrappedBarComponent -} - -export const BarCenter = wrap(cozyBar.BarCenter, 'u-ellipsis') -export const BarRight = wrap(cozyBar.BarRight) -export const BarLeft = wrap(cozyBar.BarLeft) -export const BarSearch = wrap(cozyBar.BarSearch, 'u-flex-grow') - -export const BarRightWithProvider = ({ store, children }) => { - const client = useClient() - const { t, lang } = useI18n() - const webviewIntent = useWebviewIntent() - const { isMobile } = useBreakpoints() - - if (isMobile) { - return ( - - - - {children} - - - - ) - } - - return <>{children} -} diff --git a/src/components/Button/CozyHomeLink.jsx b/src/components/Button/CozyHomeLink.jsx index fb10da075..e68ba4573 100644 --- a/src/components/Button/CozyHomeLink.jsx +++ b/src/components/Button/CozyHomeLink.jsx @@ -1,18 +1,20 @@ import React from 'react' import PropTypes from 'prop-types' -import { ButtonLink, useI18n } from 'cozy-ui/transpiled/react' +import { useI18n } from 'cozy-ui/transpiled/react' +import Button from 'cozy-ui/transpiled/react/Buttons' +import Icon from 'cozy-ui/transpiled/react/Icon' import { HOME_LINK_HREF } from 'photos/constants/config' import CozyHomeLinkIcon from 'components/Button/CozyHomeLinkIcon' const CozyHomeLink = ({ className }) => { const { t } = useI18n() return ( - } className={className} href={HOME_LINK_HREF} - size={'normal'} /> ) } diff --git a/src/components/Button/MoreButton.jsx b/src/components/Button/MoreButton.jsx index 6dddd63d0..7dea59f7b 100644 --- a/src/components/Button/MoreButton.jsx +++ b/src/components/Button/MoreButton.jsx @@ -1,7 +1,9 @@ import React from 'react' +import cx from 'classnames' import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' -import { Button } from 'cozy-ui/transpiled/react' +import Button from 'cozy-ui/transpiled/react/Buttons' +import Icon from 'cozy-ui/transpiled/react/Icon' import DotsIcon from 'cozy-ui/transpiled/react/Icons/Dots' import styles from './index.styl' @@ -11,14 +13,12 @@ const MoreButton = ({ disabled, onClick, ...props }) => { return (