158 lines
7.8 KiB
PHP
158 lines
7.8 KiB
PHP
<x-layout title="Profile">
|
|
<x-dashboard.page-heading
|
|
title="Your Profile"
|
|
description="Your public information"
|
|
:back-link="route('explore')"
|
|
>
|
|
<x-slot:end>
|
|
<div class="flex">
|
|
<x-ui.button :link="route('customer.profile.edit', auth()->user()->id)"
|
|
class="border border-accent-600/40">
|
|
<p class="hidden sm:block">Edit profile</p>
|
|
<x-heroicon-o-pencil-square class="w-4 stroke-2 sm:hidden"/>
|
|
</x-ui.button>
|
|
</div>
|
|
</x-slot:end>
|
|
</x-dashboard.page-heading>
|
|
|
|
@session('error')
|
|
<div class="m-4">
|
|
<x-ui.alert variant="error">
|
|
{{$value}}
|
|
</x-ui.alert>
|
|
</div>
|
|
@endsession
|
|
|
|
@session('success')
|
|
<div class="m-8">
|
|
<x-ui.alert variant="success">
|
|
{{$value}}
|
|
</x-ui.alert>
|
|
</div>
|
|
@endsession
|
|
|
|
<div class="flex flex-col space-y-8 items-center justify-center mt-4 md:mt-8 px-4 pb-4 pt-0 md:px-8 md:pb-8">
|
|
<div class="flex items-center justify-center w-full">
|
|
<x-dashboard.card class="w-full">
|
|
<div class="grid grid-cols-8 gap-6">
|
|
|
|
<div
|
|
class="col-span-8 place-self-start md:col-span-2 lg:col-span-1 flex items-center justify-center w-full">
|
|
<div
|
|
class="w-25 h-25 rounded-xl bg-linear-150 from-[#305afc] to-[#941dfb] text-5xl text-white flex justify-center items-center">
|
|
{{$initials}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-span-8 md:col-span-6 lg:col-span-7 flex flex-col space-y-6">
|
|
|
|
<div class="">
|
|
<p class="text-3xl font-bold">{{$name ?? 'Name'}}</p>
|
|
</div>
|
|
|
|
<div class="wrap-break-word">
|
|
<p>{{$bio ?? 'Bio is empty'}}</p>
|
|
</div>
|
|
|
|
<div class="grid md:grid-cols-2 md:grid-rows-2 gap-3">
|
|
<div class="fill-accent-600/70 text-accent-600/70 flex space-x-4 text-sm items-center">
|
|
<x-heroicon-o-envelope class="w-4"/>
|
|
<p>{{$email ?? 'email is empty'}}</p>
|
|
</div>
|
|
<div class="fill-accent-600/70 text-accent-600/70 flex space-x-4 text-sm items-center">
|
|
<x-heroicon-o-phone class="w-4"/>
|
|
<p>{{$phone ?? 'phone is empty'}}</p>
|
|
</div>
|
|
<div class="fill-accent-600/70 text-accent-600/70 flex space-x-4 text-sm items-center">
|
|
<x-heroicon-o-map class="w-4"/>
|
|
<p>{{$location ?? 'location is empty'}}</p>
|
|
</div>
|
|
<div class="fill-accent-600/70 text-accent-600/70 flex space-x-4 text-sm items-center">
|
|
<x-heroicon-o-arrow-trending-up class="w-4"/>
|
|
<p>Joined {{$joinDate ?? 'date is empty'}}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-dashboard.card>
|
|
</div>
|
|
<x-ui.tab class="self-start w-full">
|
|
<x-slot:buttons>
|
|
<x-ui.tab.button :active="true" data-target="favorites">
|
|
<div class="flex items-center cursor-default px-2 py-1 space-x-2">
|
|
<x-heroicon-o-heart class="w-4 stroke-2"/>
|
|
<p class="font-bold text-xs sm:text-sm md:text-md">Favorites</p>
|
|
</div>
|
|
</x-ui.tab.button>
|
|
<x-ui.tab.button data-target="reports">
|
|
<div class="flex items-center cursor-default px-2 py-1 space-x-2">
|
|
<x-heroicon-o-exclamation-triangle class="w-4 stroke-2"/>
|
|
<p class="font-bold text-xs sm:text-sm md:text-md">Reported Deals</p>
|
|
</div>
|
|
</x-ui.tab.button>
|
|
</x-slot:buttons>
|
|
|
|
<x-ui.tab.content data-show data-tab="favorites" class="w-full">
|
|
<x-dashboard.card class="bg-white mt-8">
|
|
<p class="font-bold mb-6">Your favorite deals</p>
|
|
<x-ui.table>
|
|
<x-ui.table.head>
|
|
<th colspan="2" class="pb-2">Deals</th>
|
|
</x-ui.table.head>
|
|
@forelse($favorites as $deal)
|
|
<x-ui.table.row>
|
|
<td class="text-sm px-4">{{$deal->title}}</td>
|
|
<x-slot:actions>
|
|
<div class="flex items-center justify-center space-x-1 md:space-x-4 py-1 px-2">
|
|
<x-ui.button-sm link="{{route('explore', ['show' => $deal->id])}}" variant="ghost">
|
|
<x-heroicon-o-eye class="w-4"/>
|
|
</x-ui.button-sm>
|
|
<form action="{{route('favorite', $deal->id)}}"
|
|
onsubmit="return confirm('Are you sure to delete this ?')" method="post"
|
|
class=" h-full items-center flex justify-center">
|
|
@csrf
|
|
<x-ui.button-sm variant="red">
|
|
<x-heroicon-o-trash class="w-4"/>
|
|
</x-ui.button-sm>
|
|
</form>
|
|
</div>
|
|
</x-slot:actions>
|
|
</x-ui.table.row>
|
|
@empty
|
|
<x-ui.table.row>
|
|
<td colspan="2" class="text-center text-sm text-accent-600 py-2">No Deals found</td>
|
|
</x-ui.table.row>
|
|
@endforelse
|
|
</x-ui.table>
|
|
</x-dashboard.card>
|
|
</x-ui.tab.content>
|
|
<x-ui.tab.content data-tab="reports">
|
|
<x-dashboard.card class="bg-white mt-8">
|
|
<p class="font-bold mb-6">Your reported deals</p>
|
|
<x-ui.table>
|
|
<x-ui.table.head>
|
|
<th colspan="2" class="pb-2">Deals</th>
|
|
</x-ui.table.head>
|
|
@forelse($reported as $report)
|
|
<x-ui.table.row>
|
|
<td class="text-sm px-4">{{$report->deals->first()->title}}</td>
|
|
<x-slot:actions>
|
|
<div class="flex items-center justify-center py-1 px-2">
|
|
<x-ui.button-sm link="{{route('explore', ['show' => $report->deals->first()->id])}}" variant="ghost">
|
|
<x-heroicon-o-eye class="w-4"/>
|
|
</x-ui.button-sm>
|
|
</div>
|
|
</x-slot:actions>
|
|
</x-ui.table.row>
|
|
@empty
|
|
<x-ui.table.row>
|
|
<td colspan="2" class="text-center text-sm text-accent-600 py-2">No Deals found</td>
|
|
</x-ui.table.row>
|
|
@endforelse
|
|
</x-ui.table>
|
|
</x-dashboard.card>
|
|
</x-ui.tab.content>
|
|
</x-ui.tab>
|
|
</div>
|
|
</x-layout>
|