update
This commit is contained in:
@@ -56,7 +56,7 @@ const formatCurrency = (amount: number, currency: string = "UGX") => {
|
|||||||
const StatusBadge: React.FC<{ status?: string }> = ({ status }) => {
|
const StatusBadge: React.FC<{ status?: string }> = ({ status }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const text = status ?? "FAILED";
|
const text = status ?? "FAILED";
|
||||||
|
|
||||||
const getStatusColors = (s: string) => {
|
const getStatusColors = (s: string) => {
|
||||||
switch (s) {
|
switch (s) {
|
||||||
case 'SUCCESS':
|
case 'SUCCESS':
|
||||||
@@ -80,7 +80,7 @@ const StatusBadge: React.FC<{ status?: string }> = ({ status }) => {
|
|||||||
|
|
||||||
const TransactionItem: React.FC<{ item: Transaction }> = ({ item }) => {
|
const TransactionItem: React.FC<{ item: Transaction }> = ({ item }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
const formatDate = (dateStr: string | null): string => {
|
const formatDate = (dateStr: string | null): string => {
|
||||||
if (!dateStr) return 'N/A';
|
if (!dateStr) return 'N/A';
|
||||||
try {
|
try {
|
||||||
@@ -96,8 +96,8 @@ const TransactionItem: React.FC<{ item: Transaction }> = ({ item }) => {
|
|||||||
const isSuccess = item.status === 'SUCCESS';
|
const isSuccess = item.status === 'SUCCESS';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
style={[styles.card, { backgroundColor: theme.colors.card, borderColor: theme.colors.border }]}
|
style={[styles.card, { backgroundColor: theme.colors.card, borderColor: theme.colors.border }]}
|
||||||
>
|
>
|
||||||
<View style={styles.cardHeader}>
|
<View style={styles.cardHeader}>
|
||||||
@@ -191,9 +191,6 @@ const TransactionsList: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<AppView paddingHorizontal={0} backgroundColor={theme.colors.surface}>
|
<AppView paddingHorizontal={0} backgroundColor={theme.colors.surface}>
|
||||||
<Header title="Transactions" titleColor={theme.colors.textPrimary} arrowColor={theme.colors.textPrimary} />
|
<Header title="Transactions" titleColor={theme.colors.textPrimary} arrowColor={theme.colors.textPrimary} />
|
||||||
<View style={{ paddingHorizontal: 16, marginBottom: 8 }}>
|
|
||||||
<Text style={[styles.headerTitle, { color: theme.colors.textPrimary }]}>{message}</Text>
|
|
||||||
</View>
|
|
||||||
<FlatList
|
<FlatList
|
||||||
data={transactions}
|
data={transactions}
|
||||||
keyExtractor={(item) => item.txnId || item.orderNo}
|
keyExtractor={(item) => item.txnId || item.orderNo}
|
||||||
@@ -209,10 +206,10 @@ const TransactionsList: React.FC = () => {
|
|||||||
export default TransactionsList;
|
export default TransactionsList;
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
headerTitle: {
|
headerTitle: {
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
fontFamily: FontsFamily.nunitoSemiBold,
|
fontFamily: FontsFamily.nunitoSemiBold,
|
||||||
color: colors.primary
|
color: colors.primary
|
||||||
},
|
},
|
||||||
card: {
|
card: {
|
||||||
borderRadius: 16,
|
borderRadius: 16,
|
||||||
@@ -302,18 +299,18 @@ const styles = StyleSheet.create({
|
|||||||
fontFamily: FontsFamily.nunitoBold,
|
fontFamily: FontsFamily.nunitoBold,
|
||||||
letterSpacing: 0.5,
|
letterSpacing: 0.5,
|
||||||
},
|
},
|
||||||
emptyContainer: {
|
emptyContainer: {
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
marginTop: 100
|
marginTop: 100
|
||||||
},
|
},
|
||||||
emptyTitle: {
|
emptyTitle: {
|
||||||
fontSize: responsiveFontSize(2),
|
fontSize: responsiveFontSize(2),
|
||||||
fontFamily: FontsFamily.nunitoBold,
|
fontFamily: FontsFamily.nunitoBold,
|
||||||
marginTop: 16
|
marginTop: 16
|
||||||
},
|
},
|
||||||
emptySubtitle: {
|
emptySubtitle: {
|
||||||
marginTop: 8,
|
marginTop: 8,
|
||||||
fontSize: responsiveFontSize(1.6),
|
fontSize: responsiveFontSize(1.6),
|
||||||
fontFamily: FontsFamily.nunitoRegular,
|
fontFamily: FontsFamily.nunitoRegular,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
|
|||||||
Reference in New Issue
Block a user