Add sponsorship notification and disable option,

update dependencies
This commit is contained in:
Andras Bacsai 2023-11-13 14:44:54 +01:00
parent c838ff7198
commit 3dd9182281
7 changed files with 79 additions and 17 deletions

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class Sponsorship extends Component
{
public function disable()
{
auth()->user()->update(['is_notification_sponsorship_enabled' => false]);
}
public function render()
{
return view('livewire.sponsorship');
}
}

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->boolean('is_notification_sponsorship_enabled')->default(true);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('is_notification_sponsorship_enabled');
});
}
};

28
package-lock.json generated
View File

@ -7,7 +7,7 @@
"dependencies": {
"@tailwindcss/typography": "0.5.10",
"alpinejs": "3.13.1",
"daisyui": "3.9.2",
"daisyui": "4.0.3",
"tailwindcss-scrollbar": "0.1.0"
},
"devDependencies": {
@ -896,11 +896,6 @@
"node": ">= 6"
}
},
"node_modules/colord": {
"version": "2.9.3",
"resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz",
"integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw=="
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
@ -952,16 +947,23 @@
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==",
"dev": true
},
"node_modules/culori": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/culori/-/culori-3.2.0.tgz",
"integrity": "sha512-HIEbTSP7vs1mPq/2P9In6QyFE0Tkpevh0k9a+FkjhD+cwsYm9WRSbn4uMdW9O0yXlNYC3ppxL3gWWPOcvEl57w==",
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
}
},
"node_modules/daisyui": {
"version": "3.9.2",
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-3.9.2.tgz",
"integrity": "sha512-yJZ1QjHUaL+r9BkquTdzNHb7KIgAJVFh0zbOXql2Wu0r7zx5qZNLxclhjN0WLoIpY+o2h/8lqXg7ijj8oTigOw==",
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-4.0.3.tgz",
"integrity": "sha512-mG6PsdIA6MEHzdJwBlJxc1rqsIAAlcfhj2O8g0ol1uWg5y6C5zTcqfG8vKBqK4y2YfCxGIVgMsMWRTSm32N1Ow==",
"dependencies": {
"colord": "^2.9",
"css-selector-tokenizer": "^0.8",
"postcss": "^8",
"postcss-js": "^4",
"tailwindcss": "^3.1"
"culori": "^3",
"picocolors": "^1",
"postcss-js": "^4"
},
"engines": {
"node": ">=16.9.0"

View File

@ -11,14 +11,14 @@
"axios": "1.5.1",
"laravel-vite-plugin": "0.8.1",
"postcss": "8.4.31",
"tailwindcss": "3.3.3",
"tailwindcss": "3.3.5",
"vite": "4.4.11",
"vue": "3.3.4"
},
"dependencies": {
"@tailwindcss/typography": "0.5.10",
"alpinejs": "3.13.1",
"daisyui": "3.9.2",
"daisyui": "4.0.3",
"tailwindcss-scrollbar": "0.1.0"
}
}

View File

@ -53,10 +53,10 @@ .icon:hover {
@apply text-white;
}
.box {
@apply flex p-2 transition-colors cursor-pointer min-h-16 bg-coolgray-100 hover:bg-coollabs-100 hover:text-white hover:no-underline min-w-[24rem];
@apply flex p-2 transition-colors cursor-pointer min-h-[4rem] bg-coolgray-100 hover:bg-coollabs-100 hover:text-white hover:no-underline min-w-[24rem];
}
.box-without-bg {
@apply flex p-2 transition-colors min-h-16 hover:text-white hover:no-underline min-w-[24rem];
@apply flex p-2 transition-colors h-16 min-h-full hover:text-white hover:no-underline min-h-[4rem];
}
.description {
@apply pt-2 text-xs font-bold text-neutral-500 group-hover:text-white;

View File

@ -5,6 +5,7 @@
<div class="fixed z-50 top-[4.5rem] left-4" id="vue">
<magic-bar></magic-bar>
</div>
<livewire:sponsorship />
<main class="pb-10 main max-w-screen-2xl">
{{ $slot }}
</main>

View File

@ -0,0 +1,14 @@
<div>
@if (data_get(auth()->user(), 'is_notification_sponsorship_enabled'))
<div class="toast">
<div class="flex flex-col text-white rounded alert bg-coolgray-200">
<span>Love Coolify as we do? <a href="https://coolify.io/sponsorships"
class="underline text-warning">Please
consider donating!</a>💜</span>
<span>It enables us to keep creating features without paywalls, ensuring our work remains free and
open.</span>
<x-forms.button class="bg-coolgray-400" wire:click='disable'>Disable This Popup</x-forms.button>
</div>
</div>
@endif
</div>