Skip to content

Commit

Permalink
added profile view
Browse files Browse the repository at this point in the history
  • Loading branch information
sawirricardo committed May 18, 2021
1 parent 0ac9ff5 commit 0db0716
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/Http/Livewire/Front/Article/Show.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Livewire\Front\Article;

use Artesaos\SEOTools\Facades\SEOTools;
use Livewire\Component;

class Show extends Component
Expand All @@ -22,6 +23,9 @@ public function mount(\App\Models\Article $article)
if (auth()->check()) {
$this->user = \App\Models\User::find(auth()->user()->getAuthIdentifier())->toArray();
}

SEOTools::setTitle("{$article->title} | Conduit X Ricardo Sawir", false);
SEOTools::setDescription($article->description);
}

public function render()
Expand Down
7 changes: 7 additions & 0 deletions app/Http/Livewire/Front/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Livewire\Front;

use Artesaos\SEOTools\Facades\SEOTools;
use Livewire\Component;

class Index extends Component
Expand All @@ -12,6 +13,12 @@ public function updatedViewingPrivateFeed()
{
}

public function mount()
{
SEOTools::setTitle('Conduit X Ricardo Sawir', false);
SEOTools::setDescription('Real world application, implemented in Laravel Livewire');
}

public function render()
{
return view('livewire.front.index', [
Expand Down
4 changes: 4 additions & 0 deletions app/Http/Livewire/Front/Tag/Show.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Livewire\Front\Tag;

use Artesaos\SEOTools\Facades\SEOTools;
use Livewire\Component;

class Show extends Component
Expand All @@ -12,6 +13,9 @@ public function mount(\App\Models\Tag $tag)
{
$tag->load(['articles']);
$this->tag = $tag;

SEOTools::setTitle("{$tag->name} | Conduit X Ricardo Sawir", false);
SEOTools::setDescription($tag->name);
}

public function render()
Expand Down
7 changes: 7 additions & 0 deletions app/Http/Livewire/Front/User/Show.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

class Show extends Component
{
public $user;

public function mount(\App\Models\User $user)
{
$this->user = $user->toArray();
}

public function render()
{
return view('livewire.front.user.show');
Expand Down
3 changes: 2 additions & 1 deletion resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
<a href="{{ route('front.index') }}" class="logo-font">conduit</a>
<span class="attribution">
An interactive learning project from <a href="https://thinkster.io">Thinkster</a>. Code &amp; design
licensed under MIT.
licensed under MIT. Implementation by <a href="https://github.com/sawirricardo" target="_blank"
rel="noopener noreferrer">Ricardo Sawir</a>
</span>
</div>
</footer>
Expand Down
3 changes: 2 additions & 1 deletion resources/views/livewire/front/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

<div class="banner">
<div class="container">
<h1 class="logo-font">conduit</h1>
<h1 class="logo-font">conduit X Ricardo Sawir</h1>
<p>A place to share your knowledge.</p>
<p>Implemented by Ricardo Sawir</p>
</div>
</div>

Expand Down
86 changes: 85 additions & 1 deletion resources/views/livewire/front/user/show.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,87 @@
<div>
{{-- Close your eyes. Count to one. That is how long forever feels. --}}
<div class="profile-page">

<div class="user-info">
<div class="container">
<div class="row">

<div class="col-xs-12 col-md-10 offset-md-1">
<img src="{{ $user['image'] }}" class="user-img" />
<h4>{{ $user['name'] }}</h4>
<p>
{{ $user['bio'] }}
</p>
<button class="btn btn-sm btn-outline-secondary action-btn">
<i class="ion-plus-round"></i>
&nbsp;
Follow {{ $user['name'] }}
</button>
</div>

</div>
</div>
</div>

<div class="container">
<div class="row">

<div class="col-xs-12 col-md-10 offset-md-1">
<div class="articles-toggle">
<ul class="nav nav-pills outline-active">
<li class="nav-item">
<a class="nav-link active" href="">My Articles</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">Favorited Articles</a>
</li>
</ul>
</div>

<div class="article-preview">
<div class="article-meta">
<a href=""><img src="http://i.imgur.com/Qr71crq.jpg" /></a>
<div class="info">
<a href="" class="author">Eric Simons</a>
<span class="date">January 20th</span>
</div>
<button class="btn btn-outline-primary btn-sm pull-xs-right">
<i class="ion-heart"></i> 29
</button>
</div>
<a href="" class="preview-link">
<h1>How to build webapps that scale</h1>
<p>This is the description for the post.</p>
<span>Read more...</span>
</a>
</div>

<div class="article-preview">
<div class="article-meta">
<a href=""><img src="http://i.imgur.com/N4VcUeJ.jpg" /></a>
<div class="info">
<a href="" class="author">Albert Pai</a>
<span class="date">January 20th</span>
</div>
<button class="btn btn-outline-primary btn-sm pull-xs-right">
<i class="ion-heart"></i> 32
</button>
</div>
<a href="" class="preview-link">
<h1>The song you won't ever stop singing. No matter how hard you try.</h1>
<p>This is the description for the post.</p>
<span>Read more...</span>
<ul class="tag-list">
<li class="tag-default tag-pill tag-outline">Music</li>
<li class="tag-default tag-pill tag-outline">Song</li>
</ul>
</a>
</div>


</div>

</div>
</div>

</div>
</div>

0 comments on commit 0db0716

Please sign in to comment.