upd: refactor style

This commit is contained in:
2026-02-19 15:27:02 +08:00
parent 77f478b7ca
commit 6770d40b41
45 changed files with 195 additions and 136 deletions

View File

@@ -177,7 +177,7 @@ export default function DetailAnnouncement() {
};
return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}>
<SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen
options={{
// headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
@@ -211,7 +211,7 @@ export default function DetailAnnouncement() {
<View>
<View style={[Styles.rowOnly]}>
<Skeleton width={30} height={30} borderRadius={10} />
<View style={[{ flex: 1 }, Styles.ph05]}>
<View style={[Styles.flex1, Styles.ph05]}>
<Skeleton width={100} widthType="percent" height={30} borderRadius={10} />
</View>
</View>
@@ -221,7 +221,7 @@ export default function DetailAnnouncement() {
</View>
:
<>
<View style={[Styles.rowItemsCenter, { alignItems: 'flex-start' }]}>
<View style={[Styles.rowOnly, Styles.alignStart]}>
<MaterialIcons name="campaign" size={25} color={colors.text} style={[Styles.mr05]} />
<Text style={[Styles.textDefaultSemiBold, Styles.w90, Styles.mt02]}>{data?.title}</Text>
</View>
@@ -318,7 +318,7 @@ export default function DetailAnnouncement() {
accessibilityRole="button"
accessibilityLabel="Close image viewer"
>
<Text style={{ color: 'white', fontSize: 26 }}></Text>
<Text style={[Styles.textWhite, Styles.font26]}></Text>
</Pressable>
{/* MENU */}
@@ -328,17 +328,17 @@ export default function DetailAnnouncement() {
accessibilityLabel="Download or share image"
disabled={loadingOpen}
>
<Text style={{ color: loadingOpen ? 'gray' : 'white', fontSize: 26 }}></Text>
<Text style={[{ color: loadingOpen ? 'gray' : 'white' }, Styles.font26]}></Text>
</Pressable>
</View>
)}
FooterComponent={({ imageIndex }) => (
<View style={{
paddingBottom: 20,
paddingHorizontal: 16,
alignItems: 'center',
}}>
<Text style={{ color: 'white', fontSize: 16 }}>{chooseFile?.name}.{chooseFile?.extension}</Text>
<View style={[
Styles.pb20,
Styles.ph16,
Styles.alignCenter,
]}>
<Text style={[Styles.textWhite, Styles.font16]}>{chooseFile?.name}.{chooseFile?.extension}</Text>
</View>
)}
/>

View File

@@ -17,7 +17,7 @@ import { Entypo, Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
import * as DocumentPicker from "expo-document-picker";
import { router, Stack } from "expo-router";
import React, { useEffect, useState } from "react";
import { SafeAreaView, ScrollView, StyleSheet, View } from "react-native";
import { SafeAreaView, ScrollView, View } from "react-native";
import Toast from "react-native-toast-message";
import { useDispatch, useSelector } from "react-redux";
@@ -131,7 +131,7 @@ export default function CreateAnnouncement() {
}
return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}>
<SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen
options={{
// headerLeft: () => (
@@ -281,15 +281,4 @@ export default function CreateAnnouncement() {
);
}
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
},
});

View File

@@ -85,11 +85,11 @@ export default function Announcement() {
})
return (
<View style={[Styles.p15, { flex: 1, backgroundColor: colors.background }]}>
<View style={[Styles.p15, Styles.flex1, { backgroundColor: colors.background }]}>
<View>
<InputSearch onChange={setSearch} />
</View>
<View style={[{ flex: 2 }, Styles.mt05]}>
<View style={[Styles.flex2, Styles.mt05]}>
{
loading ?
arrSkeleton.map((item, index) => {
@@ -113,7 +113,7 @@ export default function Announcement() {
bgColor="transparent"
icon={
// <View style={[Styles.iconContent]}>
<MaterialIcons name="campaign" size={25} color={colors.text} />
<MaterialIcons name="campaign" size={25} color={colors.text} />
// </View>
}
title={item.title}
@@ -135,7 +135,7 @@ export default function Announcement() {
}
/>
:
<Text style={[Styles.textDefault, { textAlign: 'center', color: colors.dimmed }]}>Tidak ada pengumuman</Text>
<Text style={[Styles.textDefault, Styles.textCenter, { color: colors.dimmed }]}>Tidak ada pengumuman</Text>
}
</View>
</View>