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

Dynamic changing of icon #67

Open
BigRaj opened this issue Aug 8, 2023 · 0 comments
Open

Dynamic changing of icon #67

BigRaj opened this issue Aug 8, 2023 · 0 comments

Comments

@BigRaj
Copy link

BigRaj commented Aug 8, 2023

I have set my Circle button to activate the camera, and when in camera mode, take pictures. I want to change the icon based on how many pictures have been taken. The use case is after 4 pictures, the next click should upload the images to the cloud. The functionality works fine, but I can't get the icon to change.

    if(selectedTab === 'camera' && picturesPending.length >3){
      return (
        <Animated.View style={styles.btnCircleUp}>
          <TouchableOpacity
            style={styles.button}
            onPress={ () => {
              takePicture(routeName, selectedTab, navigate);
            }}
          >
            <Ionicons name={'cloud-upload-outline'} color="#435dd0" size={25} />
          </TouchableOpacity>
        </Animated.View>
      );
    }
    if(selectedTab === 'camera'){
      return (
        <Animated.View style={styles.btnCircleUp}>
          <TouchableOpacity
            style={styles.button}
            onPress={() => {
              childRef.current.takePicture();
            }}
          >
            <Ionicons name={'camera'} color="#435dd0" size={25} />
          </TouchableOpacity>
        </Animated.View>
      );
    }
    else{
      return (
        <Animated.View style={styles.btnCircleUp}>
          <TouchableOpacity
            style={styles.button}
            onPress={() => navigate('camera')}
          >
            <Ionicons name={'camera'} color="gray" size={25} />
          </TouchableOpacity>
        </Animated.View>
      )
    }
  }```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant