Feat: Adds multi currency support (#88)
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
@props([
|
||||
'sidebar' => null,
|
||||
'content' => null,
|
||||
'footer' => null,
|
||||
'fullWidth' => false,
|
||||
'withNav' => false,
|
||||
'collapseText' => 'Collapse',
|
||||
'collapseIcon' => 'o-bars-3-bottom-right',
|
||||
'collapsible' => false,
|
||||
'url' => route('mary.toogle-sidebar', absolute: false),
|
||||
])
|
||||
|
||||
<main class="{{ !$fullWidth ? 'max-w-screen-2xl' : '' }} w-full mx-auto">
|
||||
<div class="drawer {{ $sidebar?->attributes['right'] ? 'drawer-end' : '' }} lg:drawer-open">
|
||||
<input id="{{ $sidebar?->attributes['drawer'] }}" type="checkbox" class="drawer-toggle" />
|
||||
|
||||
<div {{ $content->attributes->class(["drawer-content w-full mx-auto p-5 lg:px-10 lg:py-5"]) }}>
|
||||
{{-- MAIN CONTENT --}}
|
||||
{{ $content }}
|
||||
</div>
|
||||
|
||||
{{-- SIDEBAR --}}
|
||||
@if($sidebar)
|
||||
<div
|
||||
x-data="{
|
||||
collapsed: {{ session('mary-sidebar-collapsed', 'false') }},
|
||||
collapseText: '{{ $collapseText }}',
|
||||
toggle() {
|
||||
this.collapsed = !this.collapsed;
|
||||
fetch('{{ $url }}?collapsed=' + this.collapsed);
|
||||
this.$dispatch('sidebar-toggled', this.collapsed);
|
||||
}
|
||||
}"
|
||||
@menu-sub-clicked="if(collapsed) { toggle() }"
|
||||
@class(["drawer-side z-20 lg:z-auto", "top-0 lg:top-[73px] lg:h-[calc(100vh-73px)]" => $withNav])
|
||||
>
|
||||
<label for="{{ $sidebar?->attributes['drawer'] }}" aria-label="close sidebar" class="drawer-overlay"></label>
|
||||
{{-- SIDEBAR CONTENT --}}
|
||||
<div>
|
||||
|
||||
{{ $sidebar }}
|
||||
|
||||
{{-- SIDEBAR COLLAPSE --}}
|
||||
@if($sidebar->attributes['collapsible'])
|
||||
<x-mary-menu class="hidden !bg-inherit lg:block">
|
||||
<x-mary-menu-item
|
||||
@click="toggle"
|
||||
icon="{{ $sidebar->attributes['collapse-icon'] ?? $collapseIcon }}"
|
||||
title="{{ $sidebar->attributes['collapse-text'] ?? $collapseText }}" />
|
||||
</x-mary-menu>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
{{-- END SIDEBAR--}}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{{-- FOOTER --}}
|
||||
@if($footer)
|
||||
<footer {{ $footer?->attributes->class(["mx-auto w-full", "max-w-screen-2xl" => !$fullWidth ]) }}>
|
||||
{{ $footer }}
|
||||
</footer>
|
||||
@endif
|
||||
@@ -1,4 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Livewire\Volt\Component;
|
||||
|
||||
new class extends Component
|
||||
{
|
||||
// props
|
||||
|
||||
/**
|
||||
* The component's listeners.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $listeners = [
|
||||
'refresh-navigation-menu' => '$refresh',
|
||||
];
|
||||
|
||||
// methods
|
||||
|
||||
}; ?>
|
||||
<div class="bg-base-100 border-base-300 border-b sticky top-0 z-10">
|
||||
<div class="flex justify-between items-center px-7 py-3 gap-4 mx-auto">
|
||||
<div class="flex flex-0 items-center">
|
||||
|
||||
@@ -1,54 +1,94 @@
|
||||
<x-menu activate-by-route>
|
||||
<?php
|
||||
|
||||
<x-menu-item title="{{ __('Dashboard') }}" icon="o-home" link="{{ route('dashboard') }}" />
|
||||
<x-menu-sub title="{{ __('Portfolios') }}" icon="o-document-duplicate">
|
||||
@foreach (auth()->user()->portfolios as $portfolio)
|
||||
<x-menu-item icon="o-document" link="{{ route('portfolio.show', ['portfolio' => $portfolio->id ]) }}" >
|
||||
<x-slot:title>
|
||||
{{ $portfolio->title }}
|
||||
@if($portfolio->wishlist)
|
||||
<x-badge value="{{ __('Wishlist') }}" class="badge-secondary badge-sm ml-2" />
|
||||
@endif
|
||||
</x-slot:title>
|
||||
|
||||
</x-menu-item>
|
||||
@endforeach
|
||||
use Livewire\Volt\Component;
|
||||
|
||||
<x-menu-item title="{{ __('Create Portfolio') }}" icon="o-document-plus" link="{{ route('portfolio.create') }}" />
|
||||
</x-menu-sub>
|
||||
<x-menu-item title="{{ __('Transactions') }}" icon="o-banknotes" link="{{ route('transaction.index') }}" />
|
||||
{{-- <x-menu-item title="{{ __('Reporting') }}" icon="o-chart-bar-square" link="####" /> --}}
|
||||
new class extends Component
|
||||
{
|
||||
// props
|
||||
|
||||
</x-menu>
|
||||
/**
|
||||
* The component's listeners.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $listeners = [
|
||||
'refresh-navigation-menu' => '$refresh',
|
||||
];
|
||||
|
||||
</div>
|
||||
<div class="px-3">
|
||||
// methods
|
||||
|
||||
<x-section-border />
|
||||
}; ?>
|
||||
|
||||
@php
|
||||
$user = auth()->user();
|
||||
@endphp
|
||||
<div class="
|
||||
flex
|
||||
flex-col
|
||||
!transition-all
|
||||
!duration-100
|
||||
ease-out
|
||||
overflow-x-hidden
|
||||
overflow-y-auto
|
||||
h-screen
|
||||
lg:h-[calc(100vh-73px)]
|
||||
bg-base-100
|
||||
lg:bg-inherit
|
||||
{{ session('mary-sidebar-collapsed') == 'true' ? 'w-[70px] [&>*_summary::after]:hidden [&_.mary-hideable]:hidden [&_.display-when-collapsed]:block [&_.hidden-when-collapsed]:hidden' : null }}
|
||||
{{ session('mary-sidebar-collapsed') != 'true' ? 'w-[270px] [&>*_summary::after]:block [&_.mary-hideable]:block [&_.hidden-when-collapsed]:block [&_.display-when-collapsed]:hidden' : null }}
|
||||
">
|
||||
<div class="flex-1">
|
||||
<x-menu activate-by-route>
|
||||
|
||||
<x-list-item :item="$user" avatar="profile_photo_url" value="name" sub-value="email" no-separator no-hover class="mb-3 !-mt-3 rounded">
|
||||
<x-slot:actions>
|
||||
<x-dropdown>
|
||||
<x-slot:trigger>
|
||||
<x-button icon="o-cog-6-tooth" class="btn-circle btn-ghost btn-xs" />
|
||||
</x-slot:trigger>
|
||||
|
||||
<x-menu-item title="{{ __('Manage Profile') }}" icon="o-user" link="{{ @route('profile.show') }}" />
|
||||
<x-menu-item title="{{ __('API Tokens') }}" icon="o-command-line" link="{{ @route('api-tokens.index') }}" />
|
||||
<x-menu-item title="{{ __('Import / Export Data') }}" icon="o-cloud-arrow-down" link="{{ @route('import-export') }}" />
|
||||
<x-menu-item title="{{ __('Dashboard') }}" icon="o-home" link="{{ route('dashboard') }}" />
|
||||
<x-menu-sub title="{{ __('Portfolios') }}" icon="o-document-duplicate">
|
||||
@foreach (auth()->user()->portfolios as $portfolio)
|
||||
<x-menu-item icon="o-document" link="{{ route('portfolio.show', ['portfolio' => $portfolio->id ]) }}" >
|
||||
<x-slot:title>
|
||||
{{ $portfolio->title }}
|
||||
@if($portfolio->wishlist)
|
||||
<x-badge value="{{ __('Wishlist') }}" class="badge-secondary badge-sm ml-2" />
|
||||
@endif
|
||||
</x-slot:title>
|
||||
|
||||
</x-menu-item>
|
||||
@endforeach
|
||||
|
||||
<x-section-border class="py-1" />
|
||||
<x-menu-item title="{{ __('Create Portfolio') }}" icon="o-document-plus" link="{{ route('portfolio.create') }}" />
|
||||
</x-menu-sub>
|
||||
<x-menu-item title="{{ __('Transactions') }}" icon="o-banknotes" link="{{ route('transaction.index') }}" />
|
||||
{{-- <x-menu-item title="{{ __('Reporting') }}" icon="o-chart-bar-square" link="####" /> --}}
|
||||
|
||||
<x-menu-item title="{{ __('Log Out') }}" icon="o-power" onclick="event.preventDefault(); document.getElementById('logout').submit();" />
|
||||
<form id="logout" action="{{ route('logout') }}" method="POST" style="display: none;">
|
||||
{{ csrf_field() }}
|
||||
</form>
|
||||
</x-menu>
|
||||
|
||||
</x-dropdown>
|
||||
|
||||
</x-slot:actions>
|
||||
</x-list-item>
|
||||
</div>
|
||||
|
||||
<div class="px-3">
|
||||
|
||||
<x-section-border />
|
||||
|
||||
@php
|
||||
$user = auth()->user();
|
||||
@endphp
|
||||
|
||||
<x-list-item :item="$user" avatar="profile_photo_url" value="name" sub-value="email" no-separator no-hover class="mb-3 !-mt-3 rounded">
|
||||
<x-slot:actions>
|
||||
<x-dropdown>
|
||||
<x-slot:trigger>
|
||||
<x-button icon="o-cog-6-tooth" class="btn-circle btn-ghost btn-xs" />
|
||||
</x-slot:trigger>
|
||||
|
||||
<x-menu-item title="{{ __('Manage Profile') }}" icon="o-user" link="{{ @route('profile.show') }}" />
|
||||
<x-menu-item title="{{ __('API Tokens') }}" icon="o-command-line" link="{{ @route('api-tokens.index') }}" />
|
||||
<x-menu-item title="{{ __('Import / Export Data') }}" icon="o-cloud-arrow-down" link="{{ @route('import-export') }}" />
|
||||
|
||||
<x-section-border class="py-1" />
|
||||
|
||||
<x-menu-item title="{{ __('Log Out') }}" icon="o-power" onclick="event.preventDefault(); document.getElementById('logout').submit();" />
|
||||
<form id="logout" action="{{ route('logout') }}" method="POST" style="display: none;">
|
||||
{{ csrf_field() }}
|
||||
</form>
|
||||
|
||||
</x-dropdown>
|
||||
|
||||
</x-slot:actions>
|
||||
</x-list-item>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user