|
|
@ -4,18 +4,11 @@ import AccountDropdown from './AccountDropdown.astro'; |
|
|
|
--- |
|
|
|
--- |
|
|
|
|
|
|
|
|
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<div |
|
|
|
|
|
|
|
class='flex h-8 w-24 items-center justify-center rounded-full bg-gradient-to-r from-blue-500 to-blue-700 py-2 px-4 text-sm text-white hover:from-blue-500 hover:to-blue-600' |
|
|
|
|
|
|
|
id='navigation-spinner' |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<Spinner class='text-white' /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<AccountDropdown /> |
|
|
|
<AccountDropdown /> |
|
|
|
|
|
|
|
|
|
|
|
<a |
|
|
|
<a |
|
|
|
id='register-button' |
|
|
|
id='register-button' |
|
|
|
class='flex hidden h-8 w-24 cursor-pointer items-center justify-center rounded-full bg-gradient-to-r from-blue-500 to-blue-700 py-2 px-4 text-sm font-medium text-white hover:from-blue-500 hover:to-blue-600' |
|
|
|
class='flex h-8 w-24 cursor-pointer items-center justify-center rounded-full bg-gradient-to-r from-blue-500 to-blue-700 py-2 px-4 text-sm font-medium text-white hover:from-blue-500 hover:to-blue-600' |
|
|
|
href='/signup' |
|
|
|
href='/signup' |
|
|
|
> |
|
|
|
> |
|
|
|
<span>Register</span> |
|
|
|
<span>Register</span> |
|
|
@ -25,16 +18,16 @@ import AccountDropdown from './AccountDropdown.astro'; |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import Cookies from 'js-cookie'; |
|
|
|
import Cookies from 'js-cookie'; |
|
|
|
import { TOKEN_COOKIE_NAME } from '../../lib/constants'; |
|
|
|
import { TOKEN_COOKIE_NAME } from '../../lib/constants'; |
|
|
|
const spinner = document.getElementById('navigation-spinner'); |
|
|
|
|
|
|
|
const registerButton = document.getElementById('register-button'); |
|
|
|
const registerButton = document.getElementById('register-button'); |
|
|
|
const accountDropdown = document.getElementById('account-dropdown'); |
|
|
|
const accountDropdown = document.getElementById('account-dropdown'); |
|
|
|
spinner?.classList.add('hidden'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const token = Cookies.get(TOKEN_COOKIE_NAME); |
|
|
|
const token = Cookies.get(TOKEN_COOKIE_NAME); |
|
|
|
|
|
|
|
|
|
|
|
if (token) { |
|
|
|
if (token) { |
|
|
|
accountDropdown?.classList.remove('hidden'); |
|
|
|
accountDropdown?.classList.remove('hidden'); |
|
|
|
|
|
|
|
registerButton?.classList.add('hidden'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
registerButton?.classList.remove('hidden'); |
|
|
|
registerButton?.classList.remove('hidden'); |
|
|
|
|
|
|
|
accountDropdown?.classList.add('hidden'); |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|