Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/components/contributions/by-repo/comments.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { toHtmlUrl } from '../contributions';
import { toHtmlUrl } from '../../../lib/to-html-url';
import {
PullRequestReviewCommentEventPayload,
IssueCommentEventPayload,
Expand Down
2 changes: 1 addition & 1 deletion src/components/contributions/by-repo/commits.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { CommitIcon, InfoIcon } from '@primer/octicons-react';
import { Summary } from '../types';
import { toHtmlUrl } from '../contributions';
import { toHtmlUrl } from '../../../lib/to-html-url';

const Commits = ({ commits }: { commits: Summary['commits'] }) => {
const count = Object.values(commits).reduce((acc, c) => acc + c.data.length, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/components/contributions/by-repo/issues.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Summary } from '../types';
import { toHtmlUrl } from '../contributions';
import { toHtmlUrl } from '../../../lib/to-html-url';
import { InfoIcon, IssueClosedIcon, IssueOpenedIcon } from '@primer/octicons-react';

const Issues = ({ issues }: { issues: Summary['issues'] }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/contributions/by-repo/pullrequests.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Summary } from '../types';
import { toHtmlUrl } from '../contributions';
import { toHtmlUrl } from '../../../lib/to-html-url';
import { GitMergeIcon, GitPullRequestClosedIcon, GitPullRequestIcon, InfoIcon } from '@primer/octicons-react';

const PullRequests = ({ pullRequests }: { pullRequests: Summary['pullRequests'] }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/contributions/by-repo/repositories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { InfoIcon, RepoIcon } from '@primer/octicons-react';
import { toHtmlUrl } from '../contributions';
import { toHtmlUrl } from '../../../lib/to-html-url';
import { GitHubEvent } from '../types';

const Repositories = ({ repositories }: { repositories: GitHubEvent[] }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/contributions/by-repo/stared.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { InfoIcon, StarFillIcon } from '@primer/octicons-react';
import { toHtmlUrl } from '../contributions';
import { toHtmlUrl } from '../../../lib/to-html-url';
import { GitHubEvent } from '../types';

const StaredRepositories = ({ repositories }: { repositories: GitHubEvent[] }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/contributions/contributions-simple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
PushEventPayload,
WatchEventPayload,
} from './types';
import { toHtmlUrl } from './contributions';
import { toHtmlUrl } from '../../lib/to-html-url';

type Props = {
result: any;
Expand Down
4 changes: 0 additions & 4 deletions src/components/contributions/contributions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import ContributionsByEvent from './contributions-by-event';
import ContributionsSimple from './contributions-simple';
import { Commit, GitHubEvent } from './types';

export const toHtmlUrl = (url: string) => {
return url.replace('api.github.com/repos', 'github.com');
};

type Props = {
result: any;
user: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toHtmlUrl } from '../contributions';
import { toHtmlUrl } from '../to-html-url';

describe('toHtmlUrl', () => {
test('check replace', () => {
Expand Down
3 changes: 3 additions & 0 deletions src/lib/to-html-url.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const toHtmlUrl = (url: string) => {
return url.replace('api.github.com/repos', 'github.com');
};