Skip to content

Commit

Permalink
Csutomers feature (#244)
Browse files Browse the repository at this point in the history
* Update heading components

* Customers - update feature with filament form and table

* fix code formatting

* Fix logout issue

---------

Co-authored-by: mckenziearts <[email protected]>
  • Loading branch information
mckenziearts and mckenziearts authored Mar 30, 2024
1 parent 4fa23d0 commit 57f5331
Show file tree
Hide file tree
Showing 72 changed files with 899 additions and 1,381 deletions.
11 changes: 2 additions & 9 deletions packages/admin/config/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,13 @@

/*
|--------------------------------------------------------------------------
| Shopper Controllers config
| Shopper Inventory Limit
|--------------------------------------------------------------------------
|
| If you want extends your shopper admin panel with great features,
| Here you can specify custom Controller Namespace and Shopper
| RouteServiceProvider will load all your controllers.
|
*/

'controllers' => [

'namespace' => 'App\\Http\\Controllers\\Shopper',

],
'inventory-limit' => 4,

/*
|--------------------------------------------------------------------------
Expand Down
9 changes: 5 additions & 4 deletions packages/admin/config/components/customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
|--------------------------------------------------------------------------
*/

'pages' => [],
'pages' => [
'customer-index' => Livewire\Pages\Customers\Index::class,
'customer-create' => Livewire\Pages\Customers\Create::class,
'customer-show' => Livewire\Pages\Customers\Show::class,
],

/*
|--------------------------------------------------------------------------
Expand All @@ -23,11 +27,8 @@

'components' => [
'customers.addresses' => Components\Customers\Addresses::class,
'customers.browse' => Components\Customers\Browse::class,
'customers.create' => Components\Customers\Create::class,
'customers.orders' => Components\Customers\Orders::class,
'customers.profile' => Components\Customers\Profile::class,
'customers.show' => Components\Customers\Show::class,

'modals.delete-customer' => Livewire\Modals\DeleteCustomer::class,
],
Expand Down
99 changes: 56 additions & 43 deletions packages/admin/public/shopper.css
Original file line number Diff line number Diff line change
Expand Up @@ -3828,6 +3828,11 @@ html {
margin-bottom: 1rem;
}

.my-6 {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
}

.my-8 {
margin-top: 2rem;
margin-bottom: 2rem;
Expand Down Expand Up @@ -3961,6 +3966,10 @@ html {
margin-left: 1.25rem;
}

.ml-6 {
margin-left: 1.5rem;
}

.ml-auto {
margin-left: auto;
}
Expand Down Expand Up @@ -4045,10 +4054,6 @@ html {
margin-top: auto;
}

.ml-6 {
margin-left: 1.5rem;
}

.line-clamp-\[--line-clamp\] {
overflow: hidden;
display: -webkit-box;
Expand Down Expand Up @@ -4385,6 +4390,10 @@ html {
width: 100vw;
}

.w-0\.5 {
width: 0.125rem;
}

.min-w-0 {
min-width: 0px;
}
Expand Down Expand Up @@ -5099,6 +5108,12 @@ html {
margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
}

.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(0.375rem * calc(1 - var(--tw-space-y-reverse)));
margin-bottom: calc(0.375rem * var(--tw-space-y-reverse));
}

.space-y-10 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(2.5rem * calc(1 - var(--tw-space-y-reverse)));
Expand Down Expand Up @@ -5159,12 +5174,6 @@ html {
margin-bottom: calc(2rem * var(--tw-space-y-reverse));
}

.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(0.375rem * calc(1 - var(--tw-space-y-reverse)));
margin-bottom: calc(0.375rem * var(--tw-space-y-reverse));
}

.divide-x > :not([hidden]) ~ :not([hidden]) {
--tw-divide-x-reverse: 0;
border-right-width: calc(1px * var(--tw-divide-x-reverse));
Expand Down Expand Up @@ -5889,6 +5898,14 @@ html {
fill: rgba(var(--gray-50), 1);
}

.fill-gray-400 {
fill: rgba(var(--gray-400), 1);
}

.fill-gray-300 {
fill: rgba(var(--gray-300), 1);
}

.stroke-gray-200 {
stroke: rgba(var(--gray-200), 1);
}
Expand Down Expand Up @@ -6675,6 +6692,16 @@ html {
color: rgba(var(--gray-500), var(--tw-placeholder-opacity));
}

.placeholder-gray-400::-moz-placeholder {
--tw-placeholder-opacity: 1;
color: rgba(var(--gray-400), var(--tw-placeholder-opacity));
}

.placeholder-gray-400::placeholder {
--tw-placeholder-opacity: 1;
color: rgba(var(--gray-400), var(--tw-placeholder-opacity));
}

.opacity-0 {
opacity: 0;
}
Expand Down Expand Up @@ -6799,6 +6826,11 @@ html {
--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity));
}

.ring-gray-100 {
--tw-ring-opacity: 1;
--tw-ring-color: rgba(var(--gray-100), var(--tw-ring-opacity));
}

.ring-gray-200 {
--tw-ring-opacity: 1;
--tw-ring-color: rgba(var(--gray-200), var(--tw-ring-opacity));
Expand Down Expand Up @@ -8879,11 +8911,6 @@ input[type='number'] {
color: rgb(37 99 235 / var(--tw-text-opacity));
}

.hover\:text-primary-700:hover {
--tw-text-opacity: 1;
color: rgb(29 78 216 / var(--tw-text-opacity));
}

.hover\:text-primary-800:hover {
--tw-text-opacity: 1;
color: rgb(30 64 175 / var(--tw-text-opacity));
Expand Down Expand Up @@ -9530,6 +9557,14 @@ input[type='number'] {
fill: rgba(var(--gray-900), 1);
}

:is(.dark .dark\:fill-gray-700) {
fill: rgba(var(--gray-700), 1);
}

:is(.dark .dark\:fill-gray-500) {
fill: rgba(var(--gray-500), 1);
}

:is(.dark .dark\:stroke-gray-900) {
stroke: rgba(var(--gray-900), 1);
}
Expand Down Expand Up @@ -9592,10 +9627,6 @@ input[type='number'] {
color: rgb(74 222 128 / var(--tw-text-opacity));
}

:is(.dark .dark\:text-green-500\/50) {
color: rgb(34 197 94 / 0.5);
}

:is(.dark .dark\:text-primary-400) {
--tw-text-opacity: 1;
color: rgb(96 165 250 / var(--tw-text-opacity));
Expand Down Expand Up @@ -10312,6 +10343,12 @@ input[type='number'] {
margin-bottom: calc(0px * var(--tw-space-y-reverse));
}

.sm\:space-x-2 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(0.5rem * var(--tw-space-x-reverse));
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}

.sm\:truncate {
overflow: hidden;
text-overflow: ellipsis;
Expand Down Expand Up @@ -10523,10 +10560,6 @@ input[type='number'] {
display: block;
}

.md\:flex {
display: flex;
}

.md\:table-cell {
display: table-cell;
}
Expand Down Expand Up @@ -10589,10 +10622,6 @@ input[type='number'] {
grid-template-columns: repeat(3, minmax(0, 1fr));
}

.md\:grid-cols-4 {
grid-template-columns: repeat(4, minmax(0, 1fr));
}

.md\:grid-cols-\[--cols-md\] {
grid-template-columns: var(--cols-md);
}
Expand All @@ -10617,10 +10646,6 @@ input[type='number'] {
justify-content: flex-end;
}

.md\:justify-between {
justify-content: space-between;
}

.md\:gap-1 {
gap: 0.25rem;
}
Expand All @@ -10638,18 +10663,6 @@ input[type='number'] {
row-gap: 1.5rem;
}

.md\:space-x-4 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(1rem * var(--tw-space-x-reverse));
margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}

.md\:space-y-0 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse)));
margin-bottom: calc(0px * var(--tw-space-y-reverse));
}

.md\:divide-y-0 > :not([hidden]) ~ :not([hidden]) {
--tw-divide-y-reverse: 0;
border-top-width: calc(0px * calc(1 - var(--tw-divide-y-reverse)));
Expand Down
1 change: 1 addition & 0 deletions packages/admin/resources/lang/en/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
'disabled' => 'Disabled',
'disable' => 'Disable',
'edit' => 'Edit',
'view' => 'View',
'enable' => 'Enable',
'enabled' => 'Enabled',
'export' => 'Export',
Expand Down
1 change: 1 addition & 0 deletions packages/admin/resources/lang/fr/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
'disable' => 'Désactiver',
'disabled' => 'Désactivé',
'edit' => 'Éditer',
'view' => 'Voir',
'enable' => 'Activer',
'enabled' => 'Activé',
'export' => 'Exportez',
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/resources/views/components/badge.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
};
@endphp

<span class="inline-flex px-2 text-xs leading-5 font-semibold rounded-full {{ $style }}">
<span class="inline-flex px-2 py-0.5 text-xs leading-5 font-medium rounded-full {{ $style }}">
{{ $value }}
</span>
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
@isset($link)
<a
<x-shopper::link
href="{{ $link }}"
wire:navigate
{{ $attributes->twMerge(['class' => 'inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-lg shadow-sm text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-gray-900 focus:ring-primary-500']) }}
>
{{ $slot }}
</a>
</x-shopper::link>
@else
<button {{ $attributes->twMerge(['class' => 'inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-lg shadow-sm text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-gray-900 focus:ring-primary-500']) }}>
{{ $slot }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<a {{ $attributes->twMerge(['class' => 'group flex items-center px-4 py-2 text-sm leading-5 text-gray-700 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white transition duration-150 ease-in-out']) }} wire:navigate>
<x-shopper::link {{ $attributes->twMerge(['class' => 'group flex items-center px-4 py-2 text-sm leading-5 text-gray-700 hover:text-gray-900 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white transition duration-150 ease-in-out']) }}>
{{ $slot }}
</a>
</x-shopper::link>
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@ class="absolute z-50 top-10 right-2.5 w-56 origin-top-right rounded-lg bg-white
<div class="py-1.5 px-1">
<x-shopper::theme-switcher />
</div>
<div class="py-1.5" role="none">
<x-shopper::dropdown-link
:href="route('shopper.logout')"
onclick="event.preventDefault(); document.getElementById('logout-form').submit();"
>
{{ __('shopper::layout.account_dropdown.sign_out') }}
</x-shopper::dropdown-link>
<form id="logout-form" action="{{ route('shopper.logout') }}" method="POST" style="display: none;">
<div class="py-1.5 px-1" role="none">
<form id="logout-form" action="{{ route('shopper.logout') }}" method="POST">
@csrf
<button
type="submit"
class="group w-full flex items-center px-4 py-2 text-sm leading-5 rounded-lg text-gray-700 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-white/5"
>
<x-untitledui-log-out class="mr-2 h-5 w-5 text-gray-400 dark:group-hover:text-gray-500" />
{{ __('shopper::layout.account_dropdown.sign_out') }}
</button>
</form>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<span class="absolute inset-0" aria-hidden="true"></span>
<div class="flex items-center justify-between space-x-2">
<span class="inline-flex text-xs leading-4 text-gray-500 dark:text-gray-400">
{{ $address->type === 'shipping' ? __('shopper::pages/customers.addresses.shipping') : __('shopper::pages/customers.addresses.billing') }}
{{ $address->type === \Shopper\Core\Enum\AddressType::SHIPPING
? __('shopper::pages/customers.addresses.shipping')
: __('shopper::pages/customers.addresses.billing') }}
</span>
@if($address->is_default)
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
Expand Down
Loading

0 comments on commit 57f5331

Please sign in to comment.