File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44.env.local
55* .log
66package-lock.json
7+ package.json
Original file line number Diff line number Diff line change 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+ } ;
Original file line number Diff line number Diff line change @@ -5,10 +5,12 @@ import logo from "../assets/svg/logo.svg";
55import tikka from "../assets/svg/Tikka.svg" ;
66import WalletButton from "./WalletButton" ;
77import SignInButton from "./SignInButton" ;
8+ import NotificationBellIcon from "./cards/NotificationBellIcon" ;
89import { Search } from "lucide-react" ;
910import { useWalletContext } from "../providers/WalletProvider" ;
1011import { STELLAR_CONFIG } from "../config/stellar" ;
1112
13+
1214const 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
Original file line number Diff line number Diff line change 55 * Shows subscription status and allows quick toggle
66 */
77
8- import { Bell , BellOff } from 'lucide-react' ;
8+ import { Bell } from 'lucide-react' ;
99import { useNotifications } from '../../hooks/useNotifications' ;
1010import { 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 ) ;
You can’t perform that action at this time.
0 commit comments