upd: text input area
Deskripsi>; - update tambah dan edit deskripsi pengumuman - update tambah dan edit deskripsi divisi No Issues
This commit is contained in:
@@ -10,7 +10,7 @@ import { useAuthSession } from "@/providers/AuthProvider";
|
|||||||
import { Entypo } from "@expo/vector-icons";
|
import { Entypo } from "@expo/vector-icons";
|
||||||
import { router, Stack } from "expo-router";
|
import { router, Stack } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { SafeAreaView, ScrollView, Text, ToastAndroid, View } from "react-native";
|
import { SafeAreaView, ScrollView, StyleSheet, Text, ToastAndroid, View } from "react-native";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
|
||||||
export default function CreateAnnouncement() {
|
export default function CreateAnnouncement() {
|
||||||
@@ -123,6 +123,7 @@ export default function CreateAnnouncement() {
|
|||||||
error={error.desc}
|
error={error.desc}
|
||||||
errorText="Pengumuman harus diisi"
|
errorText="Pengumuman harus diisi"
|
||||||
onChange={(val) => validationForm("desc", val)}
|
onChange={(val) => validationForm("desc", val)}
|
||||||
|
multiline
|
||||||
/>
|
/>
|
||||||
<ButtonSelect
|
<ButtonSelect
|
||||||
value="Pilih divisi penerima pengumuman"
|
value="Pilih divisi penerima pengumuman"
|
||||||
@@ -171,3 +172,16 @@ export default function CreateAnnouncement() {
|
|||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
padding: 20,
|
||||||
|
},
|
||||||
|
textArea: {
|
||||||
|
height: 100, // Or use flex-based sizing
|
||||||
|
borderColor: 'gray',
|
||||||
|
borderWidth: 1,
|
||||||
|
padding: 10,
|
||||||
|
textAlignVertical: 'top', // Important for Android to align text at the top
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ export default function EditAnnouncement() {
|
|||||||
errorText="Pengumuman harus diisi"
|
errorText="Pengumuman harus diisi"
|
||||||
onChange={(val) => validationForm("desc", val)}
|
onChange={(val) => validationForm("desc", val)}
|
||||||
value={dataForm.desc}
|
value={dataForm.desc}
|
||||||
|
multiline
|
||||||
/>
|
/>
|
||||||
<ButtonSelect
|
<ButtonSelect
|
||||||
value="Pilih divisi penerima pengumuman"
|
value="Pilih divisi penerima pengumuman"
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ export default function EditDivision() {
|
|||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
setData({ ...data, desc: value })
|
setData({ ...data, desc: value })
|
||||||
}}
|
}}
|
||||||
|
multiline
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ export default function CreateDivision() {
|
|||||||
placeholder="Deskripsi Divisi"
|
placeholder="Deskripsi Divisi"
|
||||||
value={dataForm.desc}
|
value={dataForm.desc}
|
||||||
onChange={(val) => setDataForm({ ...dataForm, desc: val })}
|
onChange={(val) => setDataForm({ ...dataForm, desc: val })}
|
||||||
|
multiline
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -17,10 +17,11 @@ type Props = {
|
|||||||
bg?: 'white' | 'transparent'
|
bg?: 'white' | 'transparent'
|
||||||
value?: string
|
value?: string
|
||||||
disable?: boolean
|
disable?: boolean
|
||||||
|
multiline?: boolean
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export function InputForm({ label, value, placeholder, onChange, info, disable, error, errorText, required, itemLeft, itemRight, type, round, width, bg }: Props) {
|
export function InputForm({ label, value, placeholder, onChange, info, disable, error, errorText, required, itemLeft, itemRight, type, round, width, bg, multiline }: Props) {
|
||||||
const lebar = Dimensions.get("window").width;
|
const lebar = Dimensions.get("window").width;
|
||||||
|
|
||||||
if (itemLeft != undefined || itemRight != undefined) {
|
if (itemLeft != undefined || itemRight != undefined) {
|
||||||
@@ -68,9 +69,11 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
|
|||||||
value={value}
|
value={value}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
keyboardType={type}
|
keyboardType={type}
|
||||||
style={[Styles.inputRoundForm, error && { borderColor: "red" }, round && Styles.round30, { backgroundColor: bg && bg == 'white' ? 'white' : 'transparent' }, { color: 'black' }]}
|
style={[Styles.inputRoundForm, error && { borderColor: "red" }, round && Styles.round30, { backgroundColor: bg && bg == 'white' ? 'white' : 'transparent' }, { color: 'black' }, multiline && { height: 100, textAlignVertical: 'top' }]}
|
||||||
onChangeText={onChange}
|
onChangeText={onChange}
|
||||||
placeholderTextColor={'gray'}
|
placeholderTextColor={'gray'}
|
||||||
|
multiline={multiline}
|
||||||
|
numberOfLines={multiline ? 4 : undefined}
|
||||||
/>
|
/>
|
||||||
{error && (<Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>{errorText}</Text>)}
|
{error && (<Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>{errorText}</Text>)}
|
||||||
{info != undefined && (<Text style={[Styles.textInformation, Styles.mt05, Styles.cGray]}>{info}</Text>)}
|
{info != undefined && (<Text style={[Styles.textInformation, Styles.mt05, Styles.cGray]}>{info}</Text>)}
|
||||||
|
|||||||
Reference in New Issue
Block a user