Skip to content
Merged
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
4 changes: 2 additions & 2 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import {
Nunito_700Bold,
Nunito_800ExtraBold,
} from '@expo-google-fonts/nunito';
import { SITE_URL, PLAY_STORE_URL } from '../constants/ExternalLinks';

// Initialize Sentry as early as possible (no-op on web or without DSN)
initSentry();

// Privacy-freundliches, minimales Analytics (no-op ohne EXPO_PUBLIC_PLAUSIBLE_DOMAIN)
initAnalytics();

const SITE_URL = 'https://s540d.github.io/DrawFromMemory/';
const OG_IMAGE_URL = `${SITE_URL}feature-graphic.png`;
const SEO_TITLE = 'Merke und Male – Gedächtnistraining für Kinder';
const SEO_DESCRIPTION =
Expand Down Expand Up @@ -99,7 +99,7 @@ function RootLayoutContent() {
price: '0',
priceCurrency: 'EUR',
},
installUrl: 'https://play.google.com/store/apps/details?id=com.s540d.merkeundmale',
installUrl: PLAY_STORE_URL,
})}
</script>
</Head>
Expand Down
2 changes: 1 addition & 1 deletion app/gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const styles = StyleSheet.create({
},
dailyBadge: {
alignSelf: 'flex-start',
backgroundColor: '#F59E0B',
backgroundColor: Colors.accents.dailyChallenge,
borderRadius: BorderRadius.sm,
paddingHorizontal: 6,
paddingVertical: 2,
Expand Down
12 changes: 3 additions & 9 deletions app/game.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React, { useState, useEffect } from 'react';
import { View, Text, StyleSheet, TouchableOpacity, Modal, Platform } from 'react-native';
import { View, Text, StyleSheet, TouchableOpacity, Modal } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { useScreenLayout } from '@utils/useScreenLayout';
import { useRouter, useLocalSearchParams } from 'expo-router';
import { getTotalLevels, getDifficultyForLevel } from '@services/LevelManager';
import { getTotalLevels } from '@services/LevelManager';
import { useTranslation, getLanguage } from '@services/i18n';
import { useTheme } from '@services/ThemeContext';
import Colors from '../constants/Colors';
import { Spacing, FontSize, FontWeight, BorderRadius } from '../constants/Layout';
import { FeatureFlags } from '../constants/featureFlags';
import LevelImageDisplay from '@components/LevelImageDisplay';
import DrawingCanvas, { useDrawingCanvas } from '@components/DrawingCanvas';
import { useDrawingCanvas } from '@components/DrawingCanvas';
import SettingsModal from '@components/SettingsModal';
import { ErrorBoundary } from '@components/ErrorBoundary';
import ConfettiBurst from '@components/ConfettiBurst';
Expand Down Expand Up @@ -87,7 +87,6 @@ export default function GameScreen() {
handleRatingSubmit,
saveToGallery,
startReplay,
restartCurrentLevel,
startNextLevel,
restartFromLevel1,
} = useGamePhase({
Expand Down Expand Up @@ -127,11 +126,6 @@ export default function GameScreen() {
});
}, [phase]); // eslint-disable-line react-hooks/exhaustive-deps

const handleRestartCurrentLevel = () => {
resetHint();
restartCurrentLevel();
};

const handleStartNextLevel = () => {
if (levelNumber % LEVELS_PER_PAUSE === 0 && levelNumber < totalLevels) {
setShowPauseModal(true);
Expand Down
16 changes: 8 additions & 8 deletions app/levels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ export default function LevelsScreen() {

useEffect(() => {
let mounted = true;
Promise.all(
levels.map(level =>
storageManager
.getLevelRating(level.number)
.then(r => [level.number, r] as [number, number | null]),
),
).then(entries => {
if (mounted) setRatings(Object.fromEntries(entries));
// Ein einziger Progress-Read statt einem getLevelRating()-Read pro Level
storageManager.getProgress().then(progress => {
if (!mounted) return;
setRatings(
Object.fromEntries(
levels.map(level => [level.number, progress.levels[level.number]?.bestRating ?? null]),
),
);
});
return () => {
mounted = false;
Expand Down
3 changes: 1 addition & 2 deletions app/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { View, Text, StyleSheet, TouchableOpacity, ScrollView } from 'react-nati
import { useRouter } from 'expo-router';
import { useTranslation } from '@services/i18n';
import { useTheme } from '@services/ThemeContext';
import Colors from '../constants/Colors';
import { Spacing, FontSize, FontWeight, BorderRadius } from '../constants/Layout';
import { Spacing, FontSize, FontWeight } from '../constants/Layout';
import SettingsModal from '@components/SettingsModal';

/**
Expand Down
137 changes: 0 additions & 137 deletions components/AnimatedHero.tsx

This file was deleted.

10 changes: 1 addition & 9 deletions components/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ const VARIANT_COLORS: Record<BadgeVariant, string> = {
difficulty: Colors.primary,
};

const DIFFICULTY_COLORS: Record<number, string> = {
1: Colors.difficulty[1],
2: Colors.difficulty[2],
3: Colors.difficulty[3],
4: Colors.difficulty[4],
5: Colors.difficulty[5],
};

/**
* Badge – kleines Label für Status, Schwierigkeit oder Kategorien.
*
Expand All @@ -48,7 +40,7 @@ export function Badge({
}) {
const backgroundColor =
variant === 'difficulty' && difficulty !== undefined
? (DIFFICULTY_COLORS[difficulty] ?? Colors.primary)
? ((Colors.difficulty as Record<number, string>)[difficulty] ?? Colors.primary)
: VARIANT_COLORS[variant];

const containerStyle: ViewStyle[] = [
Expand Down
2 changes: 1 addition & 1 deletion components/BadgesModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function BadgesModal({ visible, onClose }: Props) {
style={[
styles.row,
{
backgroundColor: colors.surface ?? Colors.surface,
backgroundColor: colors.surface,
opacity: isUnlocked ? 1 : 0.45,
borderColor: isUnlocked ? Colors.primary : 'transparent',
},
Expand Down
Loading
Loading