Skip to content

Commit

Permalink
Fix - resolve review comments and add terms_accepted event
Browse files Browse the repository at this point in the history
Work on resolve review comments and add terms_accepted event
  • Loading branch information
DivyaniPatel96 committed May 10, 2024
1 parent 49e0535 commit e9ef418
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 238 deletions.
3 changes: 2 additions & 1 deletion app/assets/data/firebaseEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ export const CHATBOT_FAQ_SELECTED="chatbot_faq_selected";//chatbot faq category
export const EMAIL_SENT="email_sent";//Email Sent
export const DONATE_OPENED="donate_opened";//Donate Event
export const ARTICLE_SEARCHED="article_searched";//Article Searched Event
export const ACTIVITY_SEARCHED="activity_searched";//Activity Searched Event
export const ACTIVITY_SEARCHED="activity_searched";//Activity Searched Event
export const TERMS_ACCEPTED="terms_accepted";//Terms accepted Event
53 changes: 25 additions & 28 deletions app/components/ToggleRadiosBgColor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,36 @@ import Checkbox, { CheckboxActive, CheckboxItem } from './shared/CheckboxStyle';
import { FDirRow } from './shared/FlexBoxStyle';
import Icon from './shared/Icon';
import { RadioBoxContainer, RadioInnerBox, RadioOuter } from './shared/radio';
const styles=StyleSheet.create({
checkbox:{borderRadius: 50, borderWidth: 1},
checkboxItem:{borderRadius: 50},
heading3:{flexShrink:1},
lastView:{flexDirection:'row',flex:1}
})
const ToggleRadiosBgColor = (props: any):any => {
const {options,tickColor,tickbgColor,defaultValue} = props;
const [checkedItem, setCheckedItem] = useState(defaultValue?defaultValue:null);
useEffect(()=>{
setCheckedItem(defaultValue);
},[defaultValue])
const styles = StyleSheet.create({
checkbox: { borderRadius: 50, borderWidth: 1 },
checkboxItem: { borderRadius: 50 },
heading3: { flexShrink: 1 },
lastView: { flexDirection: 'row', flex: 1 }
})

const ToggleRadiosBgColor = (props: any): any => {
const { options, tickColor, tickbgColor, defaultValue } = props;
const [checkedItem, setCheckedItem] = useState(defaultValue ? defaultValue : null);
useEffect(() => {
setCheckedItem(defaultValue);
}, [defaultValue])
return (
<>
<RadioBoxContainer>
<FDirRow>
{options.map((item: typeof options[0], index: number) => {
return (

<RadioBoxContainer>
<FDirRow>
{options.map((item: typeof options[0], index: number) => {
return (
<RadioOuter key={index}
>
>
<RadioInnerBox
onPress={():any => {
onPress={(): any => {
setCheckedItem(item);
props.getCheckedItem(item);
}}>
<CheckboxItem>
<View>
{(checkedItem?.title && checkedItem.title == item.title) ? (
<CheckboxActive style={[styles.checkboxItem,{backgroundColor:tickbgColor}]}>
{(checkedItem?.title && checkedItem.title == item.title) ? (
<CheckboxActive style={[styles.checkboxItem, { backgroundColor: tickbgColor }]}>
<Icon name="ic_tick" size={12} color={tickColor} />
</CheckboxActive>
) : (
Expand All @@ -44,20 +43,18 @@ const ToggleRadiosBgColor = (props: any):any => {
)}
</View>
</CheckboxItem>

<View style={styles.lastView}>
{(checkedItem?.title && checkedItem.title == item.title) ? (
{(checkedItem?.title && checkedItem.title == item.title) ? (
<Heading3 style={styles.heading3} numberOfLines={2}>{item.title} </Heading3>
) : (
<Heading3Regular style={styles.heading3} numberOfLines={2}>{item.title} </Heading3Regular>
)}
</View>
</RadioInnerBox>
</RadioOuter>

);
})}
</FDirRow></RadioBoxContainer>
);
})}
</FDirRow></RadioBoxContainer>
</>
);
};
Expand Down
1 change: 0 additions & 1 deletion app/redux/reducers/localizationSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export const localizationSlice = createSlice({
state,
action: PayloadAction<any>,
): any => {
console.log('Hiiiiiiiiii', action.payload);
state.AppLayoutDirectionParams = action.payload;
},
},
Expand Down
12 changes: 7 additions & 5 deletions app/screens/Terms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import { bgcolorWhite2, secondaryBtnColor } from '@styles/style';
import VectorImage from 'react-native-vector-image';
import { activityLogo, adviceLogo, bebboLogoShapeNew, toolsLogo } from '@dynamicImportsClass/dynamicImports';
import FeatureTCView from '@components/shared/FeaturesTCView';

import { TERMS_ACCEPTED } from '@assets/data/firebaseEvents';
import { logEvent } from '../services/EventSyncService';
import useNetInfoHook from '../customHooks/useNetInfoHook';

type TermsNavigationProp = StackNavigationProp<
RootStackParamList,
Expand Down Expand Up @@ -76,14 +78,12 @@ const styles = StyleSheet.create({
const Terms = ({ navigation }: Props): any => {
const themeContext = useContext(ThemeContext);
const headerColor = themeContext?.colors.PRIMARY_REDESIGN_COLOR;
const termsTextColor = themeContext?.colors?.TERMS_TEXTCOLOR;

const [toggleCheckBox, setToggleCheckBox] = useState(false);
const [toggleCheckBox1, setToggleCheckBox1] = useState(false);
const [toggleCheckBox2, setToggleCheckBox2] = useState(true);
const isButtonDisabled = (toggleCheckBox == false)
const [loading, setLoading] = useState(true);
const { t } = useTranslation();
const netInfo = useNetInfoHook();

const goToPrivacyPolicy = (): any => {
navigation.navigate('PrivacyPolicy');
};
Expand Down Expand Up @@ -216,6 +216,8 @@ const Terms = ({ navigation }: Props): any => {
const acceptTerms = async (): Promise<any> => {
if (acceptTermsFlag == false) {
dispatch(setAcceptTerms(true));
const eventData = { 'name': TERMS_ACCEPTED}
logEvent(eventData, netInfo.isConnected)
}
navigation.navigate('LoadingScreen', {
apiJsonData: apiJsonData,
Expand Down
14 changes: 4 additions & 10 deletions app/screens/home/EditChildProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,25 +207,19 @@ const EditChildProfile = ({ route, navigation }: Props): any => {
handleBack();
}, []);
useFocusEffect(

React.useCallback(() => {

console.log('childData is', childData)
console.log('childData is profiles', childData)
if (childData != undefined && childData != null && childData != '' && childData.uuid != '') {
setphotoUri(childData.photoUri);
if (childData.photoUri != '' && childData.photoUri != null && childData.photoUri != undefined) {
setCapturedImage('file://' + `${CHILDREN_PATH}/${childData.photoUri}`);
}
sendData(childData);
}
console.log('childadata gender is', genders);
if(childData != undefined && childData != null && childData != '' && childData.uuid != '' && childData?.gender== 0 ) {
setDefaultGenderValue(genders.find((item: any) => item.id == girlChildGender))
}else{
setDefaultGenderValue(genders.find((item: any) => item.id == childData?.gender))
if (childData != null && childData.uuid !== '' && childData?.gender === 0) {
setDefaultGenderValue(genders.find((item: any) => item.id === girlChildGender))
} else {
setDefaultGenderValue(genders.find((item: any) => item.id === childData?.gender))
}

console.log(destPath)
}, []),
);
Expand Down
Loading

0 comments on commit e9ef418

Please sign in to comment.