Skip to content

Commit

Permalink
added version popup, so users can select, removed the old static comp…
Browse files Browse the repository at this point in the history
…onent. Fixed navigation issue in Team Screen (#1779)
  • Loading branch information
desperado1802 authored Nov 14, 2023
1 parent 884af94 commit 0d859ec
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 174 deletions.
6 changes: 3 additions & 3 deletions apps/mobile/app/components/TaskVersion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ interface TaskVersionProps {
task?: ITeamTask
containerStyle?: ViewStyle
version?: string
setPriority?: (priority: string) => unknown
setVersion?: (priority: string) => unknown
}

const TaskVersion: FC<TaskVersionProps> = observer(
({ task, containerStyle, version, setPriority }) => {
({ task, containerStyle, version, setVersion }) => {
const { colors } = useAppTheme()
const { updateTask } = useTeamTasks()
const [openModal, setOpenModal] = useState(false)
Expand All @@ -42,7 +42,7 @@ const TaskVersion: FC<TaskVersionProps> = observer(

await updateTask(taskEdit, task.id)
} else {
setPriority(text)
setVersion(text)
}
}

Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/components/TaskVersionPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const Item: FC<ItemProps> = ({ currentVersionName, version, onVersionSelected })
return (
<TouchableOpacity onPress={() => onVersionSelected(version)}>
<View style={{ ...styles.wrapperItem, borderColor: colors.border }}>
<View style={{ ...styles.colorFrame, backgroundColor: version.color }}>
<View style={{ ...styles.colorFrame, backgroundColor: "transparent" }}>
<BadgedTaskVersion iconSize={16} TextSize={14} version={version.name} />
</View>
<View>
Expand Down
34 changes: 0 additions & 34 deletions apps/mobile/app/components/Version.tsx

This file was deleted.

5 changes: 3 additions & 2 deletions apps/mobile/app/components/VersionIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import React, { useMemo } from "react"
import { View, Text } from "react-native"
import { SvgUri } from "react-native-svg"
import { typography } from "../theme"
import { typography, useAppTheme } from "../theme"
import { observer } from "mobx-react-lite"
import { limitTextCharaters } from "../helpers/sub-text"

Check warning on line 8 in apps/mobile/app/components/VersionIcon.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (Charaters)
import { useTaskVersion } from "../services/hooks/features/useTaskVersion"

export const BadgedTaskVersion = observer(
({ version, TextSize, iconSize }: { version: string; TextSize: number; iconSize: number }) => {
const { taskVersionList } = useTaskVersion()
const { colors } = useAppTheme()

const currentSize = useMemo(
() => taskVersionList.find((s) => s.name === version),
Expand All @@ -27,7 +28,7 @@ export const BadgedTaskVersion = observer(
<SvgUri width={iconSize} height={iconSize} uri={currentSize?.fullIconUrl} />
<Text
style={{
color: "#292D32",
color: colors.primary,
left: 5,
fontSize: TextSize,
fontFamily: typography.fonts.PlusJakartaSans.semiBold,
Expand Down
Loading

0 comments on commit 0d859ec

Please sign in to comment.