Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/AchievementGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function AchievementTile({ achievement }: { achievement: Achievement }) {
opacity,
}}
>
<Text style={{ fontSize: 24 }}>{achievement.icon}</Text>
<Text accessible={true} accessibilityRole="image" accessibilityLabel={`${achievement.title} icon`} style={{ fontSize: 24 }}>{achievement.icon}</Text>
<Text
style={{
color: colors.text,
Expand Down
2 changes: 1 addition & 1 deletion src/components/EarningsSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default function EarningsSummary({ activities }: EarningsSummaryProps) {
marginBottom: spacing.xs,
}}
>
<Text style={{ fontSize: 14, width: 24 }}>{item.icon}</Text>
<Text accessible={true} accessibilityRole="image" accessibilityLabel={`${item.label} icon`} style={{ fontSize: 14, width: 24 }}>{item.icon}</Text>
<Text
style={{
color: colors.text,
Expand Down
2 changes: 1 addition & 1 deletion src/components/EmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function EmptyState({
marginTop: spacing.xl * 2,
}}
>
<Text style={{ fontSize: 64 }}>{icon}</Text>
<Text accessible={true} accessibilityRole="image" accessibilityLabel="Empty state icon" style={{ fontSize: 64 }}>{icon}</Text>
<Text
style={{
color: colors.text,
Expand Down
5 changes: 4 additions & 1 deletion src/components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default class ErrorBoundary extends Component<Props, State> {
}
return (
<View
accessibilityLiveRegion="polite"
style={{
flex: 1,
backgroundColor: colors.background,
Expand All @@ -38,7 +39,7 @@ export default class ErrorBoundary extends Component<Props, State> {
padding: spacing.lg,
}}
>
<Text style={{ fontSize: 48 }}>⚠️</Text>
<Text accessible={true} accessibilityRole="image" accessibilityLabel="Warning icon" style={{ fontSize: 48 }}>⚠️</Text>
<Text
style={{
color: colors.text,
Expand All @@ -59,6 +60,8 @@ export default class ErrorBoundary extends Component<Props, State> {
{this.state.error?.message || 'An unexpected error occurred'}
</Text>
<TouchableOpacity
accessibilityRole="button"
accessibilityLabel="Try Again"
onPress={this.handleRetry}
style={{
marginTop: spacing.lg,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ImpactStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function StatItem({
}) {
return (
<View style={{ alignItems: 'center' }}>
<Text style={{ fontSize: 24 }}>{icon}</Text>
<Text accessible={true} accessibilityRole="image" accessibilityLabel={`${label} icon`} style={{ fontSize: 24 }}>{icon}</Text>
<Text
style={{
color: colors.text,
Expand Down
3 changes: 3 additions & 0 deletions src/components/LoadingSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export default function Skeleton({

return (
<Animated.View
accessible={true}
accessibilityLabel="Loading..."
accessibilityLiveRegion="polite"
style={[
{
width,
Expand Down
1 change: 1 addition & 0 deletions src/components/OfflineBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default function OfflineBanner() {

return (
<View
accessibilityLiveRegion="polite"
style={{
backgroundColor: colors.warning,
padding: 8,
Expand Down
5 changes: 4 additions & 1 deletion src/components/PendingProofsBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ export default function PendingProofsBanner({
alignItems: 'center',
marginTop: spacing.md,
}}
accessibilityLiveRegion="polite"
>
<Text style={{ fontSize: 20, marginRight: spacing.sm }}>📤</Text>
<Text style={{ fontSize: 20, marginRight: spacing.sm }} accessible={true} accessibilityLabel="Outbox">📤</Text>
<View style={{ flex: 1 }}>
<Text style={{ color: '#000', fontWeight: '600', fontSize: 13 }}>
{count} proof{count === 1 ? '' : 's'} waiting to sync
Expand All @@ -48,6 +49,8 @@ export default function PendingProofsBanner({
<TouchableOpacity
onPress={onRetry}
disabled={!canRetry}
accessibilityRole="button"
accessibilityLabel="Retry syncing proofs"
style={{
paddingHorizontal: spacing.md,
paddingVertical: spacing.sm,
Expand Down
2 changes: 1 addition & 1 deletion src/components/RewardBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function RewardBadge({
alignSelf: 'flex-start',
}}
>
<Text style={{ fontSize: s.icon, marginRight: s.badge / 4 }}>
<Text style={{ fontSize: s.icon, marginRight: s.badge / 4 }} accessible={true} accessibilityLabel={tier.label}>
{tier.emoji}
</Text>
<Text
Expand Down
2 changes: 1 addition & 1 deletion src/components/StreakCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function StreakCard({ streak, bestStreak }: StreakCardProps) {
marginRight: spacing.md,
}}
>
<Text style={{ fontSize: 28 }}>{streak > 0 ? '🔥' : '🧊'}</Text>
<Text style={{ fontSize: 28 }} accessible={true} accessibilityLabel={streak > 0 ? 'Fire' : 'Ice'}>{streak > 0 ? '🔥' : '🧊'}</Text>
</View>

<View style={{ flex: 1 }}>
Expand Down
2 changes: 2 additions & 0 deletions src/components/TabBarIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export default function TabBarIcon({
fontSize: size,
opacity: focused ? 1 : 0.5,
}}
accessible={true}
accessibilityLabel="Tab icon"
>
{emoji}
</Text>
Expand Down
5 changes: 4 additions & 1 deletion src/components/TaskCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export default function TaskCard({
return (
<TouchableOpacity
onPress={() => onPress(id)}
accessibilityRole="button"
accessibilityLabel={`Task: ${title}`}
accessibilityHint="Navigates to task details"
style={{
backgroundColor: colors.surface,
borderRadius: 12,
Expand All @@ -52,7 +55,7 @@ export default function TaskCard({
borderColor: colors.border,
}}
>
<Text style={{ fontSize: 32, marginRight: spacing.md }}>
<Text style={{ fontSize: 32, marginRight: spacing.md }} accessible={true} accessibilityLabel="Task icon">
{TASK_TYPE_CONFIG[type]?.icon || '📍'}
</Text>
<View style={{ flex: 1 }}>
Expand Down
28 changes: 13 additions & 15 deletions src/components/TransactionHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function TransactionHistory({

if (loading) {
return (
<View style={{ marginTop: spacing.xl }}>
<View style={{ marginTop: spacing.xl }} accessibilityLiveRegion="polite">
<Skeleton
height={18}
width="40%"
Expand All @@ -80,20 +80,18 @@ export default function TransactionHistory({

if (error) {
return (
<View style={{ marginTop: spacing.xl, alignItems: 'center' }}>
<View style={{ marginTop: spacing.xl, alignItems: 'center' }} accessibilityLiveRegion="polite">
<Text style={{ color: colors.error, fontSize: 13 }}>{error}</Text>
<TouchableOpacity
onPress={() => void loadPayments()}
accessibilityRole="button"
style={{
marginTop: spacing.xs,
paddingVertical: spacing.sm,
paddingHorizontal: spacing.md,
minHeight: 44,
justifyContent: 'center',
}}
>
<Text style={{ color: colors.primary, fontSize: 13 }}>Retry</Text>
<TouchableOpacity onPress={loadPayments} accessibilityRole="button" accessibilityLabel="Retry loading transaction history">
<Text
style={{
color: colors.primary,
fontSize: 13,
marginTop: spacing.xs,
}}
>
Retry
</Text>
</TouchableOpacity>
</View>
);
Expand Down Expand Up @@ -131,7 +129,7 @@ export default function TransactionHistory({
borderColor: colors.border,
}}
>
<Text style={{ fontSize: 20, marginRight: spacing.md }}>
<Text style={{ fontSize: 20, marginRight: spacing.md }} accessible={true} accessibilityLabel={isSent ? 'Sent' : 'Received'}>
{isSent ? '↗️' : '↙️'}
</Text>
<View style={{ flex: 1 }}>
Expand Down
21 changes: 10 additions & 11 deletions src/screens/EditProfileScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,9 @@ export default function EditProfileScreen() {
>
<TouchableOpacity
onPress={() => navigation.goBack()}
style={{ marginBottom: spacing.md }}
accessibilityLabel="Cancel editing profile"
accessibilityRole="button"
accessibilityLabel="Cancel"
style={{
alignSelf: 'flex-start',
paddingVertical: spacing.sm,
paddingHorizontal: spacing.md,
marginLeft: -spacing.md,
marginBottom: spacing.md,
minHeight: 44,
justifyContent: 'center',
}}
>
<Text style={{ color: colors.primary, fontSize: 16 }}>Cancel</Text>
</TouchableOpacity>
Expand Down Expand Up @@ -112,6 +104,7 @@ export default function EditProfileScreen() {
onChangeText={setName}
placeholder="Your name"
placeholderTextColor={colors.textSecondary}
accessibilityLabel="Display Name input"
style={{
backgroundColor: colors.surface,
borderRadius: 12,
Expand All @@ -138,6 +131,7 @@ export default function EditProfileScreen() {
onChangeText={setBio}
placeholder="Tell others about yourself"
placeholderTextColor={colors.textSecondary}
accessibilityLabel="Bio input"
multiline
numberOfLines={4}
textAlignVertical="top"
Expand All @@ -157,6 +151,8 @@ export default function EditProfileScreen() {
<TouchableOpacity
onPress={() => void handleSave()}
disabled={isSaving}
accessibilityLabel="Save Changes"
accessibilityRole="button"
style={{
padding: spacing.md,
backgroundColor: colors.primary,
Expand All @@ -165,7 +161,10 @@ export default function EditProfileScreen() {
opacity: isSaving ? 0.5 : 1,
}}
>
<Text style={{ color: '#FFF', fontWeight: '600', fontSize: 16 }}>
<Text
style={{ color: '#FFF', fontWeight: '600', fontSize: 16 }}
accessibilityLiveRegion="polite"
>
{isSaving ? 'Saving...' : 'Save Changes'}
</Text>
</TouchableOpacity>
Expand Down
24 changes: 21 additions & 3 deletions src/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ export default function HomeScreen() {
paddingBottom: spacing.lg,
}}
>
<TouchableOpacity onPress={() => navigation.navigate('Profile')}>
<TouchableOpacity
onPress={() => navigation.navigate('Profile')}
accessibilityLabel={`Go to Profile. ${getGreeting()}, ${profile?.name || 'Eco Warrior'}`}
accessibilityRole="button"
>
<Text style={{ color: colors.textSecondary, fontSize: 16 }}>
{getGreeting()},
</Text>
Expand Down Expand Up @@ -178,6 +182,8 @@ export default function HomeScreen() {

<TouchableOpacity
onPress={() => navigation.navigate('Tasks')}
accessibilityLabel="Browse Tasks"
accessibilityRole="button"
style={{
padding: spacing.lg,
backgroundColor: colors.primary,
Expand All @@ -190,7 +196,14 @@ export default function HomeScreen() {
<Text style={{ color: '#FFF', fontWeight: 'bold', fontSize: 18 }}>
Browse Tasks
</Text>
<Text style={{ marginLeft: spacing.sm, fontSize: 20 }}>🌿</Text>
<Text
style={{ marginLeft: spacing.sm, fontSize: 20 }}
accessible={true}
accessibilityLabel="Leaves"
accessibilityRole="image"
>
🌿
</Text>
</TouchableOpacity>
</View>

Expand Down Expand Up @@ -262,7 +275,12 @@ export default function HomeScreen() {
a.status === 'pending' ? colors.warning : colors.border,
}}
>
<Text style={{ fontSize: 24, marginRight: spacing.md }}>
<Text
style={{ fontSize: 24, marginRight: spacing.md }}
accessible={true}
accessibilityLabel="Task Icon"
accessibilityRole="image"
>
{TASK_TYPE_CONFIG[a.taskType as TaskType]?.icon || '📍'}
</Text>
<View style={{ flex: 1 }}>
Expand Down
36 changes: 30 additions & 6 deletions src/screens/MapScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,14 @@ export default function MapScreen() {

{/* ── Header ── */}
<View style={styles.header} pointerEvents="box-none">
<View style={styles.headerCard}>
<Text style={styles.headerTitle}>🗺️ Discover Tasks</Text>
<View style={styles.headerCard} accessibilityLiveRegion="polite">
<Text
style={styles.headerTitle}
accessible={true}
accessibilityLabel="Discover Tasks Map"
>
🗺️ Discover Tasks
</Text>
{isLoading && (
<ActivityIndicator
size="small"
Expand All @@ -271,9 +277,11 @@ export default function MapScreen() {
/>
)}
{error != null && (
<TouchableOpacity
onPress={() => void refresh()}
<TouchableOpacity
onPress={refresh}
style={styles.retryBtn}
accessibilityLabel="Retry loading tasks"
accessibilityRole="button"
>
<Text style={styles.retryText}>Retry</Text>
</TouchableOpacity>
Expand All @@ -289,6 +297,8 @@ export default function MapScreen() {
key={km}
testID={`radius-btn-${km}`}
onPress={() => setRadiusKm(km)}
accessibilityLabel={`Set radius to ${km} kilometers`}
accessibilityRole="button"
style={[
styles.radiusOpt,
radiusKm === km && styles.radiusOptActive,
Expand All @@ -312,6 +322,8 @@ export default function MapScreen() {
<TouchableOpacity
testID="recenter-btn"
style={styles.recenterBtn}
accessibilityLabel="Recenter map on your location"
accessibilityRole="button"
onPress={() => {
mapRef.current?.animateToRegion(
{
Expand All @@ -324,14 +336,26 @@ export default function MapScreen() {
);
}}
>
<Text style={styles.recenterIcon}>◎</Text>
<Text
style={styles.recenterIcon}
accessible={true}
accessibilityLabel="Recenter map"
accessibilityRole="image"
>
</Text>
</TouchableOpacity>
)}

{/* ── No-location fallback notice ── */}
{!location && (
<View style={styles.noLocationBanner} pointerEvents="none">
<Text style={styles.noLocationText}>
<Text
style={styles.noLocationText}
accessible={true}
accessibilityLabel="Enable location to see tasks near you"
accessibilityLiveRegion="polite"
>
📍 Enable location to see tasks near you
</Text>
</View>
Expand Down
Loading