mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 04:27:56 +00:00
feat(mobile): add Quick Actions with image-based navigation
- Replace emoji-based menu with image-based Quick Actions grid - Add 10 Quick Actions: Education, Exchange, Forum, Governance, Trading, B2B, Banking, Games, Kurd Media, University - Implement navigation for completed features (Education, Swap, Forum, P2P) - Add "Coming Soon" badge and alert for features under development - 3-column grid layout with image previews - Images should be added to shared/images/quick-actions/ Quick Actions Status: ✅ Education → EducationScreen ✅ Exchange → SwapScreen ✅ Forum → ForumScreen ✅ Governance → Home (temp, needs dedicated tab) ✅ Trading → P2PScreen ⏳ B2B Trading (Coming Soon) ⏳ Banking (Coming Soon) ⏳ Games (Coming Soon) ⏳ Kurd Media (Coming Soon) ⏳ University (Coming Soon) Note: Images need to be added to shared/images/quick-actions/ directory
This commit is contained in:
@@ -7,9 +7,14 @@ import {
|
|||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
StatusBar,
|
StatusBar,
|
||||||
|
Image,
|
||||||
|
Alert,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { LinearGradient } from 'expo-linear-gradient';
|
import { LinearGradient } from 'expo-linear-gradient';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useNavigation } from '@react-navigation/native';
|
||||||
|
import type { NavigationProp } from '@react-navigation/native';
|
||||||
|
import type { BottomTabParamList } from '../navigation/BottomTabNavigator';
|
||||||
import AppColors, { KurdistanColors } from '../theme/colors';
|
import AppColors, { KurdistanColors } from '../theme/colors';
|
||||||
|
|
||||||
interface DashboardScreenProps {
|
interface DashboardScreenProps {
|
||||||
@@ -22,49 +27,86 @@ const DashboardScreen: React.FC<DashboardScreenProps> = ({
|
|||||||
onNavigateToSettings,
|
onNavigateToSettings,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const navigation = useNavigation<NavigationProp<BottomTabParamList>>();
|
||||||
|
|
||||||
const menuItems = [
|
const showComingSoon = (featureName: string) => {
|
||||||
|
Alert.alert(
|
||||||
|
'Coming Soon',
|
||||||
|
`${featureName} feature is under development and will be available soon!`,
|
||||||
|
[{ text: 'OK' }]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const quickActions = [
|
||||||
{
|
{
|
||||||
key: 'wallet',
|
key: 'education',
|
||||||
title: t('dashboard.wallet'),
|
title: 'Education',
|
||||||
icon: '💼',
|
image: require('../../../shared/images/quick-actions/qa_education.png'),
|
||||||
color: KurdistanColors.kesk,
|
available: true,
|
||||||
onPress: onNavigateToWallet,
|
onPress: () => navigation.navigate('Education'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'staking',
|
key: 'exchange',
|
||||||
title: t('dashboard.staking'),
|
title: 'Exchange',
|
||||||
icon: '🔒',
|
image: require('../../../shared/images/quick-actions/qa_exchange.png'),
|
||||||
color: KurdistanColors.zer,
|
available: true,
|
||||||
onPress: () => console.log('Navigate to Staking'),
|
onPress: () => navigation.navigate('Swap'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'forum',
|
||||||
|
title: 'Forum',
|
||||||
|
image: require('../../../shared/images/quick-actions/qa_forum.jpg'),
|
||||||
|
available: true,
|
||||||
|
onPress: () => navigation.navigate('Forum'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'governance',
|
key: 'governance',
|
||||||
title: t('dashboard.governance'),
|
title: 'Governance',
|
||||||
icon: '🗳️',
|
image: require('../../../shared/images/quick-actions/qa_governance.jpg'),
|
||||||
color: KurdistanColors.sor,
|
available: true,
|
||||||
onPress: () => console.log('Navigate to Governance'),
|
onPress: () => navigation.navigate('Home'), // TODO: Navigate to Governance screen
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'dex',
|
key: 'trading',
|
||||||
title: t('dashboard.dex'),
|
title: 'Trading',
|
||||||
icon: '💱',
|
image: require('../../../shared/images/quick-actions/qa_trading.jpg'),
|
||||||
color: '#2196F3',
|
available: true,
|
||||||
onPress: () => console.log('Navigate to DEX'),
|
onPress: () => navigation.navigate('P2P'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'history',
|
key: 'b2b',
|
||||||
title: t('dashboard.history'),
|
title: 'B2B Trading',
|
||||||
icon: '📜',
|
image: require('../../../shared/images/quick-actions/qa_b2b.png'),
|
||||||
color: '#9C27B0',
|
available: false,
|
||||||
onPress: () => console.log('Navigate to History'),
|
onPress: () => showComingSoon('B2B Trading'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'settings',
|
key: 'bank',
|
||||||
title: t('dashboard.settings'),
|
title: 'Banking',
|
||||||
icon: '⚙️',
|
image: require('../../../shared/images/quick-actions/qa_bank.png'),
|
||||||
color: '#607D8B',
|
available: false,
|
||||||
onPress: onNavigateToSettings,
|
onPress: () => showComingSoon('Banking'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'games',
|
||||||
|
title: 'Games',
|
||||||
|
image: require('../../../shared/images/quick-actions/qa_games.png'),
|
||||||
|
available: false,
|
||||||
|
onPress: () => showComingSoon('Games'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'kurdmedia',
|
||||||
|
title: 'Kurd Media',
|
||||||
|
image: require('../../../shared/images/quick-actions/qa_kurdmedia.jpg'),
|
||||||
|
available: false,
|
||||||
|
onPress: () => showComingSoon('Kurd Media'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'university',
|
||||||
|
title: 'University',
|
||||||
|
image: require('../../../shared/images/quick-actions/qa_university.png'),
|
||||||
|
available: false,
|
||||||
|
onPress: () => showComingSoon('University'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -110,20 +152,32 @@ const DashboardScreen: React.FC<DashboardScreenProps> = ({
|
|||||||
{/* Quick Actions */}
|
{/* Quick Actions */}
|
||||||
<View style={styles.section}>
|
<View style={styles.section}>
|
||||||
<Text style={styles.sectionTitle}>Quick Actions</Text>
|
<Text style={styles.sectionTitle}>Quick Actions</Text>
|
||||||
<View style={styles.menuGrid}>
|
<View style={styles.quickActionsGrid}>
|
||||||
{menuItems.map((item) => (
|
{quickActions.map((action) => (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
key={item.key}
|
key={action.key}
|
||||||
style={styles.menuItem}
|
style={[
|
||||||
onPress={item.onPress}
|
styles.quickActionItem,
|
||||||
|
!action.available && styles.quickActionDisabled
|
||||||
|
]}
|
||||||
|
onPress={action.onPress}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
<View
|
<View style={styles.quickActionImageContainer}>
|
||||||
style={[styles.menuIconContainer, { backgroundColor: item.color }]}
|
<Image
|
||||||
>
|
source={action.image}
|
||||||
<Text style={styles.menuIcon}>{item.icon}</Text>
|
style={styles.quickActionImage}
|
||||||
|
resizeMode="cover"
|
||||||
|
/>
|
||||||
|
{!action.available && (
|
||||||
|
<View style={styles.comingSoonBadge}>
|
||||||
|
<Text style={styles.comingSoonText}>Soon</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
<Text style={styles.menuTitle}>{item.title}</Text>
|
<Text style={styles.quickActionTitle} numberOfLines={2}>
|
||||||
|
{action.title}
|
||||||
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
@@ -239,39 +293,56 @@ const styles = StyleSheet.create({
|
|||||||
color: KurdistanColors.reş,
|
color: KurdistanColors.reş,
|
||||||
marginBottom: 16,
|
marginBottom: 16,
|
||||||
},
|
},
|
||||||
menuGrid: {
|
quickActionsGrid: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
gap: 12,
|
justifyContent: 'space-between',
|
||||||
},
|
},
|
||||||
menuItem: {
|
quickActionItem: {
|
||||||
width: '47%',
|
width: '30%',
|
||||||
backgroundColor: KurdistanColors.spi,
|
marginBottom: 16,
|
||||||
borderRadius: 16,
|
|
||||||
padding: 20,
|
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
quickActionDisabled: {
|
||||||
|
opacity: 0.6,
|
||||||
|
},
|
||||||
|
quickActionImageContainer: {
|
||||||
|
width: '100%',
|
||||||
|
aspectRatio: 1,
|
||||||
|
borderRadius: 12,
|
||||||
|
overflow: 'hidden',
|
||||||
|
marginBottom: 8,
|
||||||
shadowColor: '#000',
|
shadowColor: '#000',
|
||||||
shadowOffset: { width: 0, height: 2 },
|
shadowOffset: { width: 0, height: 2 },
|
||||||
shadowOpacity: 0.05,
|
shadowOpacity: 0.1,
|
||||||
shadowRadius: 6,
|
shadowRadius: 4,
|
||||||
elevation: 3,
|
elevation: 3,
|
||||||
|
position: 'relative',
|
||||||
},
|
},
|
||||||
menuIconContainer: {
|
quickActionImage: {
|
||||||
width: 60,
|
width: '100%',
|
||||||
height: 60,
|
height: '100%',
|
||||||
borderRadius: 30,
|
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
marginBottom: 12,
|
|
||||||
},
|
},
|
||||||
menuIcon: {
|
comingSoonBadge: {
|
||||||
fontSize: 28,
|
position: 'absolute',
|
||||||
|
top: 4,
|
||||||
|
right: 4,
|
||||||
|
backgroundColor: KurdistanColors.zer,
|
||||||
|
paddingHorizontal: 6,
|
||||||
|
paddingVertical: 2,
|
||||||
|
borderRadius: 4,
|
||||||
},
|
},
|
||||||
menuTitle: {
|
comingSoonText: {
|
||||||
fontSize: 14,
|
fontSize: 9,
|
||||||
|
fontWeight: '700',
|
||||||
|
color: KurdistanColors.reş,
|
||||||
|
},
|
||||||
|
quickActionTitle: {
|
||||||
|
fontSize: 12,
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
color: KurdistanColors.reş,
|
color: KurdistanColors.reş,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
|
lineHeight: 16,
|
||||||
},
|
},
|
||||||
proposalsCard: {
|
proposalsCard: {
|
||||||
backgroundColor: KurdistanColors.spi,
|
backgroundColor: KurdistanColors.spi,
|
||||||
|
|||||||
Reference in New Issue
Block a user