feat: delete quotes/fix mobile view/models

This commit is contained in:
Nicholas Ciechanowski 2023-10-08 20:37:18 +11:00
parent 94e719d5f3
commit 5d73183787
15 changed files with 226 additions and 138 deletions

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ yarn-error.log
/.phpstorm.meta.php /.phpstorm.meta.php
/_ide_helper.php /_ide_helper.php
/_ide_helper_models.php /_ide_helper_models.php
vite.config.js

View File

@ -12,11 +12,12 @@ class Quote extends Model
{ {
use SoftDeletes; use SoftDeletes;
public function request() public function request(): void
{ {
// Send the notification // Send the notification
// If success, add it to the transactions // If success, add it to the transactions
} }
protected $fillable = [ protected $fillable = [
'quote', 'quote',
]; ];

104
composer.lock generated
View File

@ -367,16 +367,16 @@
}, },
{ {
"name": "egulias/email-validator", "name": "egulias/email-validator",
"version": "4.0.1", "version": "4.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/egulias/EmailValidator.git", "url": "https://github.com/egulias/EmailValidator.git",
"reference": "3a85486b709bc384dae8eb78fb2eec649bdb64ff" "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/3a85486b709bc384dae8eb78fb2eec649bdb64ff", "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ebaaf5be6c0286928352e054f2d5125608e5405e",
"reference": "3a85486b709bc384dae8eb78fb2eec649bdb64ff", "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -385,8 +385,8 @@
"symfony/polyfill-intl-idn": "^1.26" "symfony/polyfill-intl-idn": "^1.26"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^9.5.27", "phpunit/phpunit": "^10.2",
"vimeo/psalm": "^4.30" "vimeo/psalm": "^5.12"
}, },
"suggest": { "suggest": {
"ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation"
@ -422,7 +422,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/egulias/EmailValidator/issues", "issues": "https://github.com/egulias/EmailValidator/issues",
"source": "https://github.com/egulias/EmailValidator/tree/4.0.1" "source": "https://github.com/egulias/EmailValidator/tree/4.0.2"
}, },
"funding": [ "funding": [
{ {
@ -430,7 +430,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-01-14T14:17:03+00:00" "time": "2023-10-06T06:47:41+00:00"
}, },
{ {
"name": "fruitcake/php-cors", "name": "fruitcake/php-cors",
@ -1612,16 +1612,16 @@
}, },
{ {
"name": "league/flysystem", "name": "league/flysystem",
"version": "3.16.0", "version": "3.17.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/flysystem.git", "url": "https://github.com/thephpleague/flysystem.git",
"reference": "4fdf372ca6b63c6e281b1c01a624349ccb757729" "reference": "bd4c9b26849d82364119c68429541f1631fba94b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4fdf372ca6b63c6e281b1c01a624349ccb757729", "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/bd4c9b26849d82364119c68429541f1631fba94b",
"reference": "4fdf372ca6b63c6e281b1c01a624349ccb757729", "reference": "bd4c9b26849d82364119c68429541f1631fba94b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1639,8 +1639,8 @@
"symfony/http-client": "<5.2" "symfony/http-client": "<5.2"
}, },
"require-dev": { "require-dev": {
"async-aws/s3": "^1.5", "async-aws/s3": "^1.5 || ^2.0",
"async-aws/simple-s3": "^1.1", "async-aws/simple-s3": "^1.1 || ^2.0",
"aws/aws-sdk-php": "^3.220.0", "aws/aws-sdk-php": "^3.220.0",
"composer/semver": "^3.0", "composer/semver": "^3.0",
"ext-fileinfo": "*", "ext-fileinfo": "*",
@ -1686,7 +1686,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/thephpleague/flysystem/issues", "issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/3.16.0" "source": "https://github.com/thephpleague/flysystem/tree/3.17.0"
}, },
"funding": [ "funding": [
{ {
@ -1698,7 +1698,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-09-07T19:22:17+00:00" "time": "2023-10-05T20:15:05+00:00"
}, },
{ {
"name": "league/flysystem-local", "name": "league/flysystem-local",
@ -2171,16 +2171,16 @@
}, },
{ {
"name": "nette/schema", "name": "nette/schema",
"version": "v1.2.4", "version": "v1.2.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nette/schema.git", "url": "https://github.com/nette/schema.git",
"reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab" "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nette/schema/zipball/c9ff517a53903b3d4e29ec547fb20feecb05b8ab", "url": "https://api.github.com/repos/nette/schema/zipball/0462f0166e823aad657c9224d0f849ecac1ba10a",
"reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab", "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2227,9 +2227,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nette/schema/issues", "issues": "https://github.com/nette/schema/issues",
"source": "https://github.com/nette/schema/tree/v1.2.4" "source": "https://github.com/nette/schema/tree/v1.2.5"
}, },
"time": "2023-08-05T18:56:25+00:00" "time": "2023-10-05T20:37:59+00:00"
}, },
{ {
"name": "nette/utils", "name": "nette/utils",
@ -5921,16 +5921,16 @@
}, },
{ {
"name": "brianium/paratest", "name": "brianium/paratest",
"version": "v7.2.8", "version": "v7.2.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/paratestphp/paratest.git", "url": "https://github.com/paratestphp/paratest.git",
"reference": "882b02d197328138686bb06ce7d8cbb98fc0a16c" "reference": "1f9e41c0779be4540654d92a9314016713f5e62c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/paratestphp/paratest/zipball/882b02d197328138686bb06ce7d8cbb98fc0a16c", "url": "https://api.github.com/repos/paratestphp/paratest/zipball/1f9e41c0779be4540654d92a9314016713f5e62c",
"reference": "882b02d197328138686bb06ce7d8cbb98fc0a16c", "reference": "1f9e41c0779be4540654d92a9314016713f5e62c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5938,13 +5938,13 @@
"ext-pcre": "*", "ext-pcre": "*",
"ext-reflection": "*", "ext-reflection": "*",
"ext-simplexml": "*", "ext-simplexml": "*",
"fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", "fidry/cpu-core-counter": "^0.5.1",
"jean85/pretty-package-versions": "^2.0.5", "jean85/pretty-package-versions": "^2.0.5",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0", "php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"phpunit/php-code-coverage": "^10.1.3", "phpunit/php-code-coverage": "^10.1.7",
"phpunit/php-file-iterator": "^4.0.2", "phpunit/php-file-iterator": "^4.1.0",
"phpunit/php-timer": "^6.0", "phpunit/php-timer": "^6.0",
"phpunit/phpunit": "^10.3.2", "phpunit/phpunit": "^10.4.0",
"sebastian/environment": "^6.0.1", "sebastian/environment": "^6.0.1",
"symfony/console": "^6.3.4", "symfony/console": "^6.3.4",
"symfony/process": "^6.3.4" "symfony/process": "^6.3.4"
@ -5953,8 +5953,8 @@
"doctrine/coding-standard": "^12.0.0", "doctrine/coding-standard": "^12.0.0",
"ext-pcov": "*", "ext-pcov": "*",
"ext-posix": "*", "ext-posix": "*",
"infection/infection": "^0.27.0", "infection/infection": "^0.27.3",
"phpstan/phpstan": "^1.10.32", "phpstan/phpstan": "^1.10.37",
"phpstan/phpstan-deprecation-rules": "^1.1.4", "phpstan/phpstan-deprecation-rules": "^1.1.4",
"phpstan/phpstan-phpunit": "^1.3.14", "phpstan/phpstan-phpunit": "^1.3.14",
"phpstan/phpstan-strict-rules": "^1.5.1", "phpstan/phpstan-strict-rules": "^1.5.1",
@ -6000,7 +6000,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/paratestphp/paratest/issues", "issues": "https://github.com/paratestphp/paratest/issues",
"source": "https://github.com/paratestphp/paratest/tree/v7.2.8" "source": "https://github.com/paratestphp/paratest/tree/v7.2.9"
}, },
"funding": [ "funding": [
{ {
@ -6012,7 +6012,7 @@
"type": "paypal" "type": "paypal"
} }
], ],
"time": "2023-10-04T13:38:04+00:00" "time": "2023-10-06T07:53:04+00:00"
}, },
{ {
"name": "composer/class-map-generator", "name": "composer/class-map-generator",
@ -7244,35 +7244,35 @@
}, },
{ {
"name": "pestphp/pest", "name": "pestphp/pest",
"version": "v2.20.0", "version": "v2.21.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pestphp/pest.git", "url": "https://github.com/pestphp/pest.git",
"reference": "a8b785f69e44ae3f902cbf08fe6b79359ba46945" "reference": "2ffafd445d42c8b7b7e1874bde1c29945767a49d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pestphp/pest/zipball/a8b785f69e44ae3f902cbf08fe6b79359ba46945", "url": "https://api.github.com/repos/pestphp/pest/zipball/2ffafd445d42c8b7b7e1874bde1c29945767a49d",
"reference": "a8b785f69e44ae3f902cbf08fe6b79359ba46945", "reference": "2ffafd445d42c8b7b7e1874bde1c29945767a49d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"brianium/paratest": "^7.2.7", "brianium/paratest": "^7.2.9",
"nunomaduro/collision": "^7.9.0", "nunomaduro/collision": "^7.9.0",
"nunomaduro/termwind": "^1.15.1", "nunomaduro/termwind": "^1.15.1",
"pestphp/pest-plugin": "^2.1.1", "pestphp/pest-plugin": "^2.1.1",
"pestphp/pest-plugin-arch": "^2.3.3", "pestphp/pest-plugin-arch": "^2.3.3",
"php": "^8.1.0", "php": "^8.1.0",
"phpunit/phpunit": "^10.3.5" "phpunit/phpunit": "^10.4.0"
}, },
"conflict": { "conflict": {
"phpunit/phpunit": ">10.3.5", "phpunit/phpunit": ">10.4.0",
"sebastian/exporter": "<5.1.0", "sebastian/exporter": "<5.1.0",
"webmozart/assert": "<1.11.0" "webmozart/assert": "<1.11.0"
}, },
"require-dev": { "require-dev": {
"pestphp/pest-dev-tools": "^2.16.0", "pestphp/pest-dev-tools": "^2.16.0",
"pestphp/pest-plugin-type-coverage": "^2.2.0", "pestphp/pest-plugin-type-coverage": "^2.4.0",
"symfony/process": "^6.3.4" "symfony/process": "^6.3.4"
}, },
"bin": [ "bin": [
@ -7331,7 +7331,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/pestphp/pest/issues", "issues": "https://github.com/pestphp/pest/issues",
"source": "https://github.com/pestphp/pest/tree/v2.20.0" "source": "https://github.com/pestphp/pest/tree/v2.21.0"
}, },
"funding": [ "funding": [
{ {
@ -7343,7 +7343,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-09-29T18:05:52+00:00" "time": "2023-10-06T12:33:39+00:00"
}, },
{ {
"name": "pestphp/pest-plugin", "name": "pestphp/pest-plugin",
@ -8197,16 +8197,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "10.3.5", "version": "10.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "747c3b2038f1139e3dcd9886a3f5a948648b7503" "reference": "9784e877e3700de37475545bdbdce8383ff53d25"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/747c3b2038f1139e3dcd9886a3f5a948648b7503", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9784e877e3700de37475545bdbdce8383ff53d25",
"reference": "747c3b2038f1139e3dcd9886a3f5a948648b7503", "reference": "9784e877e3700de37475545bdbdce8383ff53d25",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -8246,7 +8246,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-main": "10.3-dev" "dev-main": "10.4-dev"
} }
}, },
"autoload": { "autoload": {
@ -8278,7 +8278,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy", "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.3.5" "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.0"
}, },
"funding": [ "funding": [
{ {
@ -8294,7 +8294,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-09-19T05:42:37+00:00" "time": "2023-10-06T03:41:22+00:00"
}, },
{ {
"name": "psr/cache", "name": "psr/cache",
@ -9758,5 +9758,5 @@
"php": "^8.1" "php": "^8.1"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.6.0" "plugin-api-version": "2.3.0"
} }

2
package-lock.json generated
View File

@ -1,5 +1,5 @@
{ {
"name": "html", "name": "priceybot",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {

View File

@ -2,7 +2,7 @@
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite --host",
"build": "vite build" "build": "vite build"
}, },
"devDependencies": { "devDependencies": {

View File

@ -0,0 +1,3 @@
<button {{ $attributes->merge(['type' => 'submit', 'class' => 'inline-flex items-center justify-center px-4 py-2 border border-transparent rounded-md font-bold text-xs text-white tracking-widest focus:outline-none focus:ring-2 focus:ring-nexi-red focus:ring-offset-2 transition ease-in-out duration-150']) }}>
{{ $slot }}
</button>

View File

@ -1,3 +1,3 @@
<button {{ $attributes->merge(['type' => 'submit', 'class' => 'inline-flex items-center justify-center px-4 py-2 bg-nexi-red border border-transparent rounded-md font-bold text-xs text-white tracking-widest focus:outline-none focus:ring-2 focus:ring-nexi-red focus:ring-offset-2 transition ease-in-out duration-150']) }}> <button {{ $attributes->merge(['type' => 'submit', 'class' => 'inline-flex items-center justify-center px-4 py-2 border border-transparent rounded-md font-bold text-xs text-white tracking-widest focus:outline-none focus:ring-2 focus:ring-nexi-red focus:ring-offset-2 transition ease-in-out duration-150 bg-nexi-red']) }}>
{{ $slot }} {{ $slot }}
</button> </button>

View File

@ -1,3 +1,3 @@
<button {{ $attributes->merge(['type' => 'button', 'class' => 'inline-flex items-center px-4 py-2 bg-white dark:bg-nexi-black border border-gray-300 dark:border-gray-500 rounded-md font-semibold text-xs text-gray-700 dark:text-gray-300 uppercase tracking-widest shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:focus:ring-offset-nexi-black disabled:opacity-25 transition ease-in-out duration-150']) }}> <button {{ $attributes->merge(['type' => 'button', 'class' => 'inline-flex items-center justify-center px-4 py-2 bg-white dark:bg-nexi-black border border-nexi-red rounded-md font-semibold text-xs text-gray-700 dark:text-gray-300 uppercase tracking-widest shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-nexi-red focus:ring-offset-2 dark:focus:ring-offset-nexi-black disabled:opacity-25 transition ease-in-out duration-150']) }}>
{{ $slot }} {{ $slot }}
</button> </button>

View File

@ -29,23 +29,25 @@
</ul> </ul>
</ul> </ul>
</li> </li>
<li> @if(auth()->user()->is_admin)
<div class="text-xs font-semibold leading-6 text-gray-400">Admin Menu</div> <li>
<ul role="list" class="-mx-2 mt-2 space-y-1"> <div class="text-xs font-semibold leading-6 text-gray-400">Admin Menu</div>
<li> <ul role="list" class="-mx-2 mt-2 space-y-1">
{{-- TODO: fill with SVG icons to make it pretty --}} <li>
{{-- <x-sidebar-nav :href="route('a-1')" route="a-1">First Page</x-sidebar-nav>--}} {{-- TODO: fill with SVG icons to make it pretty --}}
</li> {{-- <x-sidebar-nav :href="route('a-1')" route="a-1">First Page</x-sidebar-nav>--}}
<li> </li>
{{-- TODO: fill with SVG icons to make it pretty --}} <li>
{{-- <x-sidebar-nav :href="route('a-2')" route="a-2">Second Page</x-sidebar-nav>--}} {{-- TODO: fill with SVG icons to make it pretty --}}
</li> {{-- <x-sidebar-nav :href="route('a-2')" route="a-2">Second Page</x-sidebar-nav>--}}
<li> </li>
{{-- TODO: fill with SVG icons to make it pretty --}} <li>
{{-- <x-sidebar-nav :href="route('a-3')" route="a-3">Third Page</x-sidebar-nav>--}} {{-- TODO: fill with SVG icons to make it pretty --}}
</li> {{-- <x-sidebar-nav :href="route('a-3')" route="a-3">Third Page</x-sidebar-nav>--}}
</ul> </li>
</li> </ul>
</li>
@endif
</ul> </ul>
</nav> </nav>
</div> </div>

View File

@ -6,6 +6,7 @@
}" }"
x-init="$watch('darkMode', val => localStorage.setItem('darkMode', val))" x-init="$watch('darkMode', val => localStorage.setItem('darkMode', val))"
x-bind:class="{'dark': darkMode === 'dark' || (darkMode === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches)}" x-bind:class="{'dark': darkMode === 'dark' || (darkMode === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches)}"
class="h-full"
> >
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
@ -21,7 +22,7 @@
<!-- Scripts --> <!-- Scripts -->
@vite(['resources/css/app.css', 'resources/js/app.js']) @vite(['resources/css/app.css', 'resources/js/app.js'])
</head> </head>
<body class="antialiased bg-nexi-primary dark:bg-nexi-primary-dark font-sans text-nexi-black transition-colors duration-300"> <body class="antialiased bg-nexi-primary dark:bg-nexi-primary-dark font-sans text-nexi-black transition-colors duration-300 h-full">
<div x-data="{ sidebarOpen: false }"> <div x-data="{ sidebarOpen: false }">
<div class="relative z-50 lg:hidden" role="dialog" aria-modal="true"> <div class="relative z-50 lg:hidden" role="dialog" aria-modal="true">
{{-- TODO: Look into why the fuck does this not work? mobile views seem to not work with livewire clicks??? --}} {{-- TODO: Look into why the fuck does this not work? mobile views seem to not work with livewire clicks??? --}}
@ -32,35 +33,36 @@
x-transition:leave="transition-opacity ease-linear duration-300" x-transition:leave="transition-opacity ease-linear duration-300"
x-transition:leave-start="opacity-100" x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0" x-transition:leave-end="opacity-0"
class="fixed inset-0 bg-nexi-black/80"></div> class="fixed inset-0 bg-nexi-black/80">
<div class="fixed inset-0 flex">
<div x-show="sidebarOpen"
x-transition:enter="transition ease-in-out duration-300 transform"
x-transition:enter-start="-translate-x-full"
x-transition:enter-end="translate-x-0"
x-transition:leave="transition ease-in-out duration-300 transform"
x-transition:leave-start="translate-x-0"
x-transition:leave-end="-translate-x-full"
class="relative mr-16 flex w-full max-w-xs flex-1">
<div class="fixed inset-0 flex">
<div x-show="sidebarOpen" <div x-show="sidebarOpen"
x-transition:enter="ease-in-out duration-300" x-transition:enter="transition ease-in-out duration-300 transform"
x-transition:enter-start="opacity-0" x-transition:enter-start="-translate-x-full"
x-transition:enter-end="opacity-100" x-transition:enter-end="translate-x-0"
x-transition:leave="ease-in-out duration-300" x-transition:leave="transition ease-in-out duration-300 transform"
x-transition:leave-start="opacity-100" x-transition:leave-start="translate-x-0"
x-transition:leave-end="opacity-0" x-transition:leave-end="-translate-x-full"
class="absolute left-full top-0 flex w-16 justify-center pt-5"> class="relative mr-16 flex w-full max-w-xs flex-1">
<button type="button" class="-m-2.5 p-2.5" @click="sidebarOpen = false">
<svg class="h-6 w-6 text-white" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
<div class="flex grow flex-col gap-y-5 overflow-y-auto px-6 pb-4"> <div x-show="sidebarOpen"
<x-sidebar/> x-transition:enter="ease-in-out duration-300"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="ease-in-out duration-300"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
class="absolute left-full top-0 flex w-16 justify-center pt-5">
<button type="button" class="-m-2.5 p-2.5" @click="sidebarOpen = false">
<svg class="h-6 w-6 text-white" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
<div class="flex grow flex-col gap-y-5 overflow-y-auto px-6 pb-4 bg-nexi-primary dark:bg-nexi-primary-dark">
<x-sidebar/>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -23,7 +23,18 @@ new #[Layout('layouts.guest')] class extends Component
// TODO: add code to send a notification // TODO: add code to send a notification
} }
public function delete(Quote $quote): void
{
$this->authorize('request', $quote);
$quote->delete();
$this->dispatch('quote-deleted');
}
#[On('quote-approved')] #[On('quote-approved')]
#[On('quote-deleted')]
public function getQuotes(): void public function getQuotes(): void
{ {
$this->quotes = Quote::all()->whereNull('deleted_at')->sortDesc(); $this->quotes = Quote::all()->whereNull('deleted_at')->sortDesc();
@ -54,8 +65,40 @@ new #[Layout('layouts.guest')] class extends Component
<td class="relative w-8 pl-4 pr-3 text-sm sm:pl-6 border-t"> <td class="relative w-8 pl-4 pr-3 text-sm sm:pl-6 border-t">
<div class="flex flex-row space-x-2"> <div class="flex flex-row space-x-2">
<form wire:submit="request({{ $quote }})"> <form wire:submit="request({{ $quote }})">
<x-primary-button wire:loading.attr="disabled" wire:loading.class="opacity-50" class="bg-nexi-purple w-24">{{ __('Request') }}</x-primary-button> <x-button wire:loading.attr="disabled" wire:loading.class="opacity-50" class="bg-nexi-purple w-24">{{ __('Request') }}</x-button>
</form> </form>
@if(auth()->user()->is_admin)
<x-button
x-data=""
x-on:click.prevent="$dispatch('open-modal', 'confirm-quote-deletion-{{ $quote->id }}')"
wire:loading.attr="disabled"
wire:loading.class="opacity-50"
class="bg-nexi-red w-24"
>{{ __('Delete') }}</x-button>
<x-modal name="confirm-quote-deletion-{{ $quote->id }}" :show="$errors->isNotEmpty()" focusable>
<form wire:submit="delete({{ $quote }})" class="p-6">
<h2 class="text-lg font-medium text-nexi-black dark:text-gray-100">
{{ __('Are you sure you want to delete the quote?') }}
</h2>
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
"{{ $quote->quote }}"
</p>
<div class="mt-6 flex justify-end">
<x-secondary-button x-on:click="$dispatch('close')">
{{ __('Cancel') }}
</x-secondary-button>
<x-primary-button
wire:loading.attr="disabled"
wire:loading.class="opacity-50"
class="w-24 ml-3"
>{{ __('Delete') }}</x-primary-button>
</div>
</form>
</x-modal>
@endif
</div> </div>
</td> </td>
@endif @endif

View File

@ -35,6 +35,6 @@ new #[Layout('layouts.guest')] class extends Component
></x-text-input> ></x-text-input>
<x-input-error :messages="$errors->get('quote')" class="mt-2"/> <x-input-error :messages="$errors->get('quote')" class="mt-2"/>
<x-primary-button wire:loading.attr="disabled" wire:loading.class="opacity-50" class="mt-4">{{ __('Request') }}</x-primary-button> <x-button wire:loading.attr="disabled" wire:loading.class="opacity-50" class="bg-nexi-red mt-4">{{ __('Request') }}</x-button>
</form> </form>
</div> </div>

View File

@ -69,12 +69,67 @@ new #[Layout('layouts.guest')] class extends Component
@if(!empty(auth()->user()) && auth()->user()->is_admin) @if(!empty(auth()->user()) && auth()->user()->is_admin)
<td class="relative w-8 pl-4 pr-3 text-sm sm:pl-6 border-t"> <td class="relative w-8 pl-4 pr-3 text-sm sm:pl-6 border-t">
<div class="flex flex-row space-x-2"> <div class="flex flex-row space-x-2">
<form wire:submit="approve({{ $quote }})"> <x-button
<x-primary-button wire:loading.attr="disabled" wire:loading.class="opacity-50" class="bg-nexi-green w-24">{{ __('Approve') }}</x-primary-button> x-data=""
</form> x-on:click.prevent="$dispatch('open-modal', 'confirm-quote-approve-{{ $quote->id }}')"
<form wire:submit="reject({{ $quote }})"> wire:loading.attr="disabled"
<x-primary-button wire:loading.attr="disabled" wire:loading.class="opacity-50" class="bg-nexi-red w-24">{{ __('Reject') }}</x-primary-button> wire:loading.class="opacity-50"
</form> class="bg-nexi-green w-24"
>{{ __('Approve') }}</x-button>
<x-modal name="confirm-quote-approve-{{ $quote->id }}" :show="$errors->isNotEmpty()" focusable>
<form wire:submit="approve({{ $quote }})" class="p-6">
<h2 class="text-lg font-medium text-nexi-black dark:text-gray-100">
{{ __('Are you sure you want to approve the quote?') }}
</h2>
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
"{{ $quote->quote }}"
</p>
<div class="mt-6 flex justify-end">
<x-secondary-button x-on:click="$dispatch('close')">
{{ __('Cancel') }}
</x-secondary-button>
<x-button
wire:loading.attr="disabled"
wire:loading.class="opacity-50"
class="bg-nexi-green w-24 ml-3"
>{{ __('Approve') }}</x-button>
</div>
</form>
</x-modal>
<x-button
x-data=""
x-on:click.prevent="$dispatch('open-modal', 'confirm-quote-reject-{{ $quote->id }}')"
wire:loading.attr="disabled"
wire:loading.class="opacity-50"
class="bg-nexi-red w-24"
>{{ __('Reject') }}</x-button>
<x-modal name="confirm-quote-reject-{{ $quote->id }}" :show="$errors->isNotEmpty()" focusable>
<form wire:submit="reject({{ $quote }})" class="p-6">
<h2 class="text-lg font-medium text-nexi-black dark:text-gray-100">
{{ __('Are you sure you want to reject the quote?') }}
</h2>
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
"{{ $quote->quote }}"
</p>
<div class="mt-6 flex justify-end">
<x-secondary-button x-on:click="$dispatch('close')">
{{ __('Cancel') }}
</x-secondary-button>
<x-button
wire:loading.attr="disabled"
wire:loading.class="opacity-50"
class="bg-nexi-red w-24 ml-3"
>{{ __('Reject') }}</x-button>
</div>
</form>
</x-modal>
</div> </div>
</td> </td>
@endif @endif

View File

@ -7,11 +7,11 @@
<div class="py-12"> <div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6"> <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
<div class="p-4 sm:p-8 shadow sm:rounded-lg dark:shadow-zinc-600"> {{-- <div class="p-4 sm:p-8 shadow sm:rounded-lg dark:shadow-zinc-600">--}}
<div class="max-w-xl"> {{-- <div class="max-w-xl">--}}
<livewire:profile.update-profile-information-form /> {{-- <livewire:profile.update-profile-information-form />--}}
</div> {{-- </div>--}}
</div> {{-- </div>--}}
<div class="p-4 sm:p-8 shadow sm:rounded-lg dark:shadow-zinc-600"> <div class="p-4 sm:p-8 shadow sm:rounded-lg dark:shadow-zinc-600">
<div class="max-w-xl"> <div class="max-w-xl">
@ -19,11 +19,11 @@
</div> </div>
</div> </div>
<div class="p-4 sm:p-8 shadow sm:rounded-lg dark:shadow-zinc-600"> {{-- <div class="p-4 sm:p-8 shadow sm:rounded-lg dark:shadow-zinc-600">--}}
<div class="max-w-xl"> {{-- <div class="max-w-xl">--}}
<livewire:profile.delete-user-form /> {{-- <livewire:profile.delete-user-form />--}}
</div> {{-- </div>--}}
</div> {{-- </div>--}}
</div> </div>
</div> </div>
</x-app-layout> </x-app-layout>

View File

@ -1,19 +0,0 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
],
refresh: true,
}),
],
server: {
hmr: {
host: '192.168.1.71',
},
}
});