Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Subham Ray committed Apr 13, 2024
1 parent 274650e commit b685b09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions components/markdown-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const MarkdownRenderer = ({ content }: { content: string }) => {
),
li: ({ children, ...props }) => (
<li className="mb-2 mt-4" {...props}>
{/* if children is p tag, then render it as a span */}
{/* if children is a p tag, then render it as a span */}
{React.Children.map(children, (child) => {
if (React.isValidElement(child) && child?.props?.node?.tagName === "p") {
return <span>{child.props.children}</span>;
Expand All @@ -66,11 +66,11 @@ export const MarkdownRenderer = ({ content }: { content: string }) => {
</li>
),
blockquote: ({ children, ...props }) => (
<blockquote className="mb-2 mt-4 border-l-4 border-slate-300 pl-2" {...props}>
<blockquote className="mb-2 mt-4 border-l-4 border-gray-200 pl-2" {...props}>
{children}
</blockquote>
),
hr: ({ ...props }) => <hr className="my-4 border-slate-300" {...props} />,
hr: ({ ...props }) => <hr className="my-4 border-gray-200" {...props} />,
br: ({ ...props }) => <br {...props} />,
a: ({ children, ...props }) => (
<a className="inline-block text-current underline" {...props} target="_blank">
Expand Down
8 changes: 4 additions & 4 deletions lib/github/services/repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export const getRepositoryDefaultBranch = async (userName: number, repoName: str
Authorization: `Bearer ${GITHUB_APP_ACCESS_TOKEN}`,
Accept: "application/vnd.github.v3+json",
};
const repo = await fetch(`https://api.github.com/repos/${userName}/${repoName}`, {
const repoRes = await fetch(`https://api.github.com/repos/${userName}/${repoName}`, {
headers: githubHeaders,
});
const repoData = await repo.json();
const repoData = await repoRes.json();
return repoData.default_branch;
} catch (error) {
console.error(`Failed to fetch the repository default branch: ${error}`);
Expand All @@ -19,10 +19,10 @@ export const getRepositoryDefaultBranch = async (userName: number, repoName: str

export const getRepositoryReadme = async (userName: number, repoName: string, branchName: string) => {
try {
const readme = await fetch(
const readmeRes = await fetch(
`https://raw.githubusercontent.com/${userName}/${repoName}/${branchName}/README.md`
);
const readmeText = await readme.text();
const readmeText = await readmeRes.text();
return readmeText;
} catch (error) {
console.error(`Failed to fetch the repository README content: ${error}`);
Expand Down

0 comments on commit b685b09

Please sign in to comment.