Compare commits
4 Commits
resourcing
...
resourcing
| Author | SHA1 | Date | |
|---|---|---|---|
| 3849e03a1a | |||
| f0e0ef4b8b | |||
| cd35201e30 | |||
| bff2a89903 |
@@ -1,55 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
//app/(application)/(tabs)/_layout.tsx
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { Entypo, Ionicons } from "@expo/vector-icons";
|
||||
import { router, Tabs } from "expo-router";
|
||||
|
||||
export default function TabsLayout() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tabs
|
||||
screenOptions={{
|
||||
headerTitleAlign: "center",
|
||||
tabBarStyle: {
|
||||
backgroundColor: MainColor.darkblue,
|
||||
},
|
||||
tabBarActiveTintColor: MainColor.white,
|
||||
}}
|
||||
>
|
||||
<Tabs.Screen name="index" options={{ href: null }} />
|
||||
<Tabs.Screen
|
||||
name="forum"
|
||||
options={{
|
||||
title: "Forum",
|
||||
tabBarIcon: () => (
|
||||
<Entypo name="chat" size={20} color={MainColor.white} />
|
||||
),
|
||||
headerLeft: () => (
|
||||
<Ionicons name="arrow-back" onPress={() => {router.back()}} size={20} color={MainColor.white} />
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<Tabs.Screen
|
||||
name="katalog"
|
||||
options={{
|
||||
title: "Katalog",
|
||||
tabBarIcon: () => (
|
||||
<Entypo name="book" size={20} color={MainColor.white} />
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Tabs.Screen
|
||||
name="maps"
|
||||
options={{
|
||||
title: "Maps",
|
||||
tabBarIcon: () => (
|
||||
<Entypo name="map" size={20} color={MainColor.white} />
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Tabs>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
//app/(application)/(tabs)/forum/_layout.tsx
|
||||
import { Stack } from "expo-router";
|
||||
|
||||
export default function ForumLayout() {
|
||||
return<>
|
||||
<Stack>
|
||||
<Stack.Screen name="index" options={{ headerShown: false, }} />
|
||||
</Stack>
|
||||
</>
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import HomeView from "@/components/Home/HomeView";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { Stack, useNavigation, useRouter } from "expo-router";
|
||||
import { useEffect } from "react";
|
||||
|
||||
export default function Tabs() {
|
||||
// const router = useRouter();
|
||||
// const navigation = useNavigation();
|
||||
// useEffect(() => {
|
||||
// navigation.setOptions({
|
||||
|
||||
// });
|
||||
// }, [navigation]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<HomeView />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { Stack } from "expo-router";
|
||||
import { router, Stack } from "expo-router";
|
||||
|
||||
export default function ApplicationLayout() {
|
||||
return (
|
||||
@@ -18,23 +17,90 @@ export default function ApplicationLayout() {
|
||||
headerLargeStyle: {
|
||||
backgroundColor: MainColor.darkblue,
|
||||
},
|
||||
headerShadowVisible: false,
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="(tabs)"
|
||||
name="home"
|
||||
options={{
|
||||
headerShown: false,
|
||||
// title: "iii",
|
||||
// headerLeft: () => (
|
||||
// <Ionicons name="search" size={20} color={MainColor.white} />
|
||||
// ),
|
||||
// headerRight: () => (
|
||||
// <Ionicons name="notifications" size={20} color={MainColor.white} />
|
||||
// ),
|
||||
title: "HIPMI",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="search"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
headerRight: () => (
|
||||
<Ionicons
|
||||
name="notifications"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="forum/index"
|
||||
options={{
|
||||
title: "Forum",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="maps/index"
|
||||
options={{
|
||||
title: "Maps",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="market-place/index"
|
||||
options={{
|
||||
title: "Market Place",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="profile/index"
|
||||
options={{
|
||||
title: "Profile",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
{/* <Stack.Screen name="forum/index" options={{ title: "Forum", }} /> */}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
|
||||
239
app/(application)/coba/index.tsx
Normal file
239
app/(application)/coba/index.tsx
Normal file
@@ -0,0 +1,239 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import React from "react";
|
||||
import {
|
||||
View,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
StyleSheet,
|
||||
Dimensions,
|
||||
ScrollView,
|
||||
} from "react-native";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router } from "expo-router";
|
||||
|
||||
const { width } = Dimensions.get("window");
|
||||
|
||||
// Sample Screen Components
|
||||
const HomeScreen = () => (
|
||||
<View style={styles.screen}>
|
||||
<Text style={styles.screenTitle}>Selamat Datang!</Text>
|
||||
<Text style={styles.screenText}>Ini adalah halaman utama aplikasi Anda</Text>
|
||||
</View>
|
||||
);
|
||||
const SearchScreen = () => (
|
||||
<View style={styles.screen}>
|
||||
<Text style={styles.screenTitle}>Search Screen</Text>
|
||||
<Text style={styles.screenText}>Cari apa yang Anda butuhkan</Text>
|
||||
</View>
|
||||
);
|
||||
|
||||
const ProfileScreen = () => (
|
||||
<View style={styles.screen}>
|
||||
<Text style={styles.screenTitle}>Profile Screen</Text>
|
||||
<Text style={styles.screenText}>Informasi profil pengguna</Text>
|
||||
</View>
|
||||
);
|
||||
|
||||
const NotificationScreen = () => (
|
||||
<View style={styles.screen}>
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<View key={index}>
|
||||
<Text style={styles.screenTitle}>Notifications</Text>
|
||||
<Text style={styles.screenText}>Notifikasi terbaru Anda</Text>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
);
|
||||
|
||||
// Custom Tab Component
|
||||
const CustomTab = ({ icon, label, isActive, onPress }: any) => (
|
||||
<TouchableOpacity
|
||||
style={[styles.tabItem, isActive && styles.activeTab]}
|
||||
onPress={onPress}
|
||||
activeOpacity={0.7}
|
||||
>
|
||||
<View
|
||||
style={[styles.iconContainer, isActive && styles.activeIconContainer]}
|
||||
>
|
||||
<Ionicons name={icon} size={24} color={isActive ? "#fff" : "#666"} />
|
||||
</View>
|
||||
<Text style={[styles.tabLabel, isActive && styles.activeTabLabel]}>
|
||||
{label}
|
||||
</Text>
|
||||
{isActive && <View style={styles.activeIndicator} />}
|
||||
</TouchableOpacity>
|
||||
);
|
||||
|
||||
// Main Custom Tab Navigator
|
||||
const CustomTabNavigator = () => {
|
||||
const [activeTab, setActiveTab] = React.useState(
|
||||
'home'
|
||||
);
|
||||
const [showHome, setShowHome] = React.useState(true);
|
||||
|
||||
const tabs = [
|
||||
{
|
||||
id: "search",
|
||||
icon: "search-outline",
|
||||
activeIcon: "search",
|
||||
label: "Event",
|
||||
component: SearchScreen,
|
||||
path: "/event",
|
||||
},
|
||||
{
|
||||
id: "notifications",
|
||||
icon: "notifications-outline",
|
||||
activeIcon: "notifications",
|
||||
label: "Forum",
|
||||
component: NotificationScreen,
|
||||
path: "/(application)/(home-tabs)/forum",
|
||||
},
|
||||
{
|
||||
id: "profile",
|
||||
icon: "person-outline",
|
||||
activeIcon: "person",
|
||||
label: "Katalog",
|
||||
component: ProfileScreen,
|
||||
path: "/(application)/(home-tabs)/katalog",
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
// Function untuk handle tab press
|
||||
const handleTabPress = (tabId: string) => {
|
||||
setActiveTab(tabId);
|
||||
// setShowHome(false); // Hide home when any tab is pressed
|
||||
};
|
||||
|
||||
// Determine which component to show
|
||||
const getActiveComponent = () => {
|
||||
if (showHome || activeTab === "home") {
|
||||
return HomeScreen;
|
||||
}
|
||||
const selectedTab = tabs.find((tab) => tab.id === activeTab);
|
||||
return selectedTab ? selectedTab.component : HomeScreen;
|
||||
};
|
||||
|
||||
const ActiveComponent = getActiveComponent();
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
{/* Content Area */}
|
||||
<ScrollView>
|
||||
<View style={styles.content}>
|
||||
<ActiveComponent />
|
||||
</View>
|
||||
</ScrollView>
|
||||
|
||||
{/* Custom Tab Bar */}
|
||||
<View style={styles.tabBar}>
|
||||
<View style={styles.tabContainer}>
|
||||
{tabs.map((e) => (
|
||||
<CustomTab
|
||||
key={e.id}
|
||||
icon={activeTab === e.id ? e.activeIcon : e.icon}
|
||||
label={e.label}
|
||||
isActive={activeTab === e.id && !showHome}
|
||||
onPress={() => {
|
||||
// handleTabPress(e.id);
|
||||
router.push(e.path as any);
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: "#f5f5f5",
|
||||
},
|
||||
content: {
|
||||
flex: 1,
|
||||
},
|
||||
screen: {
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
padding: 20,
|
||||
},
|
||||
screenTitle: {
|
||||
fontSize: 28,
|
||||
fontWeight: "bold",
|
||||
color: "#333",
|
||||
marginBottom: 10,
|
||||
},
|
||||
screenText: {
|
||||
fontSize: 16,
|
||||
color: "#666",
|
||||
textAlign: "center",
|
||||
},
|
||||
tabBar: {
|
||||
backgroundColor: "#fff",
|
||||
paddingBottom: 20,
|
||||
paddingTop: 10,
|
||||
shadowColor: "#000",
|
||||
shadowOffset: {
|
||||
width: 0,
|
||||
height: -2,
|
||||
},
|
||||
shadowOpacity: 0.1,
|
||||
shadowRadius: 3,
|
||||
elevation: 5,
|
||||
},
|
||||
tabContainer: {
|
||||
flexDirection: "row",
|
||||
justifyContent: "space-around",
|
||||
alignItems: "center",
|
||||
paddingHorizontal: 20,
|
||||
},
|
||||
tabItem: {
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
paddingVertical: 8,
|
||||
paddingHorizontal: 12,
|
||||
minWidth: width / 5,
|
||||
position: "relative",
|
||||
},
|
||||
activeTab: {
|
||||
transform: [{ scale: 1.05 }],
|
||||
},
|
||||
iconContainer: {
|
||||
padding: 8,
|
||||
borderRadius: 20,
|
||||
marginBottom: 4,
|
||||
},
|
||||
activeIconContainer: {
|
||||
backgroundColor: "#007AFF",
|
||||
shadowColor: "#007AFF",
|
||||
shadowOffset: {
|
||||
width: 0,
|
||||
height: 2,
|
||||
},
|
||||
shadowOpacity: 0.3,
|
||||
shadowRadius: 4,
|
||||
elevation: 4,
|
||||
},
|
||||
tabLabel: {
|
||||
fontSize: 12,
|
||||
color: "#666",
|
||||
fontWeight: "500",
|
||||
},
|
||||
activeTabLabel: {
|
||||
color: "#007AFF",
|
||||
fontWeight: "600",
|
||||
},
|
||||
activeIndicator: {
|
||||
position: "absolute",
|
||||
bottom: -2,
|
||||
width: 4,
|
||||
height: 4,
|
||||
borderRadius: 2,
|
||||
backgroundColor: "#007AFF",
|
||||
},
|
||||
});
|
||||
|
||||
export default CustomTabNavigator;
|
||||
9
app/(application)/event/index.tsx
Normal file
9
app/(application)/event/index.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
export default function Event() {
|
||||
return (
|
||||
<View>
|
||||
<Text>Event</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -2,8 +2,10 @@ import { Text, View } from "react-native";
|
||||
|
||||
export default function Forum() {
|
||||
return (
|
||||
<View>
|
||||
<Text>Tabs Forum</Text>
|
||||
</View>
|
||||
<>
|
||||
<View>
|
||||
<Text>Forum</Text>
|
||||
</View>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import HomeView from "@/components/Home/HomeView";
|
||||
import NewHomeView from "@/screens/Home/UiHome";
|
||||
|
||||
export default function Application() {
|
||||
return (
|
||||
<>
|
||||
<HomeView />
|
||||
<NewHomeView />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ export default function Maps() {
|
||||
<View>
|
||||
<Text>Maps</Text>
|
||||
</View>
|
||||
);
|
||||
)
|
||||
}
|
||||
9
app/(application)/market-place/index.tsx
Normal file
9
app/(application)/market-place/index.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
export default function MarketPlace() {
|
||||
return (
|
||||
<View>
|
||||
<Text>Market Place</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
export default function Katalog() {
|
||||
export default function Profile() {
|
||||
return (
|
||||
<View>
|
||||
<Text>Katalog</Text>
|
||||
<Text>Profile</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import { Feather, Ionicons, MaterialIcons } from "@expo/vector-icons";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { Stack } from "expo-router";
|
||||
import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
|
||||
import Icon from "react-native-vector-icons/FontAwesome";
|
||||
import { SafeAreaProvider } from "react-native-safe-area-context";
|
||||
|
||||
export default function RootLayout() {
|
||||
return (
|
||||
@@ -17,32 +14,17 @@ export default function RootLayout() {
|
||||
headerStyle: { backgroundColor: MainColor.darkblue },
|
||||
headerTitleStyle: { color: MainColor.yellow, fontWeight: "bold" },
|
||||
headerTitleAlign: "center",
|
||||
contentStyle: {
|
||||
borderBottomColor: AccentColor.blue,
|
||||
borderBottomWidth: 2,
|
||||
},
|
||||
// contentStyle: {
|
||||
// borderBottomColor: AccentColor.blue,
|
||||
// borderBottomWidth: 2,
|
||||
// },
|
||||
// headerLargeStyle: {
|
||||
// backgroundColor: MainColor.darkblue,
|
||||
// },
|
||||
// headerShadowVisible: false,
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="index"
|
||||
// options={{
|
||||
// title: "Login",
|
||||
// headerStyle: { backgroundColor: MainColor.darkblue },
|
||||
// headerTitleStyle: { color: MainColor.yellow, fontWeight: "bold" },
|
||||
// headerTitleAlign: "center",
|
||||
// headerRight: () => (
|
||||
// <MaterialIcons name="rocket" size={20} color={MainColor.yellow} />
|
||||
// ),
|
||||
// headerLeft: () => (
|
||||
// <Icon name="rocket" size={20} color={MainColor.yellow} />
|
||||
// ),
|
||||
// }}
|
||||
options={{ headerShown: false }}
|
||||
/>
|
||||
<Stack.Screen name="index" options={{ headerShown: false }} />
|
||||
<Stack.Screen name="verification" options={{ headerShown: false }} />
|
||||
<Stack.Screen name="register" options={{ headerShown: false }} />
|
||||
<Stack.Screen name="(application)" options={{ headerShown: false }} />
|
||||
|
||||
@@ -1,98 +1,9 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import ButtonCustom from "@/components/Button/ButtonCustom";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { globalStyles } from "@/constants/global-styles";
|
||||
import { Stack, useRouter } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { Text, View } from "react-native";
|
||||
import PhoneInput, { ICountry } from "react-native-international-phone-number";
|
||||
import { MaterialIcons } from "@expo/vector-icons";
|
||||
import LoginView from "@/screens/Authentication/LoginView";
|
||||
|
||||
export default function Login() {
|
||||
const router = useRouter();
|
||||
|
||||
const [selectedCountry, setSelectedCountry] = useState<null | ICountry>(null);
|
||||
const [inputValue, setInputValue] = useState<string>("");
|
||||
|
||||
function handleInputValue(phoneNumber: string) {
|
||||
setInputValue(phoneNumber);
|
||||
}
|
||||
|
||||
function handleSelectedCountry(country: ICountry) {
|
||||
setSelectedCountry(country);
|
||||
}
|
||||
|
||||
function handleLogin() {
|
||||
const callingCode = selectedCountry?.callingCode.replace(/^\+/, "") || "";
|
||||
const fixNumber = callingCode + inputValue;
|
||||
console.log(fixNumber);
|
||||
router.push("/verification");
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
<ViewWrapper>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
height: "100%",
|
||||
}}
|
||||
>
|
||||
<View>
|
||||
<View style={globalStyles.authContainer}>
|
||||
<Text style={globalStyles.authSubTitle}>WELCOME TO</Text>
|
||||
<Spacing height={5} />
|
||||
<Text style={globalStyles.authTitle}>HIPMI BADUNG APPS</Text>
|
||||
<Spacing height={5} />
|
||||
</View>
|
||||
<Spacing height={50} />
|
||||
<Text
|
||||
style={{
|
||||
position: "absolute",
|
||||
bottom: 30,
|
||||
right: 20,
|
||||
fontSize: 10,
|
||||
fontWeight: "thin",
|
||||
fontStyle: "italic",
|
||||
color: MainColor.white,
|
||||
}}
|
||||
>
|
||||
powered by muku.id
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
{/* Input dengan prefix teks */}
|
||||
{/* <TextInputCustom
|
||||
label="Nomor Telepon"
|
||||
placeholder="Masukkan nomor"
|
||||
value={phone}
|
||||
onChangeText={setPhone}
|
||||
iconLeft="+62"
|
||||
keyboardType="phone-pad"
|
||||
/> */}
|
||||
|
||||
<PhoneInput
|
||||
value={inputValue}
|
||||
onChangePhoneNumber={handleInputValue}
|
||||
selectedCountry={selectedCountry}
|
||||
onChangeSelectedCountry={handleSelectedCountry}
|
||||
defaultCountry="ID"
|
||||
placeholder="Masukkan nomor"
|
||||
/>
|
||||
|
||||
<Spacing height={20} />
|
||||
|
||||
<ButtonCustom
|
||||
title="Login"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
radius={10}
|
||||
onPress={handleLogin}
|
||||
/>
|
||||
</View>
|
||||
</ViewWrapper>
|
||||
<>
|
||||
<LoginView />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,59 +1,9 @@
|
||||
import { Text, View } from "react-native";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { globalStyles } from "@/constants/global-styles";
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import { EvilIcons } from "@expo/vector-icons";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { TextInputCustom } from "@/components/TextInput/TextInputCustom";
|
||||
import ButtonCustom from "@/components/Button/ButtonCustom";
|
||||
import { useRouter } from "expo-router";
|
||||
import RegisterView from "@/screens/Authentication/RegisterView";
|
||||
|
||||
export default function Register() {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<ViewWrapper>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
height: "100%",
|
||||
}}
|
||||
>
|
||||
<View>
|
||||
<View style={globalStyles.authContainer}>
|
||||
<Text style={globalStyles.authTitle}>REGISTRASI</Text>
|
||||
<Spacing height={30} />
|
||||
<EvilIcons name="user" size={100} color={MainColor.yellow} />
|
||||
<Spacing height={30} />
|
||||
|
||||
<Text style={globalStyles.textLabel}>
|
||||
Anda akan terdaftar dengan nomor
|
||||
</Text>
|
||||
<Text style={globalStyles.textLabel}>+6282xxxxxxxxx</Text>
|
||||
<Spacing height={30} />
|
||||
</View>
|
||||
<TextInputCustom placeholder="Masukkan username" />
|
||||
|
||||
<ButtonCustom
|
||||
title="Daftar"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
radius={10}
|
||||
onPress={() => (
|
||||
console.log("Success register"),
|
||||
router.push("/(application)/home")
|
||||
)}
|
||||
/>
|
||||
{/* <Spacing height={10} />
|
||||
<ButtonCustom
|
||||
title="Katalog"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
radius={10}
|
||||
onPress={() => router.push("/(application)/(katalog)")}
|
||||
/> */}
|
||||
</View>
|
||||
</View>
|
||||
</ViewWrapper>
|
||||
<>
|
||||
<RegisterView />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,67 +1,9 @@
|
||||
import ButtonCustom from "@/components/Button/ButtonCustom";
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { globalStyles } from "@/constants/global-styles";
|
||||
import { useRouter } from "expo-router"
|
||||
import VerificationView from "@/screens/Authentication/VerificationView";
|
||||
|
||||
import { Text, View } from "react-native";
|
||||
import { OtpInput } from "react-native-otp-entry";
|
||||
|
||||
export default function Validasi() {
|
||||
const router = useRouter();
|
||||
export default function Verification() {
|
||||
return (
|
||||
<ViewWrapper>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
height: "100%",
|
||||
}}
|
||||
>
|
||||
<View>
|
||||
<View style={globalStyles.authContainer}>
|
||||
<Text style={globalStyles.authTitle}>Verifikasi KOde OTP</Text>
|
||||
<Spacing height={30} />
|
||||
<Text style={globalStyles.textLabel}>Masukan 4 digit kode otp</Text>
|
||||
<Text style={globalStyles.textLabel}>
|
||||
Yang di kirim ke +6282xxxxxxxxx
|
||||
</Text>
|
||||
<Spacing height={30} />
|
||||
<OtpInput
|
||||
numberOfDigits={4}
|
||||
theme={{
|
||||
pinCodeContainerStyle: {
|
||||
backgroundColor: MainColor.login,
|
||||
borderRadius: 10,
|
||||
borderWidth: 1,
|
||||
borderColor: MainColor.yellow,
|
||||
width: 60,
|
||||
height: 60,
|
||||
},
|
||||
containerStyle: {
|
||||
paddingLeft: 10,
|
||||
paddingRight: 10,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<Spacing height={30} />
|
||||
<Text style={globalStyles.textLabel}>
|
||||
Tidak menerima kode ?{" "}
|
||||
<Text style={{ ...globalStyles.textLabel }}>Kirim Ulang</Text>
|
||||
</Text>
|
||||
</View>
|
||||
<Spacing height={30} />
|
||||
</View>
|
||||
|
||||
<ButtonCustom
|
||||
title="Verifikasi"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
radius={10}
|
||||
onPress={() => router.push("/register")}
|
||||
/>
|
||||
</View>
|
||||
</ViewWrapper>
|
||||
<>
|
||||
<VerificationView />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
15
bun.lock
15
bun.lock
@@ -5,9 +5,10 @@
|
||||
"name": "hipmi-mobile",
|
||||
"dependencies": {
|
||||
"@expo/vector-icons": "^14.1.0",
|
||||
"@react-navigation/bottom-tabs": "^7.3.10",
|
||||
"@react-navigation/bottom-tabs": "^7.4.2",
|
||||
"@react-navigation/elements": "^2.3.8",
|
||||
"@react-navigation/native": "^7.1.6",
|
||||
"@react-navigation/native-stack": "^7.3.21",
|
||||
"@types/react-native-vector-icons": "^6.4.18",
|
||||
"expo": "~53.0.12",
|
||||
"expo-blur": "~14.1.5",
|
||||
@@ -385,7 +386,7 @@
|
||||
|
||||
"@react-native/virtualized-lists": ["@react-native/virtualized-lists@0.79.4", "", { "dependencies": { "invariant": "^2.2.4", "nullthrows": "^1.1.1" }, "peerDependencies": { "@types/react": "^19.0.0", "react": "*", "react-native": "*" } }, "sha512-0Mdcox6e5PTonuM1WIo3ks7MBAa3IDzj0pKnE5xAwSgQ0DJW2P5dYf+KjWmpkE+Yb0w41ZbtXPhKq+U2JJ6C/Q=="],
|
||||
|
||||
"@react-navigation/bottom-tabs": ["@react-navigation/bottom-tabs@7.3.16", "", { "dependencies": { "@react-navigation/elements": "^2.4.5", "color": "^4.2.3" }, "peerDependencies": { "@react-navigation/native": "^7.1.12", "react": ">= 18.2.0", "react-native": "*", "react-native-safe-area-context": ">= 4.0.0", "react-native-screens": ">= 4.0.0" } }, "sha512-BOVtrq5J3zV3T9CeQexX20JrjECWwIgUJj0Uj0DTVuZdvPIf1AHKHDQSWcG6XqDsbqFQu9yCAfRlnt0WwdRP2w=="],
|
||||
"@react-navigation/bottom-tabs": ["@react-navigation/bottom-tabs@7.4.2", "", { "dependencies": { "@react-navigation/elements": "^2.5.2", "color": "^4.2.3" }, "peerDependencies": { "@react-navigation/native": "^7.1.14", "react": ">= 18.2.0", "react-native": "*", "react-native-safe-area-context": ">= 4.0.0", "react-native-screens": ">= 4.0.0" } }, "sha512-jyBux5l3qqEucY5M/ZWxVvfA8TQu7DVl2gK+xB6iKqRUfLf7dSumyVxc7HemDwGFoz3Ug8dVZFvSMEs+mfrieQ=="],
|
||||
|
||||
"@react-navigation/core": ["@react-navigation/core@7.11.0", "", { "dependencies": { "@react-navigation/routers": "^7.4.1", "escape-string-regexp": "^4.0.0", "nanoid": "^3.3.11", "query-string": "^7.1.3", "react-is": "^19.1.0", "use-latest-callback": "^0.2.4", "use-sync-external-store": "^1.5.0" }, "peerDependencies": { "react": ">= 18.2.0" } }, "sha512-LfYPtxsMjldJ80BBeedaDCN0LE81WU1NP4V9Ia3wSrCPTAXt11y6holaBUrmUMVQVqpEyPRQrjwrT1QkfGKquw=="],
|
||||
|
||||
@@ -393,7 +394,7 @@
|
||||
|
||||
"@react-navigation/native": ["@react-navigation/native@7.1.12", "", { "dependencies": { "@react-navigation/core": "^7.11.0", "escape-string-regexp": "^4.0.0", "fast-deep-equal": "^3.1.3", "nanoid": "^3.3.11", "use-latest-callback": "^0.2.4" }, "peerDependencies": { "react": ">= 18.2.0", "react-native": "*" } }, "sha512-ezHzrZN+9SE4Co6/H8MgDWlBxfJbVc5xi8szRi2QW8eJlsZsAvgGqtKs4YECraV4Yr9zW8RCzNuUxYiQiPMtEQ=="],
|
||||
|
||||
"@react-navigation/native-stack": ["@react-navigation/native-stack@7.3.17", "", { "dependencies": { "@react-navigation/elements": "^2.4.5", "warn-once": "^0.1.1" }, "peerDependencies": { "@react-navigation/native": "^7.1.12", "react": ">= 18.2.0", "react-native": "*", "react-native-safe-area-context": ">= 4.0.0", "react-native-screens": ">= 4.0.0" } }, "sha512-nPJv5E/7MYZ5NPD0sFP9DjSawEQ1fYXe0sCZT1C5EHGWK08p3+5HkVScXofDDqUtI/q6UU23uE1YoxVWgRbDRw=="],
|
||||
"@react-navigation/native-stack": ["@react-navigation/native-stack@7.3.21", "", { "dependencies": { "@react-navigation/elements": "^2.5.2", "warn-once": "^0.1.1" }, "peerDependencies": { "@react-navigation/native": "^7.1.14", "react": ">= 18.2.0", "react-native": "*", "react-native-safe-area-context": ">= 4.0.0", "react-native-screens": ">= 4.0.0" } }, "sha512-oNNZHzkxILEibesamRKLodfXAaDOUvMBITKXLLeblDxnTAyIB/Kf7CmV+8nwkdAgV04kURTxV0SQI+d8gLUm6g=="],
|
||||
|
||||
"@react-navigation/routers": ["@react-navigation/routers@7.4.1", "", { "dependencies": { "nanoid": "^3.3.11" } }, "sha512-42mZrMzQ0LfKxUb5OHIurYrPYyRsXFLolucILrvm21f0O40Sw0Ufh1bnn/jRqnxZZu7wvpUGIGYM8nS9zVE1Aw=="],
|
||||
|
||||
@@ -1767,6 +1768,10 @@
|
||||
|
||||
"@react-native/dev-middleware/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
|
||||
|
||||
"@react-navigation/bottom-tabs/@react-navigation/elements": ["@react-navigation/elements@2.5.2", "", { "dependencies": { "color": "^4.2.3", "use-latest-callback": "^0.2.4", "use-sync-external-store": "^1.5.0" }, "peerDependencies": { "@react-native-masked-view/masked-view": ">= 0.2.0", "@react-navigation/native": "^7.1.14", "react": ">= 18.2.0", "react-native": "*", "react-native-safe-area-context": ">= 4.0.0" }, "optionalPeers": ["@react-native-masked-view/masked-view"] }, "sha512-aGC3ukF5+lXuiF5bK7bJyRuWCE+Tk4MZ3GoQpAb7u7+m0KmsquliDhj4UCWEUU5kUoCeoRAUvv+1lKcYKf+WTQ=="],
|
||||
|
||||
"@react-navigation/native-stack/@react-navigation/elements": ["@react-navigation/elements@2.5.2", "", { "dependencies": { "color": "^4.2.3", "use-latest-callback": "^0.2.4", "use-sync-external-store": "^1.5.0" }, "peerDependencies": { "@react-native-masked-view/masked-view": ">= 0.2.0", "@react-navigation/native": "^7.1.14", "react": ">= 18.2.0", "react-native": "*", "react-native-safe-area-context": ">= 4.0.0" }, "optionalPeers": ["@react-native-masked-view/masked-view"] }, "sha512-aGC3ukF5+lXuiF5bK7bJyRuWCE+Tk4MZ3GoQpAb7u7+m0KmsquliDhj4UCWEUU5kUoCeoRAUvv+1lKcYKf+WTQ=="],
|
||||
|
||||
"@typescript-eslint/eslint-plugin/ignore": ["ignore@7.0.5", "", {}, "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg=="],
|
||||
|
||||
"@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
|
||||
@@ -1815,6 +1820,10 @@
|
||||
|
||||
"expo-modules-autolinking/glob": ["glob@10.4.5", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": "dist/esm/bin.mjs" }, "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg=="],
|
||||
|
||||
"expo-router/@react-navigation/bottom-tabs": ["@react-navigation/bottom-tabs@7.3.16", "", { "dependencies": { "@react-navigation/elements": "^2.4.5", "color": "^4.2.3" }, "peerDependencies": { "@react-navigation/native": "^7.1.12", "react": ">= 18.2.0", "react-native": "*", "react-native-safe-area-context": ">= 4.0.0", "react-native-screens": ">= 4.0.0" } }, "sha512-BOVtrq5J3zV3T9CeQexX20JrjECWwIgUJj0Uj0DTVuZdvPIf1AHKHDQSWcG6XqDsbqFQu9yCAfRlnt0WwdRP2w=="],
|
||||
|
||||
"expo-router/@react-navigation/native-stack": ["@react-navigation/native-stack@7.3.17", "", { "dependencies": { "@react-navigation/elements": "^2.4.5", "warn-once": "^0.1.1" }, "peerDependencies": { "@react-navigation/native": "^7.1.12", "react": ">= 18.2.0", "react-native": "*", "react-native-safe-area-context": ">= 4.0.0", "react-native-screens": ">= 4.0.0" } }, "sha512-nPJv5E/7MYZ5NPD0sFP9DjSawEQ1fYXe0sCZT1C5EHGWK08p3+5HkVScXofDDqUtI/q6UU23uE1YoxVWgRbDRw=="],
|
||||
|
||||
"expo-router/semver": ["semver@7.6.3", "", { "bin": "bin/semver.js" }, "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A=="],
|
||||
|
||||
"fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Text, TouchableOpacity } from "react-native";
|
||||
import buttonStyles from "./buttonStyles";
|
||||
|
||||
// Definisi props dengan TypeScript
|
||||
|
||||
interface ButtonProps {
|
||||
onPress: () => void;
|
||||
title?: string;
|
||||
@@ -15,6 +16,17 @@ interface ButtonProps {
|
||||
iconLeft?: React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Props untuk ButtonCustom
|
||||
* @param onPress: () => void
|
||||
* @param title?: string
|
||||
* @param backgroundColor?: string
|
||||
* @param textColor?: string
|
||||
* @param radius?: number
|
||||
* @param disabled?: boolean
|
||||
* @param iconLeft?: React.ReactNode
|
||||
* @example iconLeft={<Icon name="arrow-right" size={20} color={MainColor.black}/>
|
||||
*/
|
||||
const ButtonCustom: React.FC<ButtonProps> = ({
|
||||
onPress,
|
||||
title = "Button",
|
||||
@@ -35,6 +47,7 @@ const ButtonCustom: React.FC<ButtonProps> = ({
|
||||
style={[styles.button, disabled && styles.disabled]}
|
||||
onPress={onPress}
|
||||
disabled={disabled}
|
||||
activeOpacity={0.8}
|
||||
>
|
||||
{/* Render icon jika tersedia */}
|
||||
{iconLeft && iconLeft}
|
||||
|
||||
@@ -1,35 +1,48 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { globalStyles } from "@/constants/global-styles";
|
||||
import { Styles } from "@/styles/global-styles";
|
||||
import { ImageBackground, ScrollView, View } from "react-native";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
|
||||
|
||||
interface ViewWrapperProps {
|
||||
children: React.ReactNode;
|
||||
withBackground?: boolean;
|
||||
tabBarComponent?: React.ReactNode;
|
||||
}
|
||||
|
||||
const ViewWrapper = ({ children }: ViewWrapperProps) => {
|
||||
const ViewWrapper = ({
|
||||
children,
|
||||
withBackground = false,
|
||||
tabBarComponent,
|
||||
}: ViewWrapperProps) => {
|
||||
const assetBackground = require("../../assets/images/main-background.png");
|
||||
|
||||
return (
|
||||
<SafeAreaView
|
||||
edges={[]}
|
||||
style={{
|
||||
flex: 1,
|
||||
// paddingTop: StatusBar.currentHeight,
|
||||
}}
|
||||
|
||||
>
|
||||
<ScrollView contentContainerStyle={{ flexGrow: 1 }} >
|
||||
<ImageBackground
|
||||
source={require("../../assets/images/main-background.png")}
|
||||
resizeMode="cover"
|
||||
style={globalStyles.imageBackground}
|
||||
>
|
||||
<View style={globalStyles.container}>{children}</View>
|
||||
</ImageBackground>
|
||||
</ScrollView>
|
||||
</SafeAreaView>
|
||||
<SafeAreaProvider>
|
||||
<SafeAreaView
|
||||
edges={[
|
||||
"bottom",
|
||||
// "top",
|
||||
]}
|
||||
style={{
|
||||
flex: 1,
|
||||
// paddingTop: StatusBar.currentHeight,
|
||||
}}
|
||||
>
|
||||
<ScrollView contentContainerStyle={{ flexGrow: 1 }}>
|
||||
{withBackground ? (
|
||||
<ImageBackground
|
||||
source={assetBackground}
|
||||
resizeMode="cover"
|
||||
style={Styles.imageBackground}
|
||||
>
|
||||
<View style={Styles.containerWithBackground}>{children}</View>
|
||||
</ImageBackground>
|
||||
) : (
|
||||
<View style={Styles.container}>{children}</View>
|
||||
)}
|
||||
</ScrollView>
|
||||
{tabBarComponent}
|
||||
</SafeAreaView>
|
||||
</SafeAreaProvider>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
40
navigation/types.ts
Normal file
40
navigation/types.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
// src/navigation/types.ts
|
||||
|
||||
import { NavigatorScreenParams } from "@react-navigation/native";
|
||||
|
||||
// Tipe untuk Tab Navigator utama di (home-tabs)
|
||||
export type HomeTabParamList = {
|
||||
index: undefined; // Diperbarui: Tab default (sekarang dinamakan index)
|
||||
maps: undefined;
|
||||
profile: undefined;
|
||||
};
|
||||
|
||||
// Tipe untuk Stack Navigator Event
|
||||
export type EventStackParamList = {
|
||||
index: undefined; // Rute root untuk Event (misalnya, daftar event)
|
||||
// Anda bisa menambahkan rute event lain di sini, contoh:
|
||||
// '[id]': { id: string }; // Untuk detail event
|
||||
};
|
||||
|
||||
// Tipe untuk Stack Navigator Autentikasi
|
||||
export type AuthStackParamList = {
|
||||
index: undefined; // Layar Login
|
||||
register: undefined; // Layar Pendaftaran
|
||||
verification: undefined; // Layar Verifikasi
|
||||
};
|
||||
|
||||
// Tipe untuk Stack Navigator Utama Aplikasi (setelah autentikasi)
|
||||
export type AppStackParamList = {
|
||||
"(home-tabs)": NavigatorScreenParams<HomeTabParamList>; // Mengarah ke Tab Navigator
|
||||
event: NavigatorScreenParams<EventStackParamList>; // Mengarah ke Event Stack
|
||||
forum: undefined; // NEW: Halaman Forum, sebagai Stack Screen terpisah
|
||||
// Anda bisa menambahkan rute stack lain di sini yang tidak termasuk dalam grup di atas
|
||||
};
|
||||
|
||||
// Gabungkan semua tipe rute utama ke dalam RootParamList global
|
||||
// Ini memungkinkan penggunaan useNavigation dan useRouter dengan tipe yang benar
|
||||
declare global {
|
||||
namespace ReactNavigation {
|
||||
interface RootParamList extends AuthStackParamList, AppStackParamList {}
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@expo/vector-icons": "^14.1.0",
|
||||
"@react-navigation/bottom-tabs": "^7.3.10",
|
||||
"@react-navigation/bottom-tabs": "^7.4.2",
|
||||
"@react-navigation/elements": "^2.3.8",
|
||||
"@react-navigation/native": "^7.1.6",
|
||||
"@react-navigation/native-stack": "^7.3.21",
|
||||
"@types/react-native-vector-icons": "^6.4.18",
|
||||
"expo": "~53.0.12",
|
||||
"expo-blur": "~14.1.5",
|
||||
|
||||
78
screens/Authentication/LoginView.tsx
Normal file
78
screens/Authentication/LoginView.tsx
Normal file
@@ -0,0 +1,78 @@
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { Styles } from "@/styles/global-styles";
|
||||
import { router } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { Text, View } from "react-native";
|
||||
import PhoneInput, { ICountry } from "react-native-international-phone-number";
|
||||
import ButtonCustom from "@/components/Button/ButtonCustom";
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
|
||||
|
||||
export default function LoginView() {
|
||||
const [selectedCountry, setSelectedCountry] = useState<null | ICountry>(null);
|
||||
const [inputValue, setInputValue] = useState<string>("");
|
||||
|
||||
function handleInputValue(phoneNumber: string) {
|
||||
setInputValue(phoneNumber);
|
||||
}
|
||||
|
||||
function handleSelectedCountry(country: ICountry) {
|
||||
setSelectedCountry(country);
|
||||
}
|
||||
|
||||
function handleLogin() {
|
||||
const callingCode = selectedCountry?.callingCode.replace(/^\+/, "") || "";
|
||||
const fixNumber = callingCode + inputValue;
|
||||
console.log(fixNumber);
|
||||
router.push("/verification");
|
||||
}
|
||||
|
||||
return (
|
||||
<ViewWrapper withBackground>
|
||||
<View style={Styles.authContainer}>
|
||||
<View>
|
||||
<View style={Styles.authContainerTitle}>
|
||||
<Text style={Styles.authSubTitle}>WELCOME TO</Text>
|
||||
<Spacing height={5} />
|
||||
<Text style={Styles.authTitle}>HIPMI BADUNG APPS</Text>
|
||||
<Spacing height={5} />
|
||||
</View>
|
||||
<Spacing height={50} />
|
||||
<Text
|
||||
style={{
|
||||
position: "absolute",
|
||||
bottom: 30,
|
||||
right: 20,
|
||||
fontSize: 10,
|
||||
fontWeight: "thin",
|
||||
fontStyle: "italic",
|
||||
color: MainColor.white,
|
||||
}}
|
||||
>
|
||||
powered by muku.id
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<PhoneInput
|
||||
value={inputValue}
|
||||
onChangePhoneNumber={handleInputValue}
|
||||
selectedCountry={selectedCountry}
|
||||
onChangeSelectedCountry={handleSelectedCountry}
|
||||
defaultCountry="ID"
|
||||
placeholder="Masukkan nomor"
|
||||
/>
|
||||
|
||||
<Spacing height={20} />
|
||||
|
||||
<ButtonCustom
|
||||
title="Login"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
radius={10}
|
||||
onPress={handleLogin}
|
||||
/>
|
||||
</View>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
62
screens/Authentication/RegisterView.tsx
Normal file
62
screens/Authentication/RegisterView.tsx
Normal file
@@ -0,0 +1,62 @@
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import ButtonCustom from "@/components/Button/ButtonCustom";
|
||||
import { TextInputCustom } from "@/components/TextInput/TextInputCustom";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { Styles } from "@/styles/global-styles";
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { router } from "expo-router";
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
|
||||
export default function RegisterView() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper withBackground>
|
||||
<View style={Styles.authContainer}>
|
||||
<View>
|
||||
<View style={Styles.authContainerTitle}>
|
||||
<Text style={Styles.authTitle}>REGISTRASI</Text>
|
||||
<Spacing />
|
||||
<MaterialCommunityIcons
|
||||
name="account"
|
||||
size={100}
|
||||
color={MainColor.yellow}
|
||||
/>
|
||||
<Spacing />
|
||||
|
||||
<Text style={Styles.textLabel}>
|
||||
Anda akan terdaftar dengan nomor
|
||||
</Text>
|
||||
<Text style={Styles.textLabel}>+6282xxxxxxxxx</Text>
|
||||
<Spacing />
|
||||
</View>
|
||||
<TextInputCustom placeholder="Masukkan username" />
|
||||
|
||||
<ButtonCustom
|
||||
title="Daftar"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
radius={10}
|
||||
onPress={() => (
|
||||
console.log("Success register"),
|
||||
router.push("/(application)/home")
|
||||
)}
|
||||
/>
|
||||
<Spacing />
|
||||
{/* <ButtonCustom
|
||||
title="Home"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
radius={10}
|
||||
onPress={() => {
|
||||
console.log("Home clicked");
|
||||
router.push("/(application)/home");
|
||||
}}
|
||||
/> */}
|
||||
</View>
|
||||
</View>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
61
screens/Authentication/VerificationView.tsx
Normal file
61
screens/Authentication/VerificationView.tsx
Normal file
@@ -0,0 +1,61 @@
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import ButtonCustom from "@/components/Button/ButtonCustom";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { Styles } from "@/styles/global-styles";
|
||||
import { router } from "expo-router";
|
||||
import { Text, View } from "react-native";
|
||||
import { OtpInput } from "react-native-otp-entry";
|
||||
|
||||
export default function VerificationView() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper withBackground>
|
||||
<View style={Styles.authContainer}>
|
||||
<View>
|
||||
<View style={Styles.authContainerTitle}>
|
||||
<Text style={Styles.authTitle}>Verifikasi KOde OTP</Text>
|
||||
<Spacing height={30} />
|
||||
<Text style={Styles.textLabel}>Masukan 4 digit kode otp</Text>
|
||||
<Text style={Styles.textLabel}>
|
||||
Yang di kirim ke +6282xxxxxxxxx
|
||||
</Text>
|
||||
<Spacing height={30} />
|
||||
<OtpInput
|
||||
numberOfDigits={4}
|
||||
theme={{
|
||||
pinCodeContainerStyle: {
|
||||
backgroundColor: MainColor.login,
|
||||
borderRadius: 10,
|
||||
borderWidth: 1,
|
||||
borderColor: MainColor.yellow,
|
||||
width: 60,
|
||||
height: 60,
|
||||
},
|
||||
containerStyle: {
|
||||
paddingLeft: 10,
|
||||
paddingRight: 10,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<Spacing height={30} />
|
||||
<Text style={Styles.textLabel}>
|
||||
Tidak menerima kode ?{" "}
|
||||
<Text style={Styles.textLabel}>Kirim Ulang</Text>
|
||||
</Text>
|
||||
</View>
|
||||
<Spacing height={30} />
|
||||
</View>
|
||||
|
||||
<ButtonCustom
|
||||
title="Verifikasi"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
radius={10}
|
||||
onPress={() => router.push("/register")}
|
||||
/>
|
||||
</View>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,33 +1,18 @@
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { globalStyles } from "@/constants/global-styles";
|
||||
import { Styles } from "@/styles/global-styles";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { Image } from "expo-image";
|
||||
import { useNavigation } from "expo-router";
|
||||
import { useEffect } from "react";
|
||||
import { router } from "expo-router";
|
||||
import { ScrollView, Text, TouchableOpacity, View } from "react-native";
|
||||
import Icon from "react-native-vector-icons/FontAwesome";
|
||||
import DynamicTruncatedText from "../_ShareComponent/TruncatedText";
|
||||
import DynamicTruncatedText from "@/components/_ShareComponent/TruncatedText";
|
||||
import { stylesHome } from "./homeViewStyle";
|
||||
|
||||
export default function HomeView() {
|
||||
const navigation = useNavigation();
|
||||
useEffect(() => {
|
||||
navigation.setOptions({
|
||||
title: "HIPMI",
|
||||
headerLeft: () => (
|
||||
<Ionicons name="search" size={20} color={MainColor.white} />
|
||||
),
|
||||
headerRight: () => (
|
||||
<Ionicons name="notifications" size={20} color={MainColor.white} />
|
||||
),
|
||||
});
|
||||
}, [navigation]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ScrollView contentContainerStyle={{ flexGrow: 1 }}>
|
||||
<View style={globalStyles.mainContainer}>
|
||||
<View style={Styles.homeContainer}>
|
||||
<Spacing height={20} />
|
||||
<View
|
||||
style={{
|
||||
@@ -54,7 +39,10 @@ export default function HomeView() {
|
||||
|
||||
{/* Grid Section */}
|
||||
<View style={stylesHome.gridContainer}>
|
||||
<TouchableOpacity style={stylesHome.gridItem}>
|
||||
<TouchableOpacity
|
||||
style={stylesHome.gridItem}
|
||||
onPress={() => router.push("/(application)/event")}
|
||||
>
|
||||
<Ionicons name="analytics" size={48} color="white" />
|
||||
<Text style={stylesHome.gridLabel}>Event</Text>
|
||||
</TouchableOpacity>
|
||||
194
screens/Home/UiHome.tsx
Normal file
194
screens/Home/UiHome.tsx
Normal file
@@ -0,0 +1,194 @@
|
||||
/* eslint-disable no-unused-expressions */
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { Href, router } from "expo-router";
|
||||
import React from "react";
|
||||
import {
|
||||
Dimensions,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
} from "react-native";
|
||||
import Home_BottomFeatureSection from "./bottomFeatureSection";
|
||||
import Home_ImageSection from "./imageSection";
|
||||
import Home_FeatureSection from "./topFeatureSection";
|
||||
|
||||
interface Tabs {
|
||||
id: string;
|
||||
icon: string;
|
||||
activeIcon: string;
|
||||
label: string;
|
||||
path: Href;
|
||||
isActive: boolean;
|
||||
disabled: boolean;
|
||||
}
|
||||
|
||||
const { width } = Dimensions.get("window");
|
||||
|
||||
export default function NewHomeView() {
|
||||
const tabs: Tabs[] = [
|
||||
{
|
||||
id: "forum",
|
||||
icon: "chatbubble-ellipses-outline",
|
||||
activeIcon: "chatbubble-ellipses",
|
||||
label: "Forum",
|
||||
path: "/forum",
|
||||
isActive: true,
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
id: "marketplace",
|
||||
icon: "cart-outline",
|
||||
activeIcon: "cart",
|
||||
label: "Marketplace",
|
||||
path: "/market-place",
|
||||
isActive: false,
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
id: "maps",
|
||||
icon: "map-outline",
|
||||
activeIcon: "map",
|
||||
label: "Maps",
|
||||
path: "/maps",
|
||||
isActive: true,
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
id: "profile",
|
||||
icon: "person-outline",
|
||||
activeIcon: "person",
|
||||
label: "Profile",
|
||||
path: "/profile",
|
||||
isActive: true,
|
||||
disabled: false,
|
||||
},
|
||||
];
|
||||
|
||||
const CustomTab = ({ icon, label, isActive, onPress, disabled }: any) => (
|
||||
<TouchableOpacity
|
||||
style={[styles.tabItem, isActive && styles.activeTab]}
|
||||
onPress={onPress}
|
||||
activeOpacity={0.7}
|
||||
>
|
||||
<View
|
||||
style={[styles.iconContainer, isActive && styles.activeIconContainer]}
|
||||
>
|
||||
<Ionicons name={icon} size={20} color={isActive ? "#fff" : "#666"} />
|
||||
</View>
|
||||
<Text style={[styles.tabLabel, isActive && styles.activeTabLabel]}>
|
||||
{label}
|
||||
</Text>
|
||||
{isActive && <View style={styles.activeIndicator} />}
|
||||
</TouchableOpacity>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
tabBarComponent={
|
||||
<View style={styles.tabBar}>
|
||||
<View style={styles.tabContainer}>
|
||||
{tabs.map((e) => (
|
||||
<CustomTab
|
||||
key={e.id}
|
||||
icon={e.icon}
|
||||
label={e.label}
|
||||
isActive={e.isActive}
|
||||
onPress={() => {
|
||||
e.disabled ? console.log("disabled") : router.push(e.path);
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
}
|
||||
>
|
||||
<Home_ImageSection />
|
||||
<Spacing height={10} />
|
||||
|
||||
{/* Grid Section */}
|
||||
<Home_FeatureSection />
|
||||
<Spacing height={10} />
|
||||
|
||||
{/* Job Vacancy Section */}
|
||||
<Home_BottomFeatureSection />
|
||||
<Spacing height={20} />
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
tabBar: {
|
||||
backgroundColor: MainColor.darkblue,
|
||||
borderTopColor: AccentColor.blue,
|
||||
borderTopWidth: 1,
|
||||
// borderTopEndRadius: 10,
|
||||
// borderTopStartRadius: 10,
|
||||
// tintColor: MainColor.yellow
|
||||
// paddingBottom: 20,
|
||||
// paddingTop: 10,
|
||||
// shadowColor: AccentColor.blue,
|
||||
// shadowOffset: {
|
||||
// width: 0,
|
||||
// height: -2,
|
||||
// },
|
||||
// shadowOpacity: 0.9,
|
||||
// shadowRadius: 3,
|
||||
// elevation: 5,
|
||||
},
|
||||
tabContainer: {
|
||||
flexDirection: "row",
|
||||
justifyContent: "space-around",
|
||||
alignItems: "center",
|
||||
paddingHorizontal: 0,
|
||||
},
|
||||
tabItem: {
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
paddingVertical: 8,
|
||||
paddingHorizontal: 12,
|
||||
minWidth: width / 5,
|
||||
position: "relative",
|
||||
},
|
||||
activeTab: {
|
||||
transform: [{ scale: 1.05 }],
|
||||
},
|
||||
iconContainer: {
|
||||
padding: 8,
|
||||
borderRadius: 20,
|
||||
// marginBottom: 4,
|
||||
},
|
||||
activeIconContainer: {
|
||||
// backgroundColor: "#007AFF",
|
||||
// shadowColor: "#007AFF",
|
||||
// shadowOffset: {
|
||||
// width: 0,
|
||||
// height: 2,
|
||||
// },
|
||||
// shadowOpacity: 0.3,
|
||||
// shadowRadius: 4,
|
||||
// elevation: 4,
|
||||
},
|
||||
tabLabel: {
|
||||
fontSize: 10,
|
||||
color: "#666",
|
||||
fontWeight: "500",
|
||||
},
|
||||
activeTabLabel: {
|
||||
color: MainColor.white,
|
||||
fontWeight: "600",
|
||||
},
|
||||
activeIndicator: {
|
||||
position: "absolute",
|
||||
bottom: -2,
|
||||
width: 4,
|
||||
height: 4,
|
||||
borderRadius: 2,
|
||||
backgroundColor: "#007AFF",
|
||||
},
|
||||
});
|
||||
60
screens/Home/bottomFeatureSection.tsx
Normal file
60
screens/Home/bottomFeatureSection.tsx
Normal file
@@ -0,0 +1,60 @@
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import DynamicTruncatedText from "@/components/_ShareComponent/TruncatedText";
|
||||
import { Text, View } from "react-native";
|
||||
import Icon from "react-native-vector-icons/FontAwesome";
|
||||
import { stylesHome } from "./homeViewStyle";
|
||||
|
||||
export default function Home_BottomFeatureSection() {
|
||||
return (
|
||||
<>
|
||||
<View style={stylesHome.jobVacancyContainer}>
|
||||
<View style={stylesHome.jobVacancyHeader}>
|
||||
<Icon name="briefcase" size={24} color="white" />
|
||||
<Text style={stylesHome.jobVacancyTitle}>Job Vacancy</Text>
|
||||
</View>
|
||||
|
||||
<View style={stylesHome.vacancyList}>
|
||||
{/* Vacancy Item 1 */}
|
||||
<View style={stylesHome.vacancyItem}>
|
||||
{/* <Icon name="user" size={20} color="#FFD700" /> */}
|
||||
<View style={stylesHome.vacancyDetails}>
|
||||
<DynamicTruncatedText
|
||||
text="Bagas_banuna"
|
||||
fontSize={14}
|
||||
fontFamily="System"
|
||||
style={stylesHome.vacancyName}
|
||||
/>
|
||||
<Spacing height={5} />
|
||||
<DynamicTruncatedText
|
||||
text="Dicari perawat kucing"
|
||||
fontSize={12}
|
||||
fontFamily="System"
|
||||
style={stylesHome.vacancyDescription}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/* Vacancy Item 2 */}
|
||||
<View style={stylesHome.vacancyItem}>
|
||||
{/* <Icon name="user" size={20} color="#FFD700" /> */}
|
||||
<View style={stylesHome.vacancyDetails}>
|
||||
<DynamicTruncatedText
|
||||
text="fibramarcell"
|
||||
fontSize={14}
|
||||
fontFamily="System"
|
||||
style={stylesHome.vacancyName}
|
||||
/>
|
||||
<Spacing height={5} />
|
||||
<DynamicTruncatedText
|
||||
text="Di Butuhkan Seorang..."
|
||||
fontSize={12}
|
||||
fontFamily="System"
|
||||
style={stylesHome.vacancyDescription}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</>
|
||||
);
|
||||
}
|
||||
26
screens/Home/imageSection.tsx
Normal file
26
screens/Home/imageSection.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Image } from "expo-image";
|
||||
import { View } from "react-native";
|
||||
|
||||
export default function Home_ImageSection() {
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
backgroundColor: "#fff",
|
||||
borderRadius: 10,
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
source={require("@/assets/images/constants/home-hipmi.png")}
|
||||
contentFit="cover"
|
||||
transition={1000}
|
||||
style={{
|
||||
width: "100%",
|
||||
height: 120,
|
||||
borderRadius: 10,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
54
screens/Home/topFeatureSection.tsx
Normal file
54
screens/Home/topFeatureSection.tsx
Normal file
@@ -0,0 +1,54 @@
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router } from "expo-router";
|
||||
import { Text, TouchableOpacity, View } from "react-native";
|
||||
import { stylesHome } from "./homeViewStyle";
|
||||
|
||||
export default function Home_FeatureSection() {
|
||||
return (
|
||||
<>
|
||||
<View style={stylesHome.gridContainer}>
|
||||
<TouchableOpacity
|
||||
style={stylesHome.gridItem}
|
||||
onPress={() => router.push("/(application)/event")}
|
||||
>
|
||||
<Ionicons name="analytics" size={48} color="white" />
|
||||
<Text style={stylesHome.gridLabel}>Event</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={stylesHome.gridItem}>
|
||||
<Ionicons name="share" size={48} color="white" />
|
||||
<Text style={stylesHome.gridLabel}>Collaboration</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={stylesHome.gridItem}>
|
||||
<Ionicons name="cube" size={48} color="white" />
|
||||
<Text style={stylesHome.gridLabel}>Voting</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={stylesHome.gridItem}>
|
||||
<Ionicons name="heart" size={48} color="white" />
|
||||
<Text style={stylesHome.gridLabel}>Crowdfunding</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
<View style={stylesHome.gridContainer}>
|
||||
<TouchableOpacity
|
||||
style={stylesHome.gridItem}
|
||||
onPress={() => router.push("/(application)/event")}
|
||||
>
|
||||
<Ionicons name="analytics" size={48} color="white" />
|
||||
<Text style={stylesHome.gridLabel}>Event</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={stylesHome.gridItem}>
|
||||
<Ionicons name="share" size={48} color="white" />
|
||||
<Text style={stylesHome.gridLabel}>Collaboration</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={stylesHome.gridItem}>
|
||||
<Ionicons name="cube" size={48} color="white" />
|
||||
<Text style={stylesHome.gridLabel}>Voting</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={stylesHome.gridItem}>
|
||||
<Ionicons name="heart" size={48} color="white" />
|
||||
<Text style={stylesHome.gridLabel}>Crowdfunding</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,29 +1,31 @@
|
||||
import { StyleSheet } from "react-native";
|
||||
import { MainColor } from "./color-palet";
|
||||
import { MainColor } from "../constants/color-palet";
|
||||
|
||||
export const globalStyles = StyleSheet.create({
|
||||
export const Styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
paddingInline: 30,
|
||||
paddingBlock: 20,
|
||||
},
|
||||
mainContainer: {
|
||||
flex: 1,
|
||||
paddingInline: 25,
|
||||
paddingBlock: 10,
|
||||
backgroundColor: MainColor.darkblue,
|
||||
},
|
||||
|
||||
containerWithBackground: {
|
||||
flex: 1,
|
||||
paddingInline: 25,
|
||||
paddingBlock: 10,
|
||||
},
|
||||
imageBackground: {
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
},
|
||||
|
||||
|
||||
// AUTHENTICATION
|
||||
authContainer: {
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
},
|
||||
authContainerTitle: {
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
// marginBottom: 50,
|
||||
},
|
||||
authTitle: {
|
||||
fontSize: 27,
|
||||
@@ -35,9 +37,28 @@ export const globalStyles = StyleSheet.create({
|
||||
color: MainColor.yellow,
|
||||
fontWeight: "bold",
|
||||
},
|
||||
|
||||
// TEXT & LABEL
|
||||
textLabel: {
|
||||
fontSize: 16,
|
||||
fontSize: 14,
|
||||
color: MainColor.white,
|
||||
fontWeight: "normal",
|
||||
},
|
||||
|
||||
// Stack Header Style
|
||||
headerStyle: {
|
||||
backgroundColor: MainColor.darkblue,
|
||||
},
|
||||
headerTitleStyle: {
|
||||
color: MainColor.yellow,
|
||||
fontWeight: "bold",
|
||||
},
|
||||
|
||||
// HOME
|
||||
homeContainer: {
|
||||
flex: 1,
|
||||
paddingInline: 25,
|
||||
paddingBlock: 10,
|
||||
backgroundColor: MainColor.darkblue,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user