Skip to content

Commit 9becae5

Browse files
committed
refactor: simplify navbar actions and enhance logout functionality
- Removed the development-only button for creating projects in the navbar to streamline the UI. - Updated the logout function in the useAuthActions hook to redirect users to the home page after signing out.
1 parent edcc565 commit 9becae5

2 files changed

Lines changed: 7 additions & 42 deletions

File tree

components/landing-page/navbar.tsx

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -299,51 +299,14 @@ function AuthenticatedActions() {
299299

300300
function UnauthenticatedActions() {
301301
const [createProjectModalOpen, setCreateProjectModalOpen] = useState(false);
302-
const {
303-
executeProtectedAction,
304-
showWalletModal,
305-
closeWalletModal,
306-
handleWalletConnected,
307-
} = useProtectedAction({
308-
actionName: ACTIONS.CREATE_PROJECT,
309-
onSuccess: () => setCreateProjectModalOpen(true),
310-
});
311-
312-
const isDev = process.env.NODE_ENV !== 'production';
302+
const { showWalletModal, closeWalletModal, handleWalletConnected } =
303+
useProtectedAction({
304+
actionName: ACTIONS.CREATE_PROJECT,
305+
onSuccess: () => setCreateProjectModalOpen(true),
306+
});
313307

314308
return (
315309
<>
316-
{isDev && (
317-
<BoundlessButton
318-
variant='outline'
319-
size='sm'
320-
onClick={() =>
321-
executeProtectedAction(() => setCreateProjectModalOpen(true))
322-
}
323-
className='border-white/20 transition-all duration-200'
324-
style={
325-
{
326-
'--hover-bg': `${BRAND_COLOR}1A`,
327-
'--hover-border': `${BRAND_COLOR}66`,
328-
'--hover-color': BRAND_COLOR,
329-
} as React.CSSProperties
330-
}
331-
onMouseEnter={e => {
332-
e.currentTarget.style.backgroundColor = `${BRAND_COLOR}1A`;
333-
e.currentTarget.style.borderColor = `${BRAND_COLOR}66`;
334-
e.currentTarget.style.color = BRAND_COLOR;
335-
}}
336-
onMouseLeave={e => {
337-
e.currentTarget.style.backgroundColor = '';
338-
e.currentTarget.style.borderColor = '';
339-
e.currentTarget.style.color = '';
340-
}}
341-
>
342-
<Plus className='mr-2 h-4 w-4' />
343-
Add Project
344-
</BoundlessButton>
345-
)}
346-
347310
<Link
348311
href='/auth?mode=signin'
349312
className='inline-flex h-8 items-center justify-center gap-2 rounded-[10px] bg-[#a7f950] px-3 text-sm font-medium whitespace-nowrap text-black shadow-sm shadow-[#a7f950]/20 transition-all hover:bg-[#a7f950]/90'

hooks/use-auth.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,12 @@ export function useAuthStatus() {
166166

167167
// Hook for auth actions
168168
export function useAuthActions() {
169+
const router = useRouter();
169170
const logout = useCallback(async () => {
170171
try {
171172
console.log('Signing out user');
172173
await authClient.signOut();
174+
router.push('/');
173175
} catch (error) {
174176
console.error('Failed to sign out:', error);
175177
throw error;

0 commit comments

Comments
 (0)