Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ android {
applicationId "com.joshsoftware.intranet"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 19
versionName "2.4.0"
versionCode 20
versionName "2.5.0"
}
signingConfigs {
release {
Expand Down
18 changes: 10 additions & 8 deletions src/app/Peerly/components/AppreciationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {StarIcon} from '../constants/icons';
import InitialAvatar from './InitialAvatar';
import Typography from './typography';
import ImageWithFallback from './imageWithFallback/ImageWithFallback';

import message from '../constants/message';
interface AppreciationCardProps {
onPress?: (id: number) => void;
appreciationDetails: AppreciationDetails;
showAppreciatorName: boolean
showAppreciatorName?: boolean;
}

enum CoreValue {
Expand All @@ -26,7 +26,7 @@ enum CoreValue {
const AppreciationCard = ({
onPress,
appreciationDetails,
showAppreciatorName
showAppreciatorName,
}: AppreciationCardProps) => {
const receiverName = `${appreciationDetails.receiver_first_name || ''} ${
appreciationDetails.receiver_last_name || ''
Expand Down Expand Up @@ -74,7 +74,7 @@ const AppreciationCard = ({
<InitialAvatar name={receiverName} size={60} />
</View>
)}
{ showAppreciatorName && (
{ !showAppreciatorName && (
<>
{appreciationDetails?.sender_image_url !== '' ? (
<ImageWithFallback
Expand Down Expand Up @@ -118,20 +118,22 @@ const AppreciationCard = ({
{appreciationDetails.receiver_designation}
</Typography>
</View>
{showAppreciatorName && (
<>
<>
<View style={{ minHeight: 18 }}>
{(!showAppreciatorName || (showAppreciatorName && !appreciationDetails.by_management)) && (
<Typography type="h5" style={styles.appreciation}>
Appreciated by
</Typography>
)}
</View>
<Typography
type="h4"
style={styles.senderName}
numberOfLines={1}
ellipsizeMode="tail">
{senderName}
{showAppreciatorName ? appreciationDetails.by_management ? message.MANAGEMENT_APPRECIATOR : senderName : senderName}
</Typography>
</>
)}

<Typography type="h6" style={styles.days}>
{timeFromNow(appreciationDetails.created_at)}
Expand Down
6 changes: 4 additions & 2 deletions src/app/Peerly/components/GivenAndReceivedAppreciation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type GivenAndReceivedAppriciationProps = {
self?: boolean;
isLoading?: boolean;
disableBtn: boolean;
fromSearch?: boolean;
};

interface tabBarRoute extends Route {
Expand All @@ -47,6 +48,7 @@ const GivenAndReceivedAppriciation = ({
expressedList,
isLoading,
disableBtn,
fromSearch
}: GivenAndReceivedAppriciationProps) => {
const navigation = useNavigation<AppreciationDetailScreenNavigationProp>();
const layout = useWindowDimensions();
Expand Down Expand Up @@ -98,7 +100,7 @@ const GivenAndReceivedAppriciation = ({
<AppreciationCard
appreciationDetails={item}
onPress={handleAppreciationCardClick}
showAppreciatorName={true}
showAppreciatorName={fromSearch}
/>
)}
keyExtractor={item => String(item.id)}
Expand Down Expand Up @@ -134,7 +136,7 @@ const GivenAndReceivedAppriciation = ({
<AppreciationCard
appreciationDetails={item}
onPress={handleAppreciationCardClick}
showAppreciatorName={true}
showAppreciatorName={fromSearch}
/>
)}
keyExtractor={item => String(item.id)}
Expand Down
3 changes: 2 additions & 1 deletion src/app/Peerly/constants/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ export default {
{ label: 'Part of routine roles and responsibilities', value: 'Part of routine roles and responsibilities' },
{ label: 'Action is not from current quarter', value: 'Action is not from current quarter' },
{ label: 'Others', value: 'Others' },
]
],
MANAGEMENT_APPRECIATOR: 'Leader\'s Applause',
};
2 changes: 1 addition & 1 deletion src/app/Peerly/screens/HomeScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ const HomeScreen = () => {
<AppreciationCard
appreciationDetails={item}
onPress={handleAppreciationCardClick}
showAppreciatorName={false}
showAppreciatorName={true}
/>
)}
keyExtractor={item => String(item.id)}
Expand Down
1 change: 1 addition & 0 deletions src/app/Peerly/screens/ProfileDetailScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ const ProfileDetailScreen = () => {
isLoading={isLoadingAppreciations || isFetchingAppreciations}
disableBtn={isDisableTabBtn}
self={true}
fromSearch={false}
/>
</View>
<InfoModal
Expand Down
1 change: 1 addition & 0 deletions src/app/Peerly/screens/SearchScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const SearchScreen = () => {
expressedList={expressedAppriciationList}
isLoading={isLoadingAppreciations || isFetchingAppreciations}
disableBtn={isDisableTabBtn}
fromSearch={true}
/>
</View>
</View>
Expand Down
1 change: 1 addition & 0 deletions src/app/Peerly/services/home/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface AppreciationDetails {
reported_flag: boolean;
created_at: number;
updated_at: number;
by_management: boolean;
}

export type GetAppreciationListRequest = {
Expand Down
33 changes: 16 additions & 17 deletions src/app/navigation/RootNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ const RootNavigator = () => {

useEffect(() => {
const run = async () => {
// try {
// const version = await checkVersion({
// bundleId: BUNDLE_ID,
// });
try {
const version = await checkVersion({
bundleId: BUNDLE_ID,
});

// setVersionContextData(version);
// } catch {}
setVersionContextData(version);
} catch {}

const authToken = await AsyncStore.getItem(AsyncStore.AUTH_TOKEN_KEY);
const userData = await AsyncStore.getItem(AsyncStore.USER_DATA);
Expand Down Expand Up @@ -125,17 +125,16 @@ const RootNavigator = () => {
screenOptions={screenOptions}
initialRouteName={DRAWER}>
{
// versionContextData === null || versionContextData.version === null ? (
// <RootStack.Screen name={NO_VERSION} component={NoVersionScreen} />
// )
// : versionContextData.needsUpdate ? (
// <RootStack.Screen
// name={UPDATE_VERSION}
// component={UpdateVersionScreen}
// />
// )
// :
userContextData ? (
versionContextData === null || versionContextData.version === null ? (
<RootStack.Screen name={NO_VERSION} component={NoVersionScreen} />
)
: versionContextData.needsUpdate ? (
<RootStack.Screen
name={UPDATE_VERSION}
component={UpdateVersionScreen}
/>
)
: userContextData ? (
<>
<RootStack.Screen name={DRAWER} component={DrawerNavigator} />

Expand Down