import React, { useState } from 'react';
import { View, ScrollView, Text, StyleSheet, Switch, Pressable } from 'react-native';
import { Ux4gCarousel } from '../components/carousel';
import { useUx4gTheme } from '../theme/Ux4gThemeContext';
import { UX4GColors } from '../foundation/colors';
const buildHeroSlide = (
theme: any,
bgColor: string,
badgeText: string,
title: string,
description: string,
buttonText: string
) => (
{/* Badge Tag */}
{badgeText}
{/* Title & Description */}
{title}
{description}
{/* Call to Action Button */}
{buttonText}
);
export const CarouselShowcase: React.FC = () => {
const theme = useUx4gTheme();
const [autoPlay, setAutoPlay] = useState(true);
const [showPagination, setShowPagination] = useState(true);
const [showArrows, setShowArrows] = useState(false);
const [intervalSec, setIntervalSec] = useState(3);
const colors = [
theme.colors.primary,
theme.colors.secondary,
theme.colors.info,
theme.colors.success,
];
const slideItems = Array.from({ length: 4 }).map((_, index) => (
Slide {index + 1}
(Replace with desired banner content)
));
const imageItems = [
{ title: 'Digital Governance', subtitle: 'Empowering citizens with seamless digital services' },
{ title: 'Innovation Portal', subtitle: 'Building open-source tools for public design systems' },
{ title: 'Secure Authentication', subtitle: 'Fast and reliable citizen identity verification' },
{ title: 'Accessible UI Tokens', subtitle: 'WCAG AAA compliant theme colors and typography' },
].map((slide, index) => (
{slide.title}
{slide.subtitle}
));
const heroSlideItems = [
buildHeroSlide(
theme,
theme.colors.primary,
'FEATURED',
'Digital Services Portal 2.0',
'Seamlessly access government citizen services with single sign-on and instant verification.',
'Explore Services'
),
buildHeroSlide(
theme,
theme.colors.info,
'NEW UPDATE',
'Biometric Identity Capture',
'Fast, secure face verification integration with real-time liveness checks.',
'View Documentation'
),
buildHeroSlide(
theme,
theme.colors.secondary,
'POPULAR',
'Unified Design System',
'Production-ready accessible UI components built for digital infrastructure.',
'Get Started'
),
];
return (
{/* Card 1: Rich Hero Banner Carousel */}
Hero Banner Carousel
Rich hero slides featuring top badge tag, bold title, description, call-to-action button, and arrow pagination.
{/* Card 3: Viewport Fraction Carousel */}
Viewport Fraction Peek Carousel (85%)
Using `viewportFraction={0.85}` allows users to peek at the edges of neighboring cards.
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
},
content: {
padding: 16,
},
card: {
borderWidth: 1,
borderRadius: 12,
padding: 16,
marginBottom: 20,
},
cardTitle: {
fontSize: 20,
fontWeight: 'bold',
marginBottom: 6,
},
cardSubtitle: {
fontSize: 13,
lineHeight: 18,
},
sectionTitle: {
fontSize: 14,
fontWeight: 'bold',
},
controlRow: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
marginVertical: 6,
},
chip: {
paddingHorizontal: 12,
paddingVertical: 6,
borderRadius: 16,
marginLeft: 6,
},
});