Skip to content

Commit 418e4f6

Browse files
authored
Merge pull request #399 from dDevAhmed/feature/375-floating-action-button
feat(frontend): add FloatingActionButton with expandable quick actions
2 parents 1172f18 + 1dac97c commit 418e4f6

50 files changed

Lines changed: 257 additions & 47 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/frontend/app/dao/[id]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { WrongNetworkAlert } from '@/components/wallet/WrongNetworkAlert';
1212

1313
const ProposalDetailPage: React.FC = () => {
1414
const params = useParams();
15-
const id = params.id as string;
15+
const id = typeof params?.id === 'string' ? params.id : '';
1616
const [proposal, setProposal] = useState<Proposal | null>(null);
1717
const [loading, setLoading] = useState(true);
1818
const [error, setError] = useState<string | null>(null);

app/frontend/app/demo/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use client";
22

33
import React, { useState } from 'react';
4-
import MultiSourceDataAggregator from '../components/MultiSourceDataAggregator';
5-
import SessionTimeoutManager from '../components/SessionTimeoutManager';
4+
import MultiSourceDataAggregator from '../../components/MultiSourceDataAggregator';
5+
import SessionTimeoutManager from '../../components/SessionTimeoutManager';
66

77
// Demo page for testing both components
88
const ComponentDemoPage: React.FC = () => {

app/frontend/app/events/[id]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type EventDetailPayload = Event & {
2121

2222
export default function EventDetailPage() {
2323
const params = useParams();
24-
const eventId = params.id as string;
24+
const eventId = typeof params?.id === 'string' ? params.id : '';
2525

2626
const [event, setEvent] = useState<EventDetailPayload | null>(null);
2727
const [loading, setLoading] = useState(true);

app/frontend/app/events/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export default function EventsPage() {
160160
) : (
161161
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
162162
{events.map((event) => {
163-
const status = getEventStatus(event.startDate, event.endDate);
163+
const status = getEventStatus(event.startDate, event.endDate ?? null);
164164
return (
165165
<Link
166166
key={event.id}
@@ -201,7 +201,7 @@ export default function EventsPage() {
201201
<div className="space-y-2 mb-4">
202202
<div className="flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400">
203203
<Calendar className="w-4 h-4" />
204-
<span>{formatDateRange(event.startDate, event.endDate)}</span>
204+
<span>{formatDateRange(event.startDate, event.endDate ?? null)}</span>
205205
</div>
206206
{event.registeredCount > 0 && (
207207
<div className="flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400">

app/frontend/app/layout.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { Geist, Geist_Mono } from "next/font/google";
33
import "./globals.css";
44
import { WalletProvider } from "@/components/wallet/WalletProvider";
55
import { OfflineProvider } from "@/lib/offline/OfflineContext";
6+
import { FloatingActionButton } from "@/components/navigation/FloatingActionButton";
7+
import { RoleProvider } from "@/components/dao/RoleContext";
68

79
const geistSans = Geist({
810
variable: "--font-geist-sans",
@@ -41,9 +43,12 @@ export default function RootLayout({
4143
<html lang="en" className={`${geistSans.variable} ${geistMono.variable}`}>
4244
<body className="antialiased">
4345
<OfflineProvider>
44-
<WalletProvider>
45-
{children}
46-
</WalletProvider>
46+
<RoleProvider>
47+
<WalletProvider>
48+
{children}
49+
<FloatingActionButton />
50+
</WalletProvider>
51+
</RoleProvider>
4752
</OfflineProvider>
4853
</body>
4954
</html>

app/frontend/components/DataTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { useState } from "react";
4-
import { motion, AnimatePresence } from "motion/react";
4+
import { motion, AnimatePresence } from "framer-motion";
55

66
// Example data
77
const initialData = [

app/frontend/components/MultiSourceDataAggregator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import React, { useState, useEffect, useCallback } from 'react';
4-
import { motion, AnimatePresence } from 'motion/react';
4+
import { motion, AnimatePresence } from 'framer-motion';
55
import { AlertCircle, RefreshCw, CheckCircle, XCircle, Loader2 } from 'lucide-react';
66

77
// Types for the component

app/frontend/components/ReusableTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import React, { useState } from "react";
4-
import { motion, AnimatePresence } from "motion/react";
4+
import { motion, AnimatePresence } from "framer-motion";
55

66
interface TableColumn {
77
key: string;

app/frontend/components/SessionTimeoutHandler.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import React, { useState, useEffect, useCallback, useRef } from 'react';
4-
import { motion, AnimatePresence } from 'motion/react';
4+
import { motion, AnimatePresence } from 'framer-motion';
55
import { AlertCircle, Clock, LogOut, RefreshCcw, ShieldAlert } from 'lucide-react';
66

77
interface SessionTimeoutHandlerProps {

app/frontend/components/SessionTimeoutManager.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import React, { useState, useEffect, useCallback, useRef } from 'react';
4-
import { motion, AnimatePresence } from 'motion/react';
4+
import { motion, AnimatePresence } from 'framer-motion';
55
import { AlertTriangle, Clock, LogOut, RefreshCw, X } from 'lucide-react';
66

77
// Types for the component

0 commit comments

Comments
 (0)