amalia/05-mei-26 #43

Merged
amaliadwiy merged 3 commits from amalia/05-mei-26 into join 2026-05-05 17:29:52 +08:00
8 changed files with 31 additions and 20 deletions

View File

@@ -206,6 +206,8 @@ export default function TaskDivisionAddTask() {
day_label: { color: colors.text }, day_label: { color: colors.text },
time_label: { color: colors.text }, time_label: { color: colors.text },
weekday_label: { color: colors.text }, weekday_label: { color: colors.text },
button_next_image: { tintColor: colors.text },
button_prev_image: { tintColor: colors.text },
}} }}
/> />
</View> </View>
@@ -238,7 +240,7 @@ export default function TaskDivisionAddTask() {
> >
<Text style={[dsbButton ? Styles.cGray : Styles.cWhite]}>Detail</Text> <Text style={[dsbButton ? Styles.cGray : Styles.cWhite]}>Detail</Text>
</Pressable> */} </Pressable> */}
<ButtonSelect value="Detail" onPress={() => { setModalDetail(true) }} /> <ButtonSelect value="Detail" onPress={() => { setModalDetail(true) }} disabled={from == "" || to == ""} />
</View> </View>
<InputForm <InputForm
label="Judul Tugas" label="Judul Tugas"

View File

@@ -177,6 +177,8 @@ export default function CreateTaskAddTugas() {
day_label: { color: colors.text }, day_label: { color: colors.text },
time_label: { color: colors.text }, time_label: { color: colors.text },
weekday_label: { color: colors.text }, weekday_label: { color: colors.text },
button_next_image: { tintColor: colors.text },
button_prev_image: { tintColor: colors.text },
}} }}
/> />
</View> </View>
@@ -209,7 +211,7 @@ export default function CreateTaskAddTugas() {
> >
<Text style={[dsbButton ? Styles.cGray : Styles.cWhite]}>Detail</Text> <Text style={[dsbButton ? Styles.cGray : Styles.cWhite]}>Detail</Text>
</Pressable> */} </Pressable> */}
<ButtonSelect value="Detail" onPress={() => { setModalDetail(true) }} /> <ButtonSelect value="Detail" onPress={() => { setModalDetail(true) }} disabled={from == "" || to == ""} />
</View> </View>
<InputForm <InputForm
label="Judul Tugas" label="Judul Tugas"

View File

@@ -255,6 +255,8 @@ export default function UpdateProjectTaskDivision() {
day_label: { color: colors.text }, day_label: { color: colors.text },
time_label: { color: colors.text }, time_label: { color: colors.text },
weekday_label: { color: colors.text }, weekday_label: { color: colors.text },
button_next_image: { tintColor: colors.text },
button_prev_image: { tintColor: colors.text },
}} }}
/> />
)} )}
@@ -290,7 +292,7 @@ export default function UpdateProjectTaskDivision() {
> >
<Text style={[dsbButton ? Styles.cGray : Styles.cWhite]}>Detail</Text> <Text style={[dsbButton ? Styles.cGray : Styles.cWhite]}>Detail</Text>
</Pressable> */} </Pressable> */}
<ButtonSelect value="Detail" onPress={() => { setModalDetail(true) }} /> <ButtonSelect value="Detail" onPress={() => { setModalDetail(true) }} disabled={from == "" || to == ""} />
</View> </View>
<InputForm <InputForm
label="Judul Tugas" label="Judul Tugas"

View File

@@ -195,6 +195,8 @@ export default function ProjectAddTask() {
day_label: { color: colors.text }, day_label: { color: colors.text },
time_label: { color: colors.text }, time_label: { color: colors.text },
weekday_label: { color: colors.text }, weekday_label: { color: colors.text },
button_next_image: { tintColor: colors.text },
button_prev_image: { tintColor: colors.text },
}} }}
/> />
</View> </View>
@@ -227,7 +229,7 @@ export default function ProjectAddTask() {
> >
<Text style={[dsbButton ? Styles.cGray : Styles.cWhite]}>Detail</Text> <Text style={[dsbButton ? Styles.cGray : Styles.cWhite]}>Detail</Text>
</Pressable> */} </Pressable> */}
<ButtonSelect value="Detail" onPress={() => { setModalDetail(true) }} /> <ButtonSelect value="Detail" onPress={() => { setModalDetail(true) }} disabled={from == "" || to == ""} />
</View> </View>
<InputForm <InputForm
label="Judul Tugas" label="Judul Tugas"

View File

@@ -179,6 +179,8 @@ export default function CreateProjectAddTask() {
day_label: { color: colors.text }, day_label: { color: colors.text },
time_label: { color: colors.text }, time_label: { color: colors.text },
weekday_label: { color: colors.text }, weekday_label: { color: colors.text },
button_next_image: { tintColor: colors.text },
button_prev_image: { tintColor: colors.text },
}} }}
/> />
</View> </View>
@@ -204,14 +206,7 @@ export default function CreateProjectAddTask() {
{ {
(error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.mt05, { color: colors.error }]}>Tanggal tidak boleh kosong</Text> (error.endDate || error.startDate) && <Text style={[Styles.textInformation, Styles.mt05, { color: colors.error }]}>Tanggal tidak boleh kosong</Text>
} }
{/* <Pressable <ButtonSelect value="Detail" onPress={() => { setModalDetail(true) }} disabled={from == "" || to == ""} />
style={[Styles.btnTab, Styles.btnLainnya, dsbButton && Styles.btnDisabled]}
disabled={dsbButton}
onPress={() => { setModalDetail(true) }}
>
<Text style={[dsbButton ? Styles.cGray : Styles.cWhite]}>Detail</Text>
</Pressable> */}
<ButtonSelect value="Detail" onPress={() => { setModalDetail(true) }} />
</View> </View>
<InputForm <InputForm
label="Judul Tugas" label="Judul Tugas"

View File

@@ -229,6 +229,8 @@ export default function UpdateProjectTask() {
day_label: { color: colors.text }, day_label: { color: colors.text },
time_label: { color: colors.text }, time_label: { color: colors.text },
weekday_label: { color: colors.text }, weekday_label: { color: colors.text },
button_next_image: { tintColor: colors.text },
button_prev_image: { tintColor: colors.text },
}} }}
/> />
} }
@@ -259,7 +261,7 @@ export default function UpdateProjectTask() {
> >
<Text style={[dsbButton ? Styles.cGray : Styles.cWhite]}>Detail</Text> <Text style={[dsbButton ? Styles.cGray : Styles.cWhite]}>Detail</Text>
</Pressable> */} </Pressable> */}
<ButtonSelect value="Detail" onPress={() => { setModalDetail(true) }} /> <ButtonSelect value="Detail" onPress={() => { setModalDetail(true) }} disabled={from == "" || to == ""} />
</View> </View>
<InputForm <InputForm
label="Judul Tugas" label="Judul Tugas"

View File

@@ -10,20 +10,22 @@ type Props = {
round?: boolean round?: boolean
error?: boolean error?: boolean
errorText?: string errorText?: string
disabled?: boolean
} }
export default function ButtonSelect({ value, onPress, round, error, errorText }: Props) { export default function ButtonSelect({ value, onPress, round, error, errorText, disabled }: Props) {
const { colors } = useTheme(); const { colors } = useTheme();
return ( return (
<View style={[Styles.mv05]}> <View style={[Styles.mv05]}>
<Pressable onPress={onPress}> <Pressable onPress={onPress} disabled={disabled}>
<View style={[ <View style={[
Styles.inputRoundForm, Styles.inputRoundForm,
Styles.inputRoundFormRight, Styles.inputRoundFormRight,
round && Styles.round30, round && Styles.round30,
Styles.pv10, Styles.pv10,
{ borderColor: colors.icon + '20', backgroundColor: colors.input }, { borderColor: colors.icon + '20', backgroundColor: colors.input },
error && { borderColor: "red" } error && { borderColor: "red" },
disabled && { opacity: 0.4 }
]}> ]}>
<Feather name="arrow-right-circle" size={20} color={colors.text} /> <Feather name="arrow-right-circle" size={20} color={colors.text} />
<Text style={[{ color: colors.text }]}>{value}</Text> <Text style={[{ color: colors.text }]}>{value}</Text>

View File

@@ -30,6 +30,10 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
const { colors } = useTheme(); const { colors } = useTheme();
if (itemLeft != undefined || itemRight != undefined) { if (itemLeft != undefined || itemRight != undefined) {
const hasBothItems = itemLeft != undefined && itemRight != undefined;
const baseInputWidth = width ? lebar * width / 100 : lebar * 0.78;
// When both icons present, shrink TextInput by right icon size to keep container width stable
const textInputWidth = hasBothItems ? baseInputWidth - 30 : baseInputWidth;
return ( return (
<View style={[mb && Styles.mb10]}> <View style={[mb && Styles.mb10]}>
{ {
@@ -42,7 +46,7 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
} }
<View style={[ <View style={[
Styles.inputRoundForm, Styles.inputRoundForm,
itemRight != undefined ? Styles.inputRoundFormRight : Styles.inputRoundFormLeft, hasBothItems ? Styles.inputRoundFormLeft : itemRight != undefined ? Styles.inputRoundFormRight : Styles.inputRoundFormLeft,
multiline && { alignItems: 'flex-end' }, multiline && { alignItems: 'flex-end' },
round && Styles.round30, round && Styles.round30,
{ {
@@ -50,12 +54,11 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
}, },
error ? { borderColor: colors.error } : { borderColor: colors.icon + '20' }, error ? { borderColor: colors.error } : { borderColor: colors.icon + '20' },
Platform.OS == 'ios' ? { paddingVertical: 10 } : { paddingVertical: 0, minHeight: 40 }, Platform.OS == 'ios' ? { paddingVertical: 10 } : { paddingVertical: 0, minHeight: 40 },
{ alignItems: 'center' },
multiline multiline
? { alignItems: "flex-end" } ? { alignItems: "flex-end" }
: { alignItems: "center" }, : { alignItems: "center" },
]}> ]}>
{itemRight != undefined ? itemRight : itemLeft} {hasBothItems ? itemLeft : (itemRight != undefined ? itemRight : itemLeft)}
<TextInput <TextInput
editable={!disable} editable={!disable}
value={value} value={value}
@@ -68,10 +71,11 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
style={[ style={[
Styles.mh05, Styles.mh05,
multiline && { height: '100%', maxHeight: 100 }, multiline && { height: '100%', maxHeight: 100 },
{ width: width ? lebar * width / 100 : lebar * 0.78, color: colors.text }, { width: textInputWidth, color: colors.text },
Platform.OS == 'ios' ? { paddingVertical: 1, paddingTop: 4 } : { paddingVertical: 0 }, Platform.OS == 'ios' ? { paddingVertical: 1, paddingTop: 4 } : { paddingVertical: 0 },
]} ]}
/> />
{hasBothItems && itemRight}
</View> </View>
{error && (<Text style={[Styles.textInformation, { color: colors.error }, Styles.mt05]}>{errorText}</Text>)} {error && (<Text style={[Styles.textInformation, { color: colors.error }, Styles.mt05]}>{errorText}</Text>)}
{info != undefined && (<Text style={[Styles.textInformation, { color: colors.dimmed }, Styles.mt05]}>{info}</Text>)} {info != undefined && (<Text style={[Styles.textInformation, { color: colors.dimmed }, Styles.mt05]}>{info}</Text>)}