diff --git a/react/AppLinker/Readme.md b/react/AppLinker/Readme.md
index d18d74edd..da55fce98 100644
--- a/react/AppLinker/Readme.md
+++ b/react/AppLinker/Readme.md
@@ -1,15 +1,10 @@
Render-props component that provides onClick/href handler to
apply to an anchor that needs to open an app.
-If the app is known to Cozy (for example Drive or Banks), and
-the user has installed it on its device, the native app will
-be opened.
-
The app's manifest can be set in the `app` prop. Then, in a
ReactNative environment, the AppLinker will be able to send
`openApp` message to the native environment with this `app`
-data. Ideally the `mobile` member should be set with all data
-needed to open the native app ([more info](https://github.com/cozy/cozy-stack/blob/master/docs/apps.md#mobile))
+data.
Handles several cases:
@@ -28,32 +23,9 @@ const app = {
};
{
- ({ onClick, href, name }) => (
-
- Open { name }
-
- )
-}
-```
-
-### Exemple with mobile data
-
-```jsx
-import AppLinker from 'cozy-ui/transpiled/react/AppLinker';
-
-const app = {
- slug: 'passwords',
- mobile: {
- schema: 'cozypass://',
- id_playstore: 'io.cozy.pass',
- id_appstore: 'cozy-pass/id1502262449'
- }
-};
-
-{
- ({ onClick, href, name }) => (
+ ({ onClick, href }) => (
- Open { name }
+ Open
)
}
diff --git a/react/AppLinker/__snapshots__/index.deprecated.spec.jsx.snap b/react/AppLinker/__snapshots__/index.deprecated.spec.jsx.snap
deleted file mode 100644
index c40db496b..000000000
--- a/react/AppLinker/__snapshots__/index.deprecated.spec.jsx.snap
+++ /dev/null
@@ -1,13 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`app icon should render correctly 1`] = `
-
-`;
diff --git a/react/AppLinker/index.deprecated.spec.jsx b/react/AppLinker/index.deprecated.spec.jsx
deleted file mode 100644
index e7fb9e446..000000000
--- a/react/AppLinker/index.deprecated.spec.jsx
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Those tests are here to test previous AppLinker implementation base on
- * `slug` prop.
- * Now that AppLinkers implements `app` prop and uses `app.slug`, the old
- * `slug` prop is deprecated
- * Those tests should be kept until `slug` prop is completely removed
- */
-
-import { render } from '@testing-library/react'
-import userEvent from '@testing-library/user-event'
-import React from 'react'
-
-import AppLinker from '.'
-
-jest.useFakeTimers()
-
-const setup = ({ app, onAppSwitch }) => {
- return {
- user: userEvent.setup({ delay: null }),
- ...render(
-
- {({ onClick, href, name }) => (
-
- )}
-
- )
- }
-}
-
-const app = {
- slug: 'drive',
- name: 'Drive'
-}
-
-describe('app icon', () => {
- let spyConsoleError, spyConsoleWarn, appSwitchMock
-
- beforeEach(() => {
- spyConsoleError = jest.spyOn(console, 'error')
- spyConsoleError.mockImplementation(() => {})
- spyConsoleWarn = jest.spyOn(console, 'warn')
- spyConsoleWarn.mockImplementation(() => {})
- appSwitchMock = jest.fn()
- })
-
- afterEach(() => {
- spyConsoleError.mockRestore()
- spyConsoleWarn.mockRestore()
- jest.restoreAllMocks()
- })
-
- it('should render correctly', () => {
- const { container } = setup({ app })
- expect(container).toMatchSnapshot()
- })
-
- it('should work for web -> web', async () => {
- const { container, user } = setup({ app, onAppSwitch: appSwitchMock })
- const link = container.querySelector('a')
- await user.click(link)
- expect(appSwitchMock).not.toHaveBeenCalled()
- })
-})
diff --git a/react/AppLinker/index.jsx b/react/AppLinker/index.jsx
index 109152ab7..9ba3a52ad 100644
--- a/react/AppLinker/index.jsx
+++ b/react/AppLinker/index.jsx
@@ -29,19 +29,7 @@ export class AppLinker extends React.Component {
}
static getSlug(props) {
- if (props.app && props.app.slug) {
- return props.app.slug
- }
-
- return props.slug
- }
-
- static deprecateSlug(props) {
- if (props.slug) {
- console.warn(
- `AppLinker's 'slug' prop is deprecated, please use 'app.slug' instead`
- )
- }
+ return props.app.slug
}
static getOnClickHref(props, context, imgRef) {
@@ -95,8 +83,6 @@ export class AppLinker extends React.Component {
render() {
const { children } = this.props
- AppLinker.deprecateSlug(this.props)
-
const { href, onClick } = AppLinker.getOnClickHref(
this.props,
this.context,
@@ -112,8 +98,6 @@ export class AppLinker extends React.Component {
}
AppLinker.propTypes = {
- /** DEPRECATED: please use app.slug prop */
- slug: PropTypes.string,
/*
Full web url : Used by default on desktop browser
Used as a fallback_uri on mobile web