Skip to content

Commit

Permalink
Improve/task screen time block group time (#1777)
Browse files Browse the repository at this point in the history
* added the show more to load more members

* added translations
  • Loading branch information
desperado1802 authored Nov 14, 2023
1 parent 738aee8 commit 05a558e
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 1 deletion.
17 changes: 16 additions & 1 deletion apps/mobile/app/components/Task/TimeBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ interface ITotalGroupTime {

const TotalGroupTime: React.FC<ITotalGroupTime> = ({ totalTime, activeTeam, task }) => {
const [expanded, setExpanded] = useState(false)
const [numMembersToShow, setNumMembersToShow] = useState<number>(5)
const { colors } = useAppTheme()

function toggleItem() {
Expand Down Expand Up @@ -280,7 +281,7 @@ const TotalGroupTime: React.FC<ITotalGroupTime> = ({ totalTime, activeTeam, task
{expanded && <View style={{ marginBottom: 5 }} />}
<View style={{ gap: 7 }}>
{expanded &&
matchingMembers?.map((member, idx) => {
matchingMembers?.slice(0, numMembersToShow).map((member, idx) => {
const taskDurationInSeconds = findUserTotalWorked(member, task?.id)

const { h, m } = secondsToTime(taskDurationInSeconds)
Expand All @@ -297,6 +298,20 @@ const TotalGroupTime: React.FC<ITotalGroupTime> = ({ totalTime, activeTeam, task
/>
)
})}
{task?.members.length > 0 &&
task?.members?.length - 2 >= numMembersToShow &&
expanded && (
<TouchableOpacity
onPress={() => setNumMembersToShow((prev) => prev + 5)}
style={{ marginLeft: "auto" }}
>
<Text
style={{ fontSize: 10, fontWeight: "600", color: colors.primary }}
>
{translate("taskDetailsScreen.showMore")}
</Text>
</TouchableOpacity>
)}
</View>
</View>
)
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/app/i18n/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ const ar: Translations = {
description: "الوصف",
descriptionBlockPlaceholder: "اكتب وصفاً كاملاً لمشروعك...",
copyDescription: "تم نسخ الوصف.",
showMore: "أظهر المزيد",
},
tasksScreen: {
name: "مهام",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/app/i18n/bg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const bg = {
description: "Description",
descriptionBlockPlaceholder: "Write a complete description of your project...",
copyDescription: "Description Copied.",
showMore: "Show More",
},
tasksScreen: {
name: "Tasks",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/app/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const en = {
description: "Description",
descriptionBlockPlaceholder: "Write a complete description of your project...",
copyDescription: "Description Copied.",
showMore: "Show More",
},
tasksScreen: {
name: "Tasks",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/app/i18n/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const es = {
description: "Description",
descriptionBlockPlaceholder: "Write a complete description of your project...",
copyDescription: "Description Copied.",
showMore: "Show More",
},
tasksScreen: {
name: "Tasks",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/app/i18n/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const fr = {
description: "Description",
descriptionBlockPlaceholder: "Écrivez une description complète de votre projet...",
copyDescription: "Description copiée.",
showMore: "Afficher plus",
},
tasksScreen: {
name: "Tâches",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/app/i18n/he.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const he = {
description: "Description",
descriptionBlockPlaceholder: "Write a complete description of your project...",
copyDescription: "Description Copied.",
showMore: "Show More",
},
tasksScreen: {
name: "Tasks",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/app/i18n/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const ko: Translations = {
description: "설명",
descriptionBlockPlaceholder: "프로젝트에 대한 완전한 설명을 작성하세요...",
copyDescription: "설명이 복사되었습니다.",
showMore: "더 보기",
},
tasksScreen: {
name: "작업",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/app/i18n/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const ru = {
description: "Description",
descriptionBlockPlaceholder: "Write a complete description of your project...",
copyDescription: "Description Copied.",
showMore: "Show More",
},
tasksScreen: {
name: "Tasks",
Expand Down

0 comments on commit 05a558e

Please sign in to comment.