Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/modal bottom sheet backgrounds #1618

Merged
merged 6 commits into from
Oct 24, 2023
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
32 changes: 26 additions & 6 deletions apps/mobile/app/components/CreateTeamModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { GLOBAL_STYLE as GS } from "../../assets/ts/styles"
import { typography, useAppTheme } from "../theme"
import { TextInput } from "react-native-gesture-handler"
import { translate } from "../i18n"
import { BlurView } from "expo-blur"

export interface Props {
visible: boolean
Expand Down Expand Up @@ -53,6 +54,15 @@ const ModalPopUp = ({ visible, children }) => {
}
return (
<Modal transparent visible={showModal}>
<BlurView
intensity={15}
tint="dark"
style={{
position: "absolute",
width: "100%",
height: "100%",
}}
/>
<KeyboardAvoidingView
style={$modalBackGround}
behavior={Platform.OS === "ios" ? "padding" : "height"}
Expand All @@ -79,14 +89,19 @@ const CreateTeamModal: FC<Props> = function CreateTeamModal({ visible, onDismiss
<ModalPopUp visible={visible}>
<View style={[styles.mainContainer, { backgroundColor: colors.background }]}>
<View style={{ ...GS.w100 }}>
<Text style={[styles.mainTitle, { color: colors.primary }]}>{"Enter new team name"}</Text>
<Text style={[styles.mainTitle, { color: colors.primary }]}>
{"Enter new team name"}
</Text>
<View>
<TextInput
placeholderTextColor={colors.tertiary}
autoCapitalize={"none"}
autoCorrect={false}
value={teamText}
style={[styles.textInput, { borderColor: colors.border, color: colors.primary }]}
style={[
styles.textInput,
{ borderColor: colors.border, color: colors.primary },
]}
placeholder={"Please enter your team name"}
onChangeText={(text) => setTeamText(text)}
/>
Expand All @@ -105,12 +120,17 @@ const CreateTeamModal: FC<Props> = function CreateTeamModal({ visible, onDismiss
<TouchableOpacity
style={[
styles.button,
{ backgroundColor: "#3826A6", opacity: teamText.trim().length < 3 ? 0.5 : 1 },
{
backgroundColor: "#3826A6",
opacity: teamText.trim().length < 3 ? 0.5 : 1,
},
]}
disabled={teamText.trim().length < 3}
onPress={() => handleSubmit()}
>
<Text style={styles.buttonText}>{translate("teamScreen.sendButton")}</Text>
<Text style={styles.buttonText}>
{translate("teamScreen.sendButton")}
</Text>
</TouchableOpacity>
</View>
</View>
Expand All @@ -123,12 +143,12 @@ export default CreateTeamModal

const $modalBackGround: ViewStyle = {
flex: 1,
backgroundColor: "rgba(0,0,0,0.5)",
// backgroundColor: "rgba(0,0,0,0.5)",
justifyContent: "flex-end",
}
const $modalContainer: ViewStyle = {
height,
backgroundColor: "rgba(0,0,0,0.6)",

justifyContent: "flex-end",
}

Expand Down
37 changes: 31 additions & 6 deletions apps/mobile/app/components/TaskLabelPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
TouchableOpacity,
TouchableWithoutFeedback,
} from "react-native"
import { Feather, AntDesign, Ionicons } from "@expo/vector-icons"

Check warning on line 15 in apps/mobile/app/components/TaskLabelPopup.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (Ionicons)
import { spacing, useAppTheme, typography } from "../theme"
import { ITaskLabelItem } from "../services/interfaces/ITaskLabel"
import { useTaskLabels } from "../services/hooks/features/useTaskLabels"
import { BadgedTaskLabel } from "./LabelIcon"
import { translate } from "../i18n"
import TaskLabelForm from "../screens/Authenticated/TaskLabelScreen/components/TaskLabelForm"
import { BlurView } from "expo-blur"

export interface Props {
visible: boolean
Expand Down Expand Up @@ -55,9 +56,20 @@
}
return (
<Modal animationType="fade" transparent visible={showModal}>
<BlurView
intensity={15}
tint="dark"
style={{
position: "absolute",
width: "100%",
height: "100%",
}}
/>
<TouchableWithoutFeedback onPress={onDismiss}>
<View style={$modalBackGround}>
<Animated.View style={{ transform: [{ scale: scaleValue }] }}>{children}</Animated.View>
<Animated.View style={{ transform: [{ scale: scaleValue }] }}>
{children}
</Animated.View>
</View>
</TouchableWithoutFeedback>
</Modal>
Expand Down Expand Up @@ -114,11 +126,23 @@
/>
{canCreateLabel && !arrayChanged ? (
<TouchableOpacity
style={{ ...styles.createButton, borderColor: dark ? "#6755C9" : "#3826A6" }}
style={{
...styles.createButton,
borderColor: dark ? "#6755C9" : "#3826A6",
}}
onPress={() => setCreateTaskMode(true)}
>
<Ionicons name="add" size={24} color={dark ? "#6755C9" : "#3826A6"} />
<Text style={{ ...styles.btnText, color: dark ? "#6755C9" : "#3826A6" }}>
<Ionicons

Check warning on line 135 in apps/mobile/app/components/TaskLabelPopup.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (Ionicons)
name="add"
size={24}
color={dark ? "#6755C9" : "#3826A6"}
/>
<Text
style={{
...styles.btnText,
color: dark ? "#6755C9" : "#3826A6",
}}
>
{translate("settingScreen.labelScreen.createNewLabelText")}
</Text>
</TouchableOpacity>
Expand All @@ -136,7 +160,9 @@
onPress={saveLabels}
style={[styles.button, { backgroundColor: "#3826A6" }]}
>
<Text style={styles.buttonText}>{translate("common.save")}</Text>
<Text style={styles.buttonText}>
{translate("common.save")}
</Text>
</TouchableOpacity>
</View>
)}
Expand Down Expand Up @@ -176,7 +202,7 @@
{!selected ? (
<Feather name="circle" size={24} color={colors.divider} />
) : (
<AntDesign name="checkcircle" size={24} color="#27AE60" />

Check warning on line 205 in apps/mobile/app/components/TaskLabelPopup.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (checkcircle)
)}
</View>
</View>
Expand All @@ -186,7 +212,6 @@

const $modalBackGround: ViewStyle = {
flex: 1,
backgroundColor: "#000000AA",
justifyContent: "center",
}

Expand Down
15 changes: 13 additions & 2 deletions apps/mobile/app/components/TaskPriorityPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import { useTaskPriority } from "../services/hooks/features/useTaskPriority"
import { ITaskPriorityItem } from "../services/interfaces/ITaskPriority"
import { translate } from "../i18n"
import { BlurView } from "expo-blur"

export interface Props {
visible: boolean
Expand Down Expand Up @@ -51,9 +52,20 @@
}
return (
<Modal animationType="fade" transparent visible={showModal}>
<BlurView
intensity={15}
tint="dark"
style={{
position: "absolute",
width: "100%",
height: "100%",
}}
/>
<TouchableWithoutFeedback onPress={() => onDismiss()}>
<View style={$modalBackGround}>
<Animated.View style={{ transform: [{ scale: scaleValue }] }}>{children}</Animated.View>
<Animated.View style={{ transform: [{ scale: scaleValue }] }}>
{children}
</Animated.View>
</View>
</TouchableWithoutFeedback>
</Modal>
Expand Down Expand Up @@ -118,7 +130,7 @@
{!selected ? (
<Feather name="circle" size={24} color={colors.divider} />
) : (
<AntDesign name="checkcircle" size={24} color="#27AE60" />

Check warning on line 133 in apps/mobile/app/components/TaskPriorityPopup.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (checkcircle)
)}
</View>
</View>
Expand All @@ -128,7 +140,6 @@

const $modalBackGround: ViewStyle = {
flex: 1,
backgroundColor: "#000000AA",
justifyContent: "center",
}

Expand Down
21 changes: 18 additions & 3 deletions apps/mobile/app/components/TaskSizePopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import { ITaskSizeItem } from "../services/interfaces/ITaskSize"
import { BadgedTaskSize } from "./SizeIcon"
import { translate } from "../i18n"
import { BlurView } from "expo-blur"

export interface Props {
visible: boolean
Expand Down Expand Up @@ -51,9 +52,20 @@
}
return (
<Modal animationType="fade" transparent visible={showModal}>
<BlurView
intensity={15}
tint="dark"
style={{
position: "absolute",
width: "100%",
height: "100%",
}}
/>
<TouchableWithoutFeedback onPress={() => onDismiss()}>
<View style={$modalBackGround}>
<Animated.View style={{ transform: [{ scale: scaleValue }] }}>{children}</Animated.View>
<Animated.View style={{ transform: [{ scale: scaleValue }] }}>
{children}
</Animated.View>
</View>
</TouchableWithoutFeedback>
</Modal>
Expand Down Expand Up @@ -83,7 +95,11 @@
data={allTaskSizes}
contentContainerStyle={{ paddingHorizontal: 10 }}
renderItem={({ item }) => (
<Item currentSizeName={sizeName} onSizeSelected={onStatusSelected} size={item} />
<Item
currentSizeName={sizeName}
onSizeSelected={onStatusSelected}
size={item}
/>
)}
legacyImplementation={true}
showsVerticalScrollIndicator={true}
Expand Down Expand Up @@ -114,7 +130,7 @@
{!selected ? (
<Feather name="circle" size={24} color={colors.divider} />
) : (
<AntDesign name="checkcircle" size={24} color="#27AE60" />

Check warning on line 133 in apps/mobile/app/components/TaskSizePopup.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (checkcircle)
)}
</View>
</View>
Expand All @@ -124,7 +140,6 @@

const $modalBackGround: ViewStyle = {
flex: 1,
backgroundColor: "#000000AA",
justifyContent: "center",
}

Expand Down
15 changes: 13 additions & 2 deletions apps/mobile/app/components/TaskStatusPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import { spacing, typography, useAppTheme } from "../theme"
import { translate } from "../i18n"
import { useTaskStatusValue } from "./StatusType"
import { BlurView } from "expo-blur"

export interface Props {
visible: boolean
Expand Down Expand Up @@ -51,9 +52,20 @@
}
return (
<Modal animationType="fade" transparent visible={showModal}>
<BlurView
intensity={15}
tint="dark"
style={{
position: "absolute",
width: "100%",
height: "100%",
}}
/>
<TouchableWithoutFeedback onPress={() => onDismiss()}>
<View style={$modalBackGround}>
<Animated.View style={{ transform: [{ scale: scaleValue }] }}>{children}</Animated.View>
<Animated.View style={{ transform: [{ scale: scaleValue }] }}>
{children}
</Animated.View>
</View>
</TouchableWithoutFeedback>
</Modal>
Expand Down Expand Up @@ -124,7 +136,7 @@
{!selected ? (
<Feather name="circle" size={24} color={colors.divider} />
) : (
<AntDesign name="checkcircle" size={24} color="#27AE60" />

Check warning on line 139 in apps/mobile/app/components/TaskStatusPopup.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (checkcircle)
)}
</View>
</View>
Expand All @@ -134,7 +146,6 @@

const $modalBackGround: ViewStyle = {
flex: 1,
backgroundColor: "#000000AA",
justifyContent: "center",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { translate } from "../../../../i18n"
import { ICreateTask, ITeamTask } from "../../../../services/interfaces/ITask"
import TaskStatus from "../../../../components/TaskStatus"
import Version from "../../../../components/Version"
import { BlurView } from "expo-blur"

export interface Props {
visible: boolean
Expand Down Expand Up @@ -58,11 +59,22 @@ const ModalPopUp = ({ visible, children }) => {
}
return (
<Modal animationType="fade" transparent visible={showModal}>
<BlurView
intensity={15}
tint="dark"
style={{
position: "absolute",
width: "100%",
height: "100%",
}}
/>
<KeyboardAvoidingView
style={$modalBackGround}
behavior={Platform.OS === "ios" ? "padding" : "height"}
>
<Animated.View style={{ transform: [{ scale: scaleValue }] }}>{children}</Animated.View>
<Animated.View style={{ transform: [{ scale: scaleValue }] }}>
{children}
</Animated.View>
</KeyboardAvoidingView>
</Modal>
)
Expand Down Expand Up @@ -138,7 +150,9 @@ const AssignTaskFormModal: FC<Props> = function AssignTaskFormModal({
value={taskInputText}
onChangeText={(newText) => handleChangeText(newText)}
/>
{isLoading ? <ActivityIndicator color="#1B005D" style={styles.loading} /> : null}
{isLoading ? (
<ActivityIndicator color="#1B005D" style={styles.loading} />
) : null}
</View>

<View>
Expand All @@ -157,7 +171,13 @@ const AssignTaskFormModal: FC<Props> = function AssignTaskFormModal({
alignItems: "center",
}}
>
<Text style={{ textAlign: "center", fontSize: 12, color: "#7E7991" }}>
<Text
style={{
textAlign: "center",
fontSize: 12,
color: "#7E7991",
}}
>
{translate("myWorkScreen.estimateLabel")}:{" "}
</Text>
<EstimateTime
Expand Down Expand Up @@ -250,7 +270,10 @@ const AssignTaskFormModal: FC<Props> = function AssignTaskFormModal({
</Text>
</TouchableOpacity>
<TouchableOpacity
style={[styles.button, { backgroundColor: "#3826A6", opacity: isLoading ? 0.6 : 1 }]}
style={[
styles.button,
{ backgroundColor: "#3826A6", opacity: isLoading ? 0.6 : 1 },
]}
onPress={() => onCreateNewTask()}
>
<Text style={styles.buttonText}>
Expand All @@ -270,7 +293,6 @@ export default AssignTaskFormModal

const $modalBackGround: ViewStyle = {
flex: 1,
backgroundColor: "#000000AA",
justifyContent: "flex-end",
}

Expand Down
Loading
Loading