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

[Android] CopilotStep text color error when device dark mode #329

Open
nppull opened this issue Aug 19, 2024 · 1 comment
Open

[Android] CopilotStep text color error when device dark mode #329

nppull opened this issue Aug 19, 2024 · 1 comment

Comments

@nppull
Copy link

nppull commented Aug 19, 2024

Environment

  • Device: samsung galaxy a22
  • OS: android 11
  • react-native-copilot: v3.3.2
  • react-native: v0.73.5

When the device is in dark mode, the tooltip backgroundcolor is white and the text color is also white.

@nppull nppull changed the title CopilotStep text color when dark-content CopilotStep text color error when dark-content Aug 19, 2024
@nppull nppull changed the title CopilotStep text color error when dark-content [Android] CopilotStep text color error when dark-content Aug 19, 2024
@nppull nppull changed the title [Android] CopilotStep text color error when dark-content [Android] CopilotStep text color error when device dark mode Aug 19, 2024
@David-Singh-Negi
Copy link

Create a custom ToolTip Container. export const Tooltip = ({labels}: TooltipProps) => {
const [sectionComplete, setSectionComplete] = useState(true);
const [previousOrder, setPreviousOrder] = useState('explore');

const {
goToNext,
goToPrev,
stop,
currentStep,
isFirstStep,
isLastStep,
currentStepNumber,
} = useCopilot();

const navigation = useNavigation();

console.log('Current Order : ', currentStep?.order);
console.log('currentStepNumber : ', currentStepNumber);

const handleStop = () => {
void stop();
navigation.navigate('InAppDashboard', {
sectionComplete: sectionComplete,
order: previousOrder,
});
};

const handleNext = () => {
void goToNext();
};

const handlePrev = () => {
void goToPrev();
};

return (



{currentStep?.text}



{!isLastStep && (
<Button
onPress={handleStop}
label={labels.skip}
color={colors.white}
textStyle={{
color: colors.white,
fontSize: wp(3),
fontWeight: '400',
}}
customIcon={'log-out-outline'}
customIconStyle={{fontSize: wp(3.5)}}
customStyle={{
width: '30%',
alignSelf: 'center',
backgroundColor: colors.coralred,
borderRadius: wp(1),
height: wp(7),
padding: 0,
}}
iconSpace={2}
/>
)}

    {!isFirstStep && (
      <Button
        onPress={handlePrev}
        label={labels.previous}
        color={colors.white}
        textStyle={{
          color: colors.white,
          fontSize: wp(3),
          fontWeight: '400',
        }}
        customIcon={'arrow-back'}
        customIconStyle={{fontSize: wp(3.5)}}
        customStyle={{
          width: '20%',
          alignSelf: 'center',
          backgroundColor: colors.coraldarkgreen,
          borderRadius: wp(1),
          height: wp(7),
          padding: 0,
        }}
        iconSpace={2}
      />
    )}

    {!isLastStep ? (
      <Button
        onPress={handleNext}
        label={labels.next}
        color={colors.white}
        textStyle={{
          color: colors.white,
          fontSize: wp(3),
          fontWeight: '400',
        }}
        customIcon={'arrow-forward'}
        customIconStyle={{fontSize: wp(3.5)}}
        customStyle={{
          width: '20%',
          alignSelf: 'center',
          backgroundColor: colors.coralblue,
          borderRadius: wp(1),
          height: wp(7),
          padding: 0,
        }}
        iconSpace={2.2}
      />
    ) : (
      <Button
        onPress={handleStop}
        label={labels.skip}
        color={colors.white}
        textStyle={{
          color: colors.white,
          fontSize: wp(3),
          fontWeight: '400',
        }}
        customIcon={'exit-outline'}
        customIconStyle={{fontSize: wp(3.5)}}
        customStyle={{
          width: '30%',
          alignSelf: 'center',
          backgroundColor: colors.coralred,
          borderRadius: wp(1),
          height: wp(7),
          padding: 0,
        }}
        iconSpace={2}
      />
    )}
  </View>
</View>

);
}; Pass it here const InAppFExploreMainDashboardWithCopilot = () => {
const MARGIN = wp(2);
const WIDTH = Dimensions.get('window').width - 2 * MARGIN;

return (
<CopilotProvider
labels={{
previous: 'Back',
next: 'Next',
skip: 'Exit Module',
finish: 'Finish',
}}
tooltipComponent={Tooltip}
tooltipStyle={{
width: WIDTH,
maxWidth: WIDTH,
borderRadius: wp(3),
left: wp(2),
}}
androidStatusBarVisible
backdropColor={'rgba(0, 0, 0, 0.5)'}>


);
};

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

2 participants