eletrotupi / tcc/ frontend/app/(tabs)/settings.tsxb13456d98a5b20510f062a4d4fb619887728bd8f
1.9 KB | 80 lines Raw
1
import { TouchableOpacity, StyleSheet, FlatList, View } from 'react-native';
2
import { useState } from 'react';
3
import ParallaxScrollView from '@/components/misc/parallax-scroll-view';
4
import { Link } from 'expo-router'
5

6
import { ThemedText } from '@/components/misc/themed-text';
7
import { ThemedView } from '@/components/misc/themed-view';
8
import { IconSymbol } from '@/components/ui/icon-symbol';
9
import { Fonts } from '@/constants/theme';
10
import { useThemeColor } from '@/hooks/use-theme-color';
11

12
export default function Settings() {
13
  const [options] = useState([
14
    { id: 'profile', name: 'Perfil', path: '/profile'}
15
  ])
16

17
  const textColor = useThemeColor({}, 'text');
18
  const tintColor = useThemeColor({}, 'tint');
19

20
  const renderItem = ({item}) => (
21
    <Link key={item.id} href={item.path} asChild style={[styles.item, { color: tintColor }]}>
22
      <ThemedText>
23
        {item.name}
24
      </ThemedText>
25
    </Link>
26
  )
27

28
  return (
29
    <ParallaxScrollView
30
      headerBackgroundColor={{ light: '#D0D0D0', dark: '#353636' }}
31
      headerImage={
32
        <IconSymbol
33
          size={310}
34
          color="pink"
35
          name="chevron.left.forwardslash.chevron.right"
36
          style={styles.headerImage}
37
        />
38
      }>
39
      <ThemedView style={styles.titleContainer}>
40
        <ThemedText
41
          type="title"
42
          style={{
43
            fontFamily: Fonts.rounded,
44
          }}>
45
          Configurações
46
        </ThemedText>
47
      </ThemedView>
48

49
      {(options.map((opt) => (
50
        renderItem({ item: opt })
51
      )))}
52
    </ParallaxScrollView>
53
  )
54
}
55

56

57
const styles = StyleSheet.create({
58
  headerImage: {
59
    color: '#808080',
60
    bottom: -90,
61
    left: -35,
62
    position: 'absolute',
63
  },
64
  item: {
65
    paddingTop: 16,
66
    paddingBottom: 16,
67
  },
68
  itemName: {
69
    fontSize: 16,
70
    fontWeight: 'bold',
71
  },
72
  separator: {
73
    height: 1,
74
    backgroundColor: '#ccc'
75
  },
76
  titleContainer: {
77
    flexDirection: 'row',
78
    gap: 8,
79
  },
80
});