Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Display Code of Conduct & License #229

Merged
merged 7 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions src/lib/components/issue-card.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import Card from '$lib/components/card.svelte';
import Label from '$lib/components/label.svelte';
import RepoHeader from '$lib/components/repo-header.svelte';
import { text } from 'svelte/internal';

export let issue: Node;
let isToggled = true;
// var deviceWidth = window.matchMedia("(max-width: 744px)")

const handleToggle = () => {
isToggled = !isToggled;
Expand Down Expand Up @@ -38,6 +40,32 @@
</div>
</div>
<div class="flex flex-shrink-0">
<div class="on-bigscreen flex flex-shrink-0">
<div class="mt-2 space-y-2">
{#if issue.repository.codeOfConduct}
<Label color="#4267B2" text={issue.repository.codeOfConduct.name} />
{/if}
</div>
<div class="mt-2 space-y-2">
{#if issue.repository.licenseInfo}
<Label color="#4267B2" text={issue.repository.licenseInfo.name} />
{/if}
</div>
</div>
<div class="on-smallscreen">
{#if !isToggled}
<div class="mt-2 space-y-2">
{#if issue.repository.codeOfConduct}
<Label color="#4267B2" text={issue.repository.codeOfConduct.name} />
{/if}
</div>
<div class="mt-2 space-y-2">
{#if issue.repository.licenseInfo}
<Label color="#4267B2" text={issue.repository.licenseInfo.name} />
{/if}
</div>
{/if}
</div>
<div class="mr-2 flex items-center px-2">
{#if issue.repository.primaryLanguage}
<Label
Expand Down Expand Up @@ -82,4 +110,14 @@
.rotate {
@apply rotate-180;
}
@media (max-width: 744px) {
.on-bigscreen {
display: none;
}
}
@media (min-width: 745px) {
.on-smallscreen {
display: none;
}
}
</style>
75 changes: 42 additions & 33 deletions src/routes/api/get-issues/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,54 @@ export const POST: RequestHandler = async ({ request }) => {

const octokit = new Octokit({ auth: token });
const { search }: Response = await octokit.graphql(
`query EddieHubIssues($queryString: String!, $skip: Int!, $after:String) {
search(first: $skip, query: $queryString, type: ISSUE, after: $after) {
issueCount
pageInfo {
hasNextPage
endCursor
}
edges {
node {
... on Issue {
url
title
createdAt
labels(first: $skip) {
edges {
node {
color
name
}
}
}
repository {
`query EddieHubIssues($queryString: String!, $skip: Int!, $after: String) {
search(first: $skip, query: $queryString, type: ISSUE, after: $after) {
issueCount
pageInfo {
hasNextPage
endCursor
}
edges {
node {
... on Issue {
url
title
createdAt
labels(first: $skip) {
edges {
node {
color
name
url
primaryLanguage {
color
name
id
}
owner {
avatarUrl
login
}
}
}
}
repository {
name
url
primaryLanguage {
color
name
id
}
owner {
avatarUrl
login
}
codeOfConduct {
id
name
url
}
licenseInfo {
name
id
}
}
}
}
}`,
}
}
}`,
{
queryString: body.query,
skip: 10,
Expand Down