1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 07:25:19 +02:00

Merge pull request #7 from jespr/jespr/sidebar-portfolio

Add sidebar portfolio holdings
This commit is contained in:
Josh Pigford 2024-01-02 15:00:28 -06:00 committed by GitHub
commit c988fdd2e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 30 deletions

View file

@ -20,37 +20,8 @@
<div class="flex items-center h-16 shrink-0"> <div class="flex items-center h-16 shrink-0">
<%= image_tag "logo-color-dark.svg", class: 'w-auto h-5' %> <%= image_tag "logo-color-dark.svg", class: 'w-auto h-5' %>
</div> </div>
<nav class="flex flex-col flex-1">
<ul role="list" class="flex flex-col flex-1 gap-y-7">
<li>
<ul role="list" class="-mx-2 space-y-1">
<li>
<%= link_to root_path, class: "flex p-2 text-sm font-semibold leading-6 text-gray-600 rounded-md group gap-x-3" do %>
<svg class="w-6 h-6 text-blue-600 shrink-0" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" />
</svg>
Dashboard
<% end %>
</li>
<li>
<%= link_to portfolios_path, class: "flex p-2 text-sm font-semibold leading-6 text-gray-600 rounded-md group gap-x-3" do %>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 text-blue-600 shrink-0">
<path stroke-linecap="round" stroke-linejoin="round" d="M20.25 14.15v4.25c0 1.094-.787 2.036-1.872 2.18-2.087.277-4.216.42-6.378.42s-4.291-.143-6.378-.42c-1.085-.144-1.872-1.086-1.872-2.18v-4.25m16.5 0a2.18 2.18 0 0 0 .75-1.661V8.706c0-1.081-.768-2.015-1.837-2.175a48.114 48.114 0 0 0-3.413-.387m4.5 8.006c-.194.165-.42.295-.673.38A23.978 23.978 0 0 1 12 15.75c-2.648 0-5.195-.429-7.577-1.22a2.016 2.016 0 0 1-.673-.38m0 0A2.18 2.18 0 0 1 3 12.489V8.706c0-1.081.768-2.015 1.837-2.175a48.111 48.111 0 0 1 3.413-.387m7.5 0V5.25A2.25 2.25 0 0 0 13.5 3h-3a2.25 2.25 0 0 0-2.25 2.25v.894m7.5 0a48.667 48.667 0 0 0-7.5 0M12 12.75h.008v.008H12v-.008Z" />
</svg>
Portfolios <%= render "/layouts/shared/sidebar_portfolio" %>
<% end %>
</li>
</ul>
</li>
<li class="mt-auto -mx-6">
<a href="#" class="flex items-center px-6 py-3 text-sm font-semibold leading-6 text-gray-900 gap-x-4 hover:bg-gray-50">
<span class="sr-only">Your profile</span>
<span aria-hidden="true"><%= current_user.email %></span>
</a>
</li>
</ul>
</nav>
</div> </div>
</div> </div>

View file

@ -0,0 +1,37 @@
<div class="space-y-3 -mx-2">
<div class="p-3 rounded-md bg-gray-700 text-sm flex justify-between items-center">
<span class="text-gray-50">Total portfolio</span>
<span class="font-bold text-2xl text-white">
$596,275
</span>
</div>
<div class="space-y-1">
<div class="p-3 -md text-sm flex justify-between items-center">
<span class="text-white">Schwab</span>
<span class="text-white font-medium tracking-tight">
$36,418
</span>
</div>
<div class="p-3 -md text-sm flex justify-between items-center">
<span class="text-white">Robinhood</span>
<span class="text-white font-medium tracking-tight">
$36,418
</span>
</div>
<div class="p-3 -md text-sm flex justify-between items-center">
<span class="text-white">Crypto</span>
<span class="text-white font-medium tracking-tight">
$36,418
</span>
</div>
<%= link_to new_portfolio_path, class: "text-sm flex items-center space-x-3 text-gray-100 hover:text-gray-50 py-3" do %>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
</svg>
<span>New portfolio</span>
<% end %>
</div>
</div>