This commit is contained in:
@@ -65,11 +65,14 @@ export default function MenuClient({ initialCategories, siteSettings }: { initia
|
||||
|
||||
useEffect(() => {
|
||||
if (siteSettings.googleReviewUrl) {
|
||||
const hasSeenModal = sessionStorage.getItem('hasSeenReviewModal');
|
||||
if (!hasSeenModal) {
|
||||
const lastSeenStr = localStorage.getItem('lastSeenReviewModal');
|
||||
const now = new Date().getTime();
|
||||
const THIRTY_MINUTES = 30 * 60 * 1000; // 30 dakika (milisaniye cinsinden)
|
||||
|
||||
if (!lastSeenStr || (now - parseInt(lastSeenStr, 10)) > THIRTY_MINUTES) {
|
||||
const timer = setTimeout(() => {
|
||||
setShowReviewModal(true);
|
||||
sessionStorage.setItem('hasSeenReviewModal', 'true');
|
||||
localStorage.setItem('lastSeenReviewModal', now.toString());
|
||||
}, 1500);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
@@ -351,10 +354,10 @@ export default function MenuClient({ initialCategories, siteSettings }: { initia
|
||||
</div>
|
||||
|
||||
<h3 className="text-xl font-bold font-sans text-gray-900 mb-2">
|
||||
Bizi Değerlendirin
|
||||
{t('reviewTitle')}
|
||||
</h3>
|
||||
<p className="text-sm text-gray-600 mb-6 font-sans">
|
||||
Deneyiminizi önemsiyoruz! Bize Google üzerinde yorum yaparak destek olabilirsiniz.
|
||||
{t('reviewDesc')}
|
||||
</p>
|
||||
|
||||
<a
|
||||
@@ -364,14 +367,14 @@ export default function MenuClient({ initialCategories, siteSettings }: { initia
|
||||
onClick={() => setShowReviewModal(false)}
|
||||
className="block w-full py-3 px-4 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-xl transition-colors font-sans"
|
||||
>
|
||||
Google'da Yorum Yap
|
||||
{t('reviewBtn')}
|
||||
</a>
|
||||
|
||||
<button
|
||||
onClick={() => setShowReviewModal(false)}
|
||||
className="mt-4 text-sm font-medium text-gray-400 hover:text-gray-600 font-sans"
|
||||
>
|
||||
Daha Sonra
|
||||
{t('reviewLater')}
|
||||
</button>
|
||||
</motion.div>
|
||||
</motion.div>
|
||||
|
||||
Reference in New Issue
Block a user