Skip to content

Commit

Permalink
Add user data to user menu as well
Browse files Browse the repository at this point in the history
References #142
  • Loading branch information
u8sand committed Jun 26, 2024
1 parent 9e40faa commit 2d34d61
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions app/fragments/playbook/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ export default function Layout({ children }: React.PropsWithChildren) {
</div>
</label>
<ul tabIndex={0} className="menu menu-compact dropdown-content mt-3 p-2 shadow bg-base-100 rounded-box w-52">
<li className="menu-title prose"><span>Data</span></li>
<li><Link href="/account/uploads">Uploads</Link></li>
<li><Link href="/account/playbooks">Playbooks</Link></li>
<li><Link href="/account/suggestions">Suggestions</Link></li>
<li className="menu-title prose"><span>Account</span></li>
<li><Link href="/account">Settings</Link></li>
<li><button className="hover:underline" onClick={() => {Auth.signOut()}}>Sign Out</button></li>
<li><Link href="/api/auth/signout" onClick={() => {Auth.signOut()}}>Sign Out</Link></li>
</ul>
</div>
: <button className="btn btn-ghost text-black hover:text-black dark:text-white dark:hover:text-white" onClick={() => {Auth.signIn()}}>Sign in</button>}
Expand Down Expand Up @@ -99,23 +104,35 @@ export default function Layout({ children }: React.PropsWithChildren) {
<div className="drawer-side">
<label htmlFor="my-drawer-3" className="drawer-overlay"></label>
<ul className="menu p-4 w-80 bg-base-100">
<li className="menu-title">
<li className="menu-title prose">
<span>Playbook</span>
</li>
<li><Link href="/playbooks">Published Playbooks</Link></li>
<li><Link href="/chat">Text to Workflow</Link></li>
<li><Link href="/components">Component Catalog</Link></li>
<li><Link href="/explore">Component Graph</Link></li>
<li><a href="https://github.com/MaayanLab/Playbook-Workflow-Builder/blob/main/docs/user/index.md" target="_blank">User Guide</a></li>
<li className="menu-title">
<span>Account</span>
</li>
{session && session.user ?
<>
<li><Link href="/account">Settings</Link></li>
<li><button className="hover:underline" onClick={() => {Auth.signOut()}}>Sign Out</button></li>
<li className="menu-title prose">
<span>Data</span>
</li>
<li><Link href="/account/uploads">Uploads</Link></li>
<li><Link href="/account/playbooks">Playbooks</Link></li>
<li><Link href="/account/suggestions">Suggestions</Link></li>
<li className="menu-title prose">
<span>Account</span>
</li>
<li><Link href="/account">Settings</Link></li>
<li><Link href="/api/auth/signout" onClick={() => {Auth.signOut()}}>Sign Out</Link></li>
</>
: <li><button className="hover:underline" onClick={() => {Auth.signIn()}}>Sign in</button></li>}
:
<>
<li className="menu-title prose">
<span>Account</span>
</li>
<li><Link href="/api/auth/signin" onClick={() => {Auth.signIn()}}>Sign in</Link></li>
</>}
</ul>
</div>
</div>
Expand Down

0 comments on commit 2d34d61

Please sign in to comment.