null, 'userData' => null, 'receiverPrompt' => null, 'receiverUserData' => null, 'prompt' => '', 'submissionUrl' => '', 'isEditingPrompt' => false, 'isEditingSubmission' => false, 'submissionData' => null ]); #todo - check if the post is by them, if not - reject it rules([ 'prompt' => 'string|min:3', 'submissionUrl' => [ 'regex:/^https:\/\/sketchersunited\.org\/posts\/\d+$/', 'max:200', ], ]); mount(function ($token) { $this->token = $token; if ($this->token) { $this->participant = Participant::findByToken($this->token); if ($this->participant) { $this->userData = $this->participant->getUserData(); $this->prompt = $this->participant->prompt ?? ''; if ($this->participant->receiver) { $this->receiverPrompt = $this->participant->receiver->prompt; $this->receiverUserData = $this->participant->receiver->getUserData(); if ($this->participant->submission_url) { $this->submissionUrl = $this->participant->submission_url ?? ''; $this->submissionData = PostService::getPostData($this->participant->submission_url); if (!$this->submissionData) { $this->submissionData = null; } } } } } }); $saveEditingPrompt = function () { if ($this->participant) { $this->validate(); $this->participant->prompt = $this->prompt; $this->participant->save(); $this->isEditingPrompt = false; } }; $cancelEditingPrompt = function () { $this->prompt = $this->participant->prompt ?? ''; $this->isEditingPrompt = false; }; $saveEditingSubmission = function () { if ($this->participant) { $this->validate(); $this->participant->submission_url = $this->submissionUrl; $this->participant->save(); $this->isEditingSubmission = false; } }; $cancelEditingSubmission = function () { $this->submissionUrl = $this->participant->submission_url ?? ''; $this->isEditingSubmission = false; }; ?>
@if($participant) @if($userData)
Profile Avatar
You are...

@{{ $userData['data']['username'] ?? 'Unknown' }}

@endif @if($isEditingPrompt)
Your prompt is...
@error('prompt') {{ $message }} @enderror

@else
Your prompt is...

"{{ $prompt ?: 'No prompt set yet.' }}"


this is what others will draw for you!
@endif
@if($participant->giving_id) You are giving to... @if($receiverUserData) @endif want to roll for a different person e.g. you blocked this person? you can dm @username

Their prompt is...
{{$receiverPrompt}} Nothing yet, probably!

Are you done?

You will be able to link to your gift below once submissions are accepted on 22nd December.

submissions will be accepted up until 5th of january but before then is much more appreciated! {{-- @if($isEditingSubmission)--}} {{--
--}} {{-- --}} {{-- @error('submissionUrl')--}} {{-- {{ $message }}--}} {{-- @enderror--}} {{-- --}} {{-- --}} {{--
--}} {{-- @else--}} {{--
--}} {{--

--}} {{-- Your submission URL is: {{ $submissionUrl ?: 'No submission sent yet.' }}--}} {{--

--}} {{-- --}} {{--
--}} {{-- @endif--}} {{-- @if($submissionData)--}} {{--

Your submission:

--}} {{-- --}} {{-- @endif--}} @elseif($participant->desperate)

You're in a bind!

@else

You haven't been assigned anyone yet. Initial assignments will be made on 13th December.

@endif
Withdraw from Secret Sketchers...?
@endif