Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove cordova stuff from AppLinker #2728

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 3 additions & 31 deletions react/AppLinker/Readme.md
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -28,32 +23,9 @@ const app = {
};

<AppLinker app={app} href='http://dalailama-banks.mycozy.cloud'>{
({ onClick, href, name }) => (
<a href={href} onClick={onClick}>
Open { name }
</a>
)
}</AppLinker>
```

### 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'
}
};

<AppLinker app={app} href='http://dalailama-passwords.mycozy.cloud'>{
({ onClick, href, name }) => (
({ onClick, href }) => (
<a href={href} onClick={onClick}>
Open { name }
Open
</a>
)
}</AppLinker>
Expand Down
25 changes: 0 additions & 25 deletions react/AppLinker/__snapshots__/index.deprecated.spec.jsx.snap

This file was deleted.

12 changes: 0 additions & 12 deletions react/AppLinker/__snapshots__/index.spec.jsx.snap
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`app icon should not crash if no href 1`] = `
<div>
<div>
<a>
Open
Cozy Drive
</a>
</div>
</div>
`;

exports[`app icon should render correctly 1`] = `
<div>
<div>
<a
href="https://fake.link"
>
Open
Cozy Drive
</a>
</div>
</div>
Expand Down
13 changes: 0 additions & 13 deletions react/AppLinker/expiringMemoize.js

This file was deleted.

162 changes: 0 additions & 162 deletions react/AppLinker/index.deprecated.spec.jsx

This file was deleted.

Loading
Loading