Skip to content

Commit

Permalink
Visual optimizations (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordythevulder authored May 28, 2024
1 parent 77fed71 commit 9fd2863
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ class="justify-center"
</p>
<x-rapidez-ct::button.accent v-if="!emailAvailable" v-on:click.prevent="go" dusk="continue">
@lang('Login')
</x-rapidez-ct::button.accent>
</x-rapidez-ct::button.accent>
18 changes: 18 additions & 0 deletions resources/views/components/button/base.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@props(['loader' => false, 'tag'])
<x-tag
is="{{ $tag ?? ($attributes->has('href') || $attributes->has('v-bind:href') ? 'a' : 'button') }}"
{{ $attributes->class([
'relative inline-block self-start text-center text-sm transition cursor-pointer',
'disabled:cursor-not-allowed disabled:opacity-70',
]) }}
v-bind:disabled="$root.loading"
>
@if($loader)
<div v-if="$root.loading" class="absolute left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2" v-cloak>
<x-heroicon-o-arrow-path class="h-5 w-5 animate-spin" />
</div>
@endif
<span class="contents" @attributes([':class' => $loader ? '{ "invisible": $root.loading }' : false])>
{{ $slot }}
</span>
</x-tag>
21 changes: 3 additions & 18 deletions resources/views/components/button/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
@props(['loader' => false, 'tag'])
<x-tag
is="{{ $tag ?? ($attributes->has('href') || $attributes->has('v-bind:href') ? 'a' : 'button') }}"
{{ $attributes->class([
'relative inline-block self-start rounded py-4 px-6 text-center text-sm transition cursor-pointer',
'disabled:cursor-not-allowed disabled:opacity-70',
]) }}
v-bind:disabled="$root.loading"
>
@if($loader)
<div v-if="$root.loading" class="absolute left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2" v-cloak>
<x-heroicon-o-arrow-path class="h-5 w-5 animate-spin" />
</div>
@endif
<span class="contents" @attributes([':class' => $loader ? '{ "invisible": $root.loading }' : false])>
{{ $slot }}
</span>
</x-tag>
<x-rapidez-ct::button.base {{ $attributes->class('py-4 px-6 rounded')) }}>
{{ $slot }}
</x-rapidez-ct::button.base>
2 changes: 1 addition & 1 deletion resources/views/components/button/outline.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<x-rapidez-ct::button {{ $attributes->merge(['class' => 'rounded border bg-white text-sm font-medium text-ct-primary']) }}>
<x-rapidez-ct::button {{ $attributes->merge(['class' => 'rounded border bg-white text-sm font-medium text-ct-neutral']) }}>
{{ $slot }}
</x-rapidez-ct::button>
2 changes: 1 addition & 1 deletion resources/views/components/input/quantity.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:error-callback="checkResponseForExpiredCart"
v-slot="{ mutate, variables }"
>
<form v-on:submit.prevent="mutate" class="flex w-20 overflow-hidden rounded border">
<form v-on:submit.prevent="mutate" class="flex w-20 overflow-hidden border rounded-full">
<button
class="flex-1 bg-ct-inactive-100 transition hover:bg-opacity-80"
v-on:click.prevent="variables.quantity <= (item.product.stock_item?.min_sale_qty || 1) ? variables.quantity = variables.quantity : variables.quantity = +variables.quantity - (item.product.stock_item?.qty_increments || 1);mutate()"
Expand Down

0 comments on commit 9fd2863

Please sign in to comment.