Skip to content

Commit

Permalink
Removed template / reduced overrides (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roene-JustBetter authored Mar 13, 2024
1 parent 7840b65 commit 9f4841b
Show file tree
Hide file tree
Showing 15 changed files with 104 additions and 211 deletions.
37 changes: 0 additions & 37 deletions resources/views/checkout/overview.blade.php

This file was deleted.

21 changes: 1 addition & 20 deletions resources/views/checkout/partials/address-cards-popup.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,7 @@
<label class="absolute cursor-pointer top-7 right-7 w-5 h-5" for="popup">
<x-heroicon-o-x-mark/>
</label>

<div class="grid sm:grid-cols-2 gap-5">
<template v-for="userAddress in $root.user.addresses">
<x-rapidez-ct::card.address
v-bind:key="userAddress.id"
v-bind:address="userAddress"
v-bind:billing="isType('billing', userAddress)"
v-bind:shipping="isType('shipping', userAddress)"
check="isType('billing', userAddress) || isType('shipping', userAddress)"
class="w-full sm:min-w-[350px]"
>
<x-rapidez-ct::button.link v-if="!isType('shipping', userAddress)" v-on:click.prevent="select('shipping', userAddress)">
@lang('Select as shipping')
</x-rapidez-ct::button.link>
<x-rapidez-ct::button.link v-if="!isType('billing', userAddress)" v-on:click.prevent="select('billing', userAddress)">
@lang('Select as billing')
</x-rapidez-ct::button.link>
</x-rapidez-ct::card.address>
</template>
</div>
@include('rapidez-ct::checkout.partials.address-card')
</x-rapidez-ct::card.inactive>
</x-rapidez-ct::sections>
<label class="absolute cursor-pointer inset-0 bg-ct-neutral/60" for="popup"></label>
Expand Down
41 changes: 0 additions & 41 deletions resources/views/checkout/partials/address-cards.blade.php

This file was deleted.

8 changes: 8 additions & 0 deletions resources/views/checkout/partials/buttons/address.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="flex flex-wrap items-center gap-3 mt-5">
<x-rapidez-ct::button.inactive v-on:click.prevent="toggleEdit">
@lang('Use a new address')
</x-rapidez-ct::button.inactive>
<x-rapidez-ct::button.inactive tag="label" for="popup" class="cursor-pointer" v-if="$root.user.addresses.length">
@lang('My addresses')
</x-rapidez-ct::button.inactive>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<button v-on:click.prevent="toggleEdit" class="flex flex-col items-center justify-center gap-y-2 text-inactive font-medium bg-ct-inactive-100 rounded-xl max-sm:hidden">
<span>+</span>
<span>@lang('Add new address')</span>
</button>
23 changes: 23 additions & 0 deletions resources/views/checkout/partials/layout.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template v-if="checkout.step !== 4">
<x-rapidez-ct::layout.checkout>
<x-slot:header>
@include('rapidez-ct::checkout.partials.header')
</x-slot:header>

<template v-if="checkout.step == 2 && hasItems">
@include('rapidez-ct::checkout.steps.credentials')
</template>

<template v-if="checkout.step == 3">
@include('rapidez-ct::checkout.steps.payment')
</template>

<x-slot:sidebar>
@include('rapidez-ct::checkout.partials.sidebar.sidebar')
</x-slot:sidebar>
</x-rapidez-ct::layout.checkout>
</template>

<template v-if="checkout.step == 4">
@include('rapidez-ct::checkout.steps.success')
</template>
21 changes: 0 additions & 21 deletions resources/views/checkout/partials/sections/address.blade.php

This file was deleted.

55 changes: 0 additions & 55 deletions resources/views/checkout/partials/sections/login.blade.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<x-rapidez-ct::input
name="email"
type="email"
label="Email"
v-bind:value="email"
v-on:input="loginInputChange"
v-on:blur="$root.guestEmail = email; if(!password) { go() }"
class="justify-center"
required
:placeholder="__('Enter your e-mail address')"
/>

<x-rapidez-ct::input
name="password"
type="password"
v-if="!emailAvailable"
label="Password"
ref="password"
v-on:input="loginInputChange"
required
/>

<p v-if="!emailAvailable" class="self-end text-ct-inactive">
@lang('You already have an account with this e-mail address. Please log in to continue.')
</p>
<p v-else class="self-end text-ct-inactive">
@lang('We will send your order confirmation to this e-mail address. We will also check if you already have an account so you can checkout more efficiently.')
</p>
<x-rapidez-ct::button.primary v-if="!emailAvailable" v-on:click.prevent="go" dusk="continue">
@lang('Login')
</x-rapidez-ct::button.primary>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<x-rapidez-ct::input.radio
name="payment_method"
class="!py-7"
v-bind:value="method.code"
v-bind:dusk="'method-'+index"
v-model="checkout.payment_method"
Expand Down
26 changes: 1 addition & 25 deletions resources/views/checkout/partials/sections/shipping.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,5 @@
@lang('Shipping method')
</p>

<div v-for="(method, index in checkout.shipping_methods" class="mt-5 flex flex-col gap-2">
<x-rapidez-ct::input.radio
v-bind:value="method.carrier_code+'_'+method.method_code"
v-bind:dusk="'method-'+index"
v-model="checkout.shipping_method"
name="shipping_method"
class="!py-4"
required
>
<div class="flex flex-col sm:w-3/5">
<span class="text-ct-neutral font-medium text-base">@{{ method.carrier_title }}</span>
<span class="text-ct-inactive text-sm">@{{ method.method_title }}</span>
</div>
<div class="text-right text-sm font-medium">
<img
width="32"
height="32"
class="max-h-8"
v-bind:alt="method.carrier_title"
v-bind:src="`/vendor/shipping-icons/${method.carrier_title}.svg`"
onerror="this.onerror=null; this.src='/vendor/shipping-icons/envelope.svg'"
/>
</div>
</x-rapidez-ct::input.radio>
</div>
@include('rapidez-ct::checkout.partials.shipping.methods')
</x-rapidez-ct::card.inactive>
25 changes: 25 additions & 0 deletions resources/views/checkout/partials/shipping/methods.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div v-for="(method, index) in checkout.shipping_methods" class="mt-5 flex flex-col gap-2">
<x-rapidez-ct::input.radio
v-bind:value="method.carrier_code+'_'+method.method_code"
v-bind:dusk="'method-'+index"
v-model="checkout.shipping_method"
name="shipping_method"
class="!py-4"
required
>
<div class="flex flex-col sm:w-3/5">
<span class="text-ct-neutral font-medium text-base">@{{ method.carrier_title }}</span>
<span class="text-ct-inactive text-sm">@{{ method.method_title }}</span>
</div>
<div class="text-right text-sm font-medium">
<img
width="32"
height="32"
class="max-h-8"
v-bind:alt="method.carrier_title"
v-bind:src="`/vendor/shipping-icons/${method.carrier_title}.svg`"
onerror="this.onerror=null; this.src='/vendor/shipping-icons/envelope.svg'"
/>
</div>
</x-rapidez-ct::input.radio>
</div>
9 changes: 6 additions & 3 deletions resources/views/checkout/steps/credentials.blade.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<x-rapidez-ct::title-progress-bar :href="route('cart')">
<x-rapidez-ct::title-progress-bar>
@lang('Credentials')
</x-rapidez-ct::title-progress-bar>

<form id="credentials" v-on:submit.prevent="save(['credentials'], 3)">
<x-rapidez-ct::sections>
@include('rapidez-ct::checkout.partials.sections.login')
@include('rapidez-ct::checkout.partials.sections.address')
@include('rapidez-ct::checkout.partials.sections.newsletter')
@include('rapidez-ct::checkout.partials.sections.shipping')
</x-rapidez-ct::sections>
</form>

<x-rapidez-ct::toolbar>
<x-rapidez-ct::button.outline :href="route('cart')" class="flex justify-center items-center !p-0 w-12 h-12 max-md:hidden">
<x-heroicon-o-arrow-long-left class="w-6 h-6"/>
</x-rapidez-ct::button.outline>
<x-rapidez-ct::button.enhanced form="credentials" class="w-full md:w-1/2" loader>

<x-rapidez-ct::button.enhanced class="relative w-full md:w-1/2" form="credentials" loader>
@lang('Continue')
</x-rapidez-ct::button.enhanced>
</x-rapidez-ct::toolbar>
</x-rapidez-ct::toolbar>
11 changes: 3 additions & 8 deletions resources/views/checkout/steps/payment.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-rapidez-ct::title-progress-bar href="#" v-on:click.prevent="goToStep(1)">
<x-rapidez-ct::title-progress-bar>
@lang('Payment')
</x-rapidez-ct::title-progress-bar>

Expand All @@ -10,13 +10,8 @@
<x-rapidez-ct::button.outline v-on:click.prevent="goToStep(1)" class="flex justify-center items-center !p-0 w-12 h-12 max-md:hidden">
<x-heroicon-o-arrow-long-left class="w-6 h-6"/>
</x-rapidez-ct::button.outline>
<x-rapidez-ct::button.enhanced
class="relative w-full md:w-1/2"
form="payment"
type="submit"
dusk="continue"
loader
>

<x-rapidez-ct::button.enhanced class="relative w-full md:w-1/2" form="payment" type="submit" dusk="continue" loader>
@lang('Place order')
</x-rapidez-ct::button.enhanced>
</x-rapidez-ct::toolbar>
2 changes: 1 addition & 1 deletion resources/views/components/input/radio.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<label {{ $attributes->only('class')->class('relative flex w-full cursor-pointer items-center justify-start gap-x-3 rounded-xl px-5 sm:px-7 py-7 text-ct-neutral') }}>
<label {{ $attributes->only('class')->class('relative flex w-full cursor-pointer items-center justify-start gap-x-3 rounded-xl px-5 sm:px-7 py-4 text-ct-neutral') }}>
<span class="flex aspect-square h-6 w-6 items-center justify-center rounded-full border bg-white">
<input type="radio" {{ $attributes->except('class') }} class="peer h-3 w-3 border-none text-ct-primary transition checked:bg-none focus:ring-0 focus:ring-offset-0" />
<span class="overflow-hidden rounded-xl -z-10 absolute inset-0 bg-ct-inactive-100 peer-checked:border-y peer-checked:border-r peer-checked:bg-white peer-checked:shadow before:absolute before:-inset-y-px before:w-1 before:rounded-l before:bg-ct-primary before:opacity-0 before:transition-all before:peer-checked:opacity-100"></span>
Expand Down

0 comments on commit 9f4841b

Please sign in to comment.