fix: copy invitation

This commit is contained in:
Andras Bacsai 2023-12-13 14:44:11 +01:00
parent 52d84c5e9e
commit 1ff1664b6c
2 changed files with 26 additions and 12 deletions

View File

@ -22,19 +22,20 @@
</svg>
</div>
@endif
<input value="{{ $value }}" {{ $attributes->merge(['class' => $defaultClass . ' pl-10']) }} @required($required)
wire:model={{ $id }} wire:dirty.class.remove='text-white' wire:dirty.class="input-warning"
wire:loading.attr="disabled" type="{{ $type }}" @readonly($readonly) @disabled($disabled)
id="{{ $id }}" name="{{ $name }}" placeholder="{{ $attributes->get('placeholder') }}"
<input value="{{ $value }}" {{ $attributes->merge(['class' => $defaultClass . ' pl-10']) }}
@required($required) @if ($id !== 'null') wire:model={{ $id }} @endif
wire:dirty.class.remove='text-white' wire:dirty.class="input-warning" wire:loading.attr="disabled"
type="{{ $type }}" @readonly($readonly) @disabled($disabled) id="{{ $id }}"
name="{{ $name }}" placeholder="{{ $attributes->get('placeholder') }}"
aria-placeholder="{{ $attributes->get('placeholder') }}">
</div>
@else
<input @if($value) value="{{ $value }}" @endif {{ $attributes->merge(['class' => $defaultClass]) }} @required($required)
@readonly($readonly) wire:model={{ $id }} wire:dirty.class.remove='text-white'
wire:dirty.class="input-warning" wire:loading.attr="disabled" type="{{ $type }}"
@disabled($disabled) id="{{ $id }}" name="{{ $name }}"
placeholder="{{ $attributes->get('placeholder') }}">
<input @if ($value) value="{{ $value }}" @endif
{{ $attributes->merge(['class' => $defaultClass]) }} @required($required) @readonly($readonly)
@if ($id !== 'null') wire:model={{ $id }} @endif wire:dirty.class.remove='text-white' wire:dirty.class="input-warning"
wire:loading.attr="disabled" type="{{ $type }}" @disabled($disabled)
@if ($id !== 'null') id={{ $id }} @endif name="{{ $name }}" placeholder="{{ $attributes->get('placeholder') }}">
@endif
@if (!$label && $helper)
<x-helper :helper="$helper" />

View File

@ -18,8 +18,12 @@
<td>{{ $invite->email }}</td>
<td>{{ $invite->via }}</td>
<td>{{ $invite->role }}</td>
<td x-on:click="copyToClipboard('{{ $invite->link }}')">
<x-forms.button>Copy Invitation Link</x-forms.button>
<td class="flex gap-2" x-data="checkProtocol">
<template x-if="isHttps">
<x-forms.button x-on:click="copyToClipboard('{{ $invite->link }}')">Copy Invitation
Link</x-forms.button>
</template>
<x-forms.input id="null" type="password" value="{{ $invite->link }}" />
</td>
<td>
<x-forms.button wire:click.prevent='deleteInvitation({{ $invite->id }})'>Revoke
@ -31,6 +35,15 @@
</tbody>
</table>
</div>
@endif
</div>
@script
<script>
Alpine.data('checkProtocol', () => {
return {
isHttps: window.location.protocol === 'https:'
}
})
</script>
@endscript