react-native-camera-kit icon indicating copy to clipboard operation
react-native-camera-kit copied to clipboard

Pass Component as icons.

Open codakkk opened this issue 4 years ago • 6 comments

https://github.com/teslamotors/react-native-camera-kit/blob/feacdfb0bfb4e94abfa795719dac24152214b92d/src/CameraScreen.tsx#L135

RN-Camera-Kit should let the developer pass a Component over a string for icons. This is useful when using libraries like react-native-vector-icons. Example:

<CameraScreen 
      .....
      torchOffImage={<MaterialCommunityIcons name="torch" />}
/>

EDIT: I'm actually working on a PR for this request :)

codakkk avatar Feb 02 '21 20:02 codakkk

@aarongrider Hi Aaron, I'm actually having some problems after cloning the repository (probably something missing).

  1. On each react-native import, I get this error: Parse errors in imported module 'react-native': ';' expected. (13:32)eslintimport/namespace Parse errors in imported module 'react-native': ';' expected. (13:32)eslintimport/named

  2. Also, foreach

import Camera from './Camera'; 

I'm getting this: Cannot find module './Camera' or its corresponding type declarations.

The first one seems a problem relative to eslint, just found out that removing 'import/named': 'error' and 'import/namespace': 'error' from .eslintrc.js solves the problem (Is there a different way? Am I missing something?)

The second error seems something about platform-specific extensions, as if TypeScript cannot understand what is going on. I'm using TypeScript 4.1.2.

What am I missing?

codakkk avatar Feb 03 '21 15:02 codakkk

Hey @codakkk, are you trying to run the example project or are you adding camera-kit to your existing project?

You will want to either:

  • clone this project if you are running the example
  • manually add camera-kit from GitHub "react-native-camera-kit": "git+https://github.com/teslamotors/react-native-camera-kit.git"

We haven't published the latest in master to npm yet. We will be publishing a v11 release in the next few weeks once we have have had sufficient time to finish testing.

aarongrider avatar Feb 03 '21 18:02 aarongrider

Hey @codakkk, are you trying to run the example project or are you adding camera-kit to your existing project?

You will want to either:

  • clone this project if you are running the example
  • manually add camera-kit from GitHub "react-native-camera-kit": "git+https://github.com/teslamotors/react-native-camera-kit.git"

We haven't published the latest in master to npm yet. We will be publishing a v11 release in the next few weeks once we have have had sufficient time to finish testing.

The example is working right now. I'm trying to add the feature described in the issue, the fact is there are those errors I can't get over.

codakkk avatar Feb 03 '21 18:02 codakkk

Change your package.json try changing from "react-native-camera-kit": 10.0.0 -> "react-native-camera-kit": "git+https://github.com/teslamotors/react-native-camera-kit.git"

aarongrider avatar Feb 05 '21 00:02 aarongrider

Change your package.json try changing from "react-native-camera-kit": 10.0.0 -> "react-native-camera-kit": "git+https://github.com/teslamotors/react-native-camera-kit.git"

Some misunderstanding happening here 😄 I actually want to implemente the feature described in the issue, placing components over just texts on Icons. The fact is, when I clone the repository, the errors I wrote in my past replies happens.

codakkk avatar Feb 05 '21 19:02 codakkk

I pushed a PR (#378) for this Issue

codakkk avatar Feb 28 '21 20:02 codakkk