Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #200: collaborative projects #210

Merged
merged 1 commit into from
Dec 30, 2024
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
2 changes: 2 additions & 0 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import StreakManager from './services/streak/StreakManager';
import ViewManager from './services/view/ViewManager';
import BadgeManager from './services/badge/BadgeManager';
import CollaborationManager from './services/collaboration/CollaborationManager';
import SupportReminder from './components/Modal Management/SupportReminder';

const AppContent = () => {
const [isDark, setIsDark] = useState(false);
Expand Down Expand Up @@ -391,6 +392,7 @@ const AppContent = () => {
onConfirm={handleConfirmClear}
onCancel={() => setShowClearDataModal(false)}
/>
<SupportReminder />
<Analytics />
</div>
) : (
Expand Down
1 change: 0 additions & 1 deletion client/src/components/Landing/Landing.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Sun,
Moon,
Brain,
Rocket,
Trophy,
Sparkles,
ChartLine,
Expand Down
83 changes: 83 additions & 0 deletions client/src/components/Modal Management/SupportReminder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import React, { useState, useEffect } from 'react';
import { Heart, Star} from 'lucide-react';

const REMINDER_INTERVAL = 5 * 24 * 60 * 60 * 1000; // 5 days

const SupportReminder = () => {
const [isVisible, setIsVisible] = useState(false);

useEffect(() => {
const checkAndShowReminder = () => {
const lastReminder = localStorage.getItem('lastSupportReminder');
const now = Date.now();

if (!lastReminder || (now - parseInt(lastReminder)) > REMINDER_INTERVAL) {
setIsVisible(true);
localStorage.setItem('lastSupportReminder', now.toString());
}
};

const timer = setTimeout(checkAndShowReminder, 5000);
return () => clearTimeout(timer);
}, []);

const handleClose = () => {
setIsVisible(false);
};

if (!isVisible) return null;

return (
<div className="fixed inset-0 z-50">
<div className="fixed inset-0 bg-black/50 backdrop-blur-sm" onClick={handleClose} />
<div className="fixed bottom-4 right-4 sm:bottom-6 sm:right-6 max-w-sm w-[calc(100%-2rem)] animate-slideUp">
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 p-4">
<div className="flex items-start justify-between">
<div className="flex-1">
<h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-2">
Enjoying QuestLog?
</h3>
<p className="text-sm text-gray-600 dark:text-gray-400 mb-4">
Help us grow by showing your support! Every little bit helps us continue improving.
</p>
<div className="flex flex-wrap gap-2">
<a
href="https://github.com/hussaino03/QuestLog"
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg
bg-gray-100 dark:bg-gray-700 text-sm font-medium
text-gray-900 dark:text-gray-100 hover:bg-gray-200
dark:hover:bg-gray-600 transition-colors"
>
<Star className="w-4 h-4" />
Star on GitHub
</a>
<a
href="https://paypal.me/hussaino03"
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg
bg-blue-50 dark:bg-blue-900/30 text-sm font-medium
text-blue-600 dark:text-blue-400 hover:bg-blue-100
dark:hover:bg-blue-900/50 transition-colors"
>
<Heart className="w-4 h-4" />
Support Development
</a>
</div>
</div>
<button
onClick={handleClose}
className="w-8 h-8 rounded-lg flex items-center justify-center bg-red-500/10 hover:bg-red-500/20 transition-colors"
>
<span className="text-red-600 dark:text-red-400 text-lg">×</span>
</button>
</div>
</div>
</div>
</div>
);
};

export default SupportReminder;
2 changes: 0 additions & 2 deletions client/src/services/task/TaskManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ class TaskManager {
console.error('[UPDATE-TASK] Server error:', errorText);
throw new Error(`Failed to sync project update: ${response.status}`);
}

const result = await response.json();
}

// Update local state after successful sync (or if not shared)
Expand Down
7 changes: 6 additions & 1 deletion client/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ module.exports = {
expandWidth: {
'0%': { width: '0%', opacity: '0' },
'100%': { width: '100%', opacity: '1' }
},
slideUp: {
'0%': { transform: 'translateY(100%)', opacity: '0' },
'100%': { transform: 'translateY(0)', opacity: '1' }
}
},
animation: {
Expand All @@ -47,7 +51,8 @@ module.exports = {
float: 'float 6s ease-in-out infinite',
scale: 'scale 0.5s ease-out',
shimmer: 'shimmer 2s infinite linear',
expandWidth: 'expandWidth 0.8s ease-out forwards'
expandWidth: 'expandWidth 0.8s ease-out forwards',
slideUp: 'slideUp 0.3s ease-out forwards'
}
}
},
Expand Down
Loading