Fakultas Ilmu Komputer UI

BusinessCategoryScreen.tsx 928 Bytes
Newer Older
1
2
import * as React from "react";
import { StyleSheet } from "react-native";
3
import { View } from "../../components/Themed";
4
import Colors from "../../constants/Colors";
5
import AlphabetGroupList from "../../components/GroupList/AlphabetGroupList";
6
7
8
import { useState, useEffect } from "react";
import { getCategoriesAsIData } from "../../helpers/alphabetConverter";
import { IData } from "react-native-section-alphabet-list";
9
10

const BusinessCategoryScreen = () => {
11
12
13
14
  const [data, setData] = useState<IData[]>([]);
  useEffect(() => {
    getCategoriesAsIData().then((res) => setData(res));
  });
15
16
17

  return (
    <View style={styles.container}>
18
      <AlphabetGroupList data={data} />
19
20
21
22
23
24
25
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
26
    alignItems: "center",
27
    justifyContent: "center",
28
29
    backgroundColor: Colors.background,
    padding: 24,
30
31
32
33
  },
});

export default BusinessCategoryScreen;