Prevent flash of sign in button on navigate

This commit is contained in:
James Grugett 2022-03-30 19:15:38 -05:00
parent 5c12da140d
commit 925e623a64

View File

@ -77,19 +77,22 @@ export default function Sidebar() {
folds = _.sortBy(folds, 'followCount').reverse() folds = _.sortBy(folds, 'followCount').reverse()
return ( return (
<nav aria-label="Sidebar" className="sticky top-4 divide-y divide-gray-300"> <nav
aria-label="Sidebar"
className="sticky top-4 mt-4 divide-y divide-gray-300"
>
<div className="space-y-1 pb-6"> <div className="space-y-1 pb-6">
<ManifoldLogo hideText /> <ManifoldLogo hideText />
</div> </div>
<div> <div style={{ minHeight: 93 }}>
{user ? ( {user ? (
<Link href={`/${user.username}`}> <Link href={`/${user.username}`}>
<a className="group"> <a className="group">
<ProfileSummary user={user} /> <ProfileSummary user={user} />
</a> </a>
</Link> </Link>
) : ( ) : user === null ? (
<div className="py-6 text-center"> <div className="py-6 text-center">
<button <button
className="btn border-none bg-gradient-to-r from-teal-500 to-green-500 px-10 text-lg font-medium normal-case hover:from-teal-600 hover:to-green-600" className="btn border-none bg-gradient-to-r from-teal-500 to-green-500 px-10 text-lg font-medium normal-case hover:from-teal-600 hover:to-green-600"
@ -98,6 +101,8 @@ export default function Sidebar() {
Sign in Sign in
</button> </button>
</div> </div>
) : (
<div />
)} )}
</div> </div>