Skip to content

Commit 8a9640e

Browse files
Update files before merging master
1 parent 4a05a39 commit 8a9640e

4 files changed

Lines changed: 47 additions & 16 deletions

File tree

backend/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
.env.local
55
*.log
66
package-lock.json
7+
package.json
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { createClient, SupabaseClient } from '@supabase/supabase-js';
2+
import { ConfigService } from '@nestjs/config';
3+
4+
export const SUPABASE_CLIENT = 'SUPABASE_CLIENT';
5+
6+
export const supabaseProvider = {
7+
provide: SUPABASE_CLIENT,
8+
inject: [ConfigService], // 1. Inject ConfigService
9+
useFactory: (configService: ConfigService): SupabaseClient => { // 2. Accept it as an argument
10+
11+
// 3. Pull values using configService
12+
const url = configService.get<string>('SUPABASE_URL');
13+
const serviceRoleKey = configService.get<string>('SUPABASE_SERVICE_ROLE_KEY');
14+
15+
if (!url || !serviceRoleKey) {
16+
throw new Error(
17+
'SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY must be set in environment',
18+
);
19+
}
20+
return createClient(url, serviceRoleKey);
21+
},
22+
};

client/src/components/Navbar.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import logo from "../assets/svg/logo.svg";
55
import tikka from "../assets/svg/Tikka.svg";
66
import WalletButton from "./WalletButton";
77
import SignInButton from "./SignInButton";
8+
import NotificationBellIcon from "./cards/NotificationBellIcon";
89
import { Search } from "lucide-react";
910
import { useWalletContext } from "../providers/WalletProvider";
1011
import { STELLAR_CONFIG } from "../config/stellar";
1112

13+
1214
const Navbar = ({ onStart }: { onStart?: () => void }) => {
1315
const [open, setOpen] = React.useState(false);
1416
const { isConnected, isWrongNetwork, switchNetwork } = useWalletContext();
@@ -121,7 +123,13 @@ useEffect(() => {
121123
</div>
122124
)}
123125

124-
<WalletButton />
126+
<div className="flex items-center gap-4">
127+
128+
<WalletButton />
129+
130+
</div>
131+
132+
<NotificationBellIcon raffleId={0} onAuthRequired={() => { /* optionally open sign-in drawer */ }} />
125133
<SignInButton />
126134
</div>
127135

client/src/components/cards/NotificationBellIcon.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Shows subscription status and allows quick toggle
66
*/
77

8-
import { Bell, BellOff } from 'lucide-react';
8+
import { Bell} from 'lucide-react';
99
import { useNotifications } from '../../hooks/useNotifications';
1010
import { useAuthContext } from '../../providers/AuthProvider';
1111

@@ -45,23 +45,23 @@ export default function NotificationBellIcon({
4545
<button
4646
onClick={handleClick}
4747
disabled={isLoading}
48-
className={`
49-
p-2 rounded-lg transition-all duration-200
50-
disabled:opacity-50 disabled:cursor-not-allowed
51-
${
52-
isSubscribed
53-
? 'bg-purple-500/20 text-purple-400 hover:bg-purple-500/30'
54-
: 'bg-gray-700/50 text-gray-400 hover:bg-gray-700'
55-
}
56-
`}
57-
title={isSubscribed ? 'Unsubscribe from notifications' : 'Subscribe to notifications'}
48+
className={`inline-flex items-center justify-center rounded-full p-1.5 transition-all duration-200 ease-out focus:outline-none focus:ring-2 focus:ring-purple-500/50 disabled:opacity-50 disabled:cursor-not-allowed ${
49+
isSubscribed
50+
? 'text-violet-400 hover:text-violet-300'
51+
: 'text-white/60 hover:text-white'
52+
}`}
53+
title={isSubscribed ? 'Notifications enabled' : 'Enable notifications'}
5854
>
5955
{isLoading ? (
60-
<div className="w-5 h-5 border-2 border-current border-t-transparent rounded-full animate-spin" />
61-
) : isSubscribed ? (
62-
<Bell className="w-5 h-5 fill-current" />
56+
<div className="h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent" />
6357
) : (
64-
<BellOff className="w-5 h-5" />
58+
<Bell
59+
className={`h-5 w-5 transition-all duration-300 ${
60+
isSubscribed
61+
? 'fill-current text-violet-400 scale-110 '
62+
: 'fill-none stroke-current text-white/60'
63+
}`}
64+
/>
6565
)}
6666
</button>
6767
);

0 commit comments

Comments
 (0)