Skip to content

Commit

Permalink
feat(ui): open pullrequest url
Browse files Browse the repository at this point in the history
  • Loading branch information
itupix committed Jan 5, 2021
1 parent 09ae4d1 commit 6991e41
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/components/Avatar/Avatar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<style>
.container {
position: relative;
width: 4rem;
height: 4rem;
}
.avatar {
width: 4rem;
height: 4rem;
overflow: hidden;
border-radius: 50%;
border: 2px solid #fff;
Expand All @@ -28,7 +28,7 @@
img {
display: block;
width: 100%;
height: auto;
height: 100%;
}
.badge {
Expand All @@ -54,7 +54,9 @@

<div class={`container ${className || ''}`}>
{#await Service.getAvatar(pullRequest.provider, pullRequest.user.avatar, pullRequest.organizationName)}
<p>Chargement...</p>
<div class="avatar">
<p>Chargement...</p>
</div>
{:then avatar}
<div class="avatar"><img src={avatar} alt={pullRequest.user.name} /></div>
{#if pullRequest.provider}
Expand Down
1 change: 0 additions & 1 deletion src/components/Header/MacosBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
</script>

<style src="./MacosBar.scss">
</style>

<div class="window-controls">
Expand Down
36 changes: 33 additions & 3 deletions src/components/Pullrequest/Pullrequest.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { isFetchingData } from '../../shared/stores/default.store';
import Avatar from 'components/Avatar';
import Icons from 'components/icons';
const { shell } = require('electron');
export let pullRequest: PullRequestType;
const dispatch = createEventDispatcher();
Expand All @@ -19,12 +20,18 @@

<style>
.pr {
position: relative;
display: flex;
flex-wrap: wrap;
padding: 1rem;
color: #fff;
border-radius: 8px;
background-color: #444;
transition: opacity linear 0.2s;
}
.pr:hover {
opacity: 0.8;
}
:global(.pr__avatar) {
Expand Down Expand Up @@ -71,7 +78,9 @@
background-color: #3e3e3e;
}
button {
.more {
position: relative;
z-index: 2;
display: block;
width: 1.5rem;
height: 1.5rem;
Expand All @@ -81,12 +90,30 @@
background-color: transparent;
}
button:hover {
.more:hover {
background-color: #333;
}
.link {
position: absolute;
left: 0;
top: 0;
z-index: 1;
width: 100%;
height: 100%;
cursor: pointer;
border: none;
background-color: transparent;
}
</style>

<div class="pr">
<button
class="link"
on:click={() => {
console.log('yo.');
shell.openExternal(pullRequest.url);
}} />
<Avatar className="pr__avatar" {pullRequest} />
<div class="details">
<header>
Expand All @@ -100,7 +127,10 @@
</div>
<footer>
<Labels labels={pullRequest.labels} />
<button on:click={() => getComments(pullRequest)} disabled={$isFetchingData}>
<button
class="more"
on:click={() => getComments(pullRequest)}
disabled={$isFetchingData}>
<Icons.Ellipsis />
</button>
</footer>
Expand Down

0 comments on commit 6991e41

Please sign in to comment.