Skip to content

Commit

Permalink
Create components for new GitHub events
Browse files Browse the repository at this point in the history
  • Loading branch information
JSn1nj4 committed Apr 16, 2024
1 parent d070ea6 commit 611e486
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace App\View\Components\Github\EventTypes;

use App\Models\GithubEvent;

class PullRequestReviewCommentEvent extends BaseComponent
{
/**
* Create a new component instance.
*
* @return void
*/
public function __construct(GithubEvent $event)
{
parent::__construct(
$event->action ?? 'posted a review comment on',
'fas fa-comment-alt',
$event
);

// $this->preposition = 'at';
// $this->setPullRequestNumberText($this->event->source);
}
}
25 changes: 25 additions & 0 deletions app/View/Components/Github/EventTypes/PullRequestReviewEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace App\View\Components\Github\EventTypes;

use App\Models\GithubEvent;

class PullRequestReviewEvent extends BaseComponent
{
/**
* Create a new component instance.
*
* @return void
*/
public function __construct(GithubEvent $event)
{
parent::__construct(
$event->action ?? 'reviewed a PR on',
'fas fa-edit',
$event
);

// $this->preposition = 'at';
// $this->setPullRequestNumberText($this->event->source);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div class="flex flex-row relative">
<div class="text-neutral-800 dark:text-neutral-500 text-center flex-none {{ $icon }}"
style="width: 2rem; font-size: 22px;"></div>

<div class="pl-4 flex-grow relative">
<p class="text-neutral-800 dark:text-neutral-500">
{{ $timeElapsed }}
</p>

<p class="font-white mt-1 text-sm leading-none">
<strong>
<a href="{{ $profileUrl() }}" target="_blank">
{{ $event->user->display_login }}
</a>

{{ $action }}

{{-- <a href="{{ $repoUrl() }}/pull/{{ $event->source }}" target="_blank" class="text-caribbeanGreen-600 dark:text-caribbeanGreen-500">--}}
{{-- {{ $pullRequestNumberText }}--}}
{{-- </a>--}}

{{-- {{ $preposition }}--}}

<a href="{{ $repoUrl() }}" target="_blank">
{{ $event->repo }}
</a>
</strong>
</p>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div class="flex flex-row relative">
<div class="text-neutral-800 dark:text-neutral-500 text-center flex-none {{ $icon }}"
style="width: 2rem; font-size: 22px;"></div>

<div class="pl-4 flex-grow relative">
<p class="text-neutral-800 dark:text-neutral-500">
{{ $timeElapsed }}
</p>

<p class="font-white mt-1 text-sm leading-none">
<strong>
<a href="{{ $profileUrl() }}" target="_blank">
{{ $event->user->display_login }}
</a>

{{ $action }}

{{-- <a href="{{ $repoUrl() }}/pull/{{ $event->source }}" target="_blank" class="text-caribbeanGreen-600 dark:text-caribbeanGreen-500">--}}
{{-- {{ $pullRequestNumberText }}--}}
{{-- </a>--}}

{{-- {{ $preposition }}--}}

<a href="{{ $repoUrl() }}" target="_blank">
{{ $event->repo }}
</a>
</strong>
</p>
</div>
</div>

0 comments on commit 611e486

Please sign in to comment.