Skip to content

Commit

Permalink
Merge pull request #579 from BinaryStudioAcademy/task/bt-502-add-veri…
Browse files Browse the repository at this point in the history
…fication-message-after-onboarding

bt-502: Mobile - Add verification message after onboarding steps for both roles
  • Loading branch information
katerynakostikova authored Sep 25, 2023
2 parents a95b364 + 92a655e commit 5405ac5
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 4 deletions.
1 change: 1 addition & 0 deletions mobile/src/bundles/common/components/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export { Slider } from './slider/slider';
export { Switch } from './switch/switch';
export { Tag } from './tag/tag';
export { Text } from './text/text';
export { VerificationMessage } from './verification-message/verification-message';
export { default as CheckBox } from '@react-native-community/checkbox';
export { default as CommunitySlider } from '@react-native-community/slider';
export { DrawerContentScrollView } from '@react-navigation/drawer';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Color } from '~/bundles/common/enums/enums';
import { StyleSheet } from '~/bundles/common/styles/styles';

const styles = StyleSheet.create({
text: {
borderRadius: 20,
backgroundColor: Color.WARNING,
color: '#FFFFFF',
},
});

export { styles };
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';

import { Text } from '~/bundles/common/components/components';
import { TextCategory } from '~/bundles/common/enums/enums';
import { globalStyles } from '~/bundles/common/styles/styles';

import { styles } from './styles';

const VerificationMessage: React.FC = () => {
return (
<Text
category={TextCategory.CAPTION}
style={[styles.text, globalStyles.p5, globalStyles.ph10]}
>
Waiting for approval
</Text>
);
};

export { VerificationMessage };
1 change: 1 addition & 0 deletions mobile/src/bundles/common/enums/ui/colors.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const Color = {
BUTTON_PRESSED: '#2E61AE',
BUTTON_DISABLED: '#AAB1BB',
TEXT: '#1F1E29',
WARNING: '#F0AD4E',
} as const;

export { Color };
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
ScrollView,
StatusBar,
Text,
VerificationMessage,
View,
} from '~/bundles/common/components/components';
import { Color, TextCategory } from '~/bundles/common/enums/enums';
Expand All @@ -18,6 +19,8 @@ import { styles } from './styles';
const EmployerProfile: React.FC = () => {
const { onboardingData } = useAppSelector(({ common }) => common);

const { isApproved } = onboardingData ?? {};

const employerOnboardingData: EmployerOnboardingFormDto | null =
onboardingData
? {
Expand Down Expand Up @@ -58,6 +61,7 @@ const EmployerProfile: React.FC = () => {
]}
>
<Text category={TextCategory.H3}>My profile</Text>
{!isApproved && <VerificationMessage />}
</View>

<ScrollView
Expand Down
12 changes: 12 additions & 0 deletions mobile/src/bundles/talent/screens/talent-profile/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Color } from '~/bundles/common/enums/enums';
import { StyleSheet } from '~/bundles/common/styles/styles';

const styles = StyleSheet.create({
header: {
backgroundColor: Color.BACKGROUND,
borderBottomWidth: 1,
borderColor: Color.INPUT,
},
});

export { styles };
Original file line number Diff line number Diff line change
@@ -1,9 +1,43 @@
import React from 'react';

import { Text } from '~/bundles/common/components/components';
import {
StatusBar,
Text,
VerificationMessage,
View,
} from '~/bundles/common/components/components';
import { Color, TextCategory } from '~/bundles/common/enums/enums';
import { useAppSelector } from '~/bundles/common/hooks/hooks';
import { globalStyles } from '~/bundles/common/styles/styles';

import { styles } from './style';

const TalentProfile: React.FC = () => {
return <Text>Talent Profile screen</Text>;
const { isApproved } =
useAppSelector(({ common }) => common.onboardingData) ?? {};

return (
<>
<StatusBar
barStyle="dark-content"
backgroundColor={Color.BACKGROUND}
/>
<View
style={[
globalStyles.pv25,
globalStyles.pl25,
globalStyles.pr10,
styles.header,
globalStyles.flexDirectionRow,
globalStyles.justifyContentSpaceBetween,
globalStyles.alignItemsCenter,
]}
>
<Text category={TextCategory.H3}>Your profile</Text>
{!isApproved && <VerificationMessage />}
</View>
</>
);
};

export { TalentProfile };
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,28 @@ import {
IconName,
} from '~/bundles/common/enums/enums';
import { createBottomTabNavigator } from '~/bundles/common/helpers/helpers';
import { useAppSelector } from '~/bundles/common/hooks/hooks';
import { type EmployerBottomTabNavigationParameterList } from '~/bundles/common/types/types';
import {
Candidates,
EmployerProfile,
} from '~/bundles/employer/screens/screens';
import { notifications } from '~/framework/notifications/notifications';

import { bottomTabStyles } from '../styles';

const BottomTab =
createBottomTabNavigator<EmployerBottomTabNavigationParameterList>();

const EmployerBottomTabNavigator: React.FC = () => {
const { isApproved } =
useAppSelector(({ common }) => common.onboardingData) ?? {};

return (
<BottomTab.Navigator screenOptions={bottomTabStyles}>
<BottomTab.Navigator
screenOptions={bottomTabStyles}
initialRouteName={EmployerBottomTabScreenName.EMPLOYER_PROFILE}
>
<BottomTab.Screen
name={EmployerBottomTabScreenName.CANDIDATES}
component={Candidates}
Expand All @@ -34,6 +42,16 @@ const EmployerBottomTabNavigator: React.FC = () => {
/>
),
}}
listeners={{
tabPress: (event): void => {
if (!isApproved) {
notifications.showError({
title: 'You are not verified to see other pages',
});
event.preventDefault();
}
},
}}
/>
<BottomTab.Screen
name={EmployerBottomTabScreenName.CHAT_LIST}
Expand All @@ -47,6 +65,16 @@ const EmployerBottomTabNavigator: React.FC = () => {
/>
),
}}
listeners={{
tabPress: (event): void => {
if (!isApproved) {
notifications.showError({
title: 'You are not verified to see other pages',
});
event.preventDefault();
}
},
}}
/>
<BottomTab.Screen
name={EmployerBottomTabScreenName.EMPLOYER_PROFILE}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,25 @@ import {
TalentBottomTabScreenName,
} from '~/bundles/common/enums/enums';
import { createBottomTabNavigator } from '~/bundles/common/helpers/helpers';
import { useAppSelector } from '~/bundles/common/hooks/hooks';
import { type TalentBottomTabNavigationParameterList } from '~/bundles/common/types/types';
import { Mail, TalentProfile } from '~/bundles/talent/screens/screens';
import { notifications } from '~/framework/notifications/notifications';

import { bottomTabStyles } from '../styles';

const BottomTab =
createBottomTabNavigator<TalentBottomTabNavigationParameterList>();

const TalentBottomTabNavigator: React.FC = () => {
const { isApproved } =
useAppSelector(({ common }) => common.onboardingData) ?? {};

return (
<BottomTab.Navigator screenOptions={bottomTabStyles}>
<BottomTab.Navigator
screenOptions={bottomTabStyles}
initialRouteName={TalentBottomTabScreenName.TALENT_PROFILE}
>
<BottomTab.Screen
name={TalentBottomTabScreenName.MAIL}
component={Mail}
Expand All @@ -30,6 +38,16 @@ const TalentBottomTabNavigator: React.FC = () => {
/>
),
}}
listeners={{
tabPress: (event): void => {
if (!isApproved) {
notifications.showError({
title: 'You are not verified to see other pages',
});
event.preventDefault();
}
},
}}
/>
<BottomTab.Screen
name={TalentBottomTabScreenName.TALENT_PROFILE}
Expand Down

0 comments on commit 5405ac5

Please sign in to comment.