Skip to content

Commit

Permalink
adding gh sign in
Browse files Browse the repository at this point in the history
  • Loading branch information
samifouad committed Apr 21, 2024
1 parent b9c4c9a commit e77bb9a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
23 changes: 23 additions & 0 deletions src/components/MenuIcon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ export let userProfilePage
export let userProfileImage
// https://avatars.githubusercontent.com/u/6378290?v=4
// Set the store to true when the button is clicked
function openMenu() {
//console.log('button clicked') // DEBUG
isOpen.set(!isOpen.get());
}
// Add an event listener to the button
document.getElementById('hamburgerMenu').addEventListener('click', openMenu)
isOpen.subscribe(open => {
if (open) {
document.getElementById('drawerMenu').style.display = 'block';
document.getElementById('drawerMenu').classList.add('fade-in');
//console.log('menu open') // DEBUG
} else {
document.getElementById('drawerMenu').classList.remove('fade-in');
document.getElementById('drawerMenu').style.display = 'none';
//console.log('menu closed') // DEBUG
}
})
</script>

<style>
Expand Down
24 changes: 1 addition & 23 deletions src/components/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { supabase } from '../lib/supabase'
import { onMount } from 'svelte'
import MenuIcon from './MenuIcon.svelte'
import SignInGithub from './SignInGithub.svelte'
import { isOpen, isLoggedIn } from '../lib/store'
import { isLoggedIn } from '../lib/store'
let user = { loggedIn: false };
Expand All @@ -25,28 +25,6 @@ onMount(async () => {
// don't need special handling here
}
});
// Set the store to true when the button is clicked
function openMenu() {
//console.log('button clicked') // DEBUG
isOpen.set(!isOpen.get());
}
// Add an event listener to the button
document.getElementById('hamburgerMenu').addEventListener('click', openMenu)
isOpen.subscribe(open => {
if (open) {
document.getElementById('drawerMenu').style.display = 'block';
document.getElementById('drawerMenu').classList.add('fade-in');
//console.log('menu open') // DEBUG
} else {
document.getElementById('drawerMenu').classList.remove('fade-in');
document.getElementById('drawerMenu').style.display = 'none';
//console.log('menu closed') // DEBUG
}
})
</script>

<style>
Expand Down

0 comments on commit e77bb9a

Please sign in to comment.