mirror of
https://github.com/soconnor0919/hristudio.git
synced 2025-12-11 22:54:45 -05:00
refactor(dashboard, participants, sidebar, users-tab, email): Clean up and enhance component logic and UI
- Removed unused code and comments from the Dashboard component to streamline functionality. - Updated the ParticipantsList component by removing unnecessary skeleton loaders and table headers for improved clarity. - Adjusted the Sidebar component to redirect to the main dashboard instead of the studies page when no study is selected. - Enhanced the UsersTab component to conditionally fetch invitations based on user permissions and improved role management UI. - Revamped the invitation email template for better presentation and clarity, including a more structured HTML format and improved messaging. - Updated role descriptions in the seed script for better accuracy and clarity.
This commit is contained in:
@@ -34,17 +34,6 @@ export default function Dashboard() {
|
||||
studyCount: data.length,
|
||||
activeInvitationCount: 0
|
||||
});
|
||||
|
||||
// If there's only one study and we're on the main dashboard, select it
|
||||
if (data.length === 1) {
|
||||
const study = {
|
||||
...data[0],
|
||||
createdAt: new Date(data[0].createdAt),
|
||||
updatedAt: data[0].updatedAt ? new Date(data[0].updatedAt) : null
|
||||
};
|
||||
setActiveStudy(study);
|
||||
router.push(`/dashboard/studies/${study.id}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching stats:", error);
|
||||
toast({
|
||||
@@ -55,7 +44,7 @@ export default function Dashboard() {
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
}, [toast, router, setActiveStudy]);
|
||||
}, [toast]);
|
||||
|
||||
useEffect(() => {
|
||||
fetchStats();
|
||||
|
||||
Reference in New Issue
Block a user