Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Kipruto <[email protected]>
  • Loading branch information
kelvinkipruto committed Sep 7, 2024
1 parent 1931f4c commit 2276210
Show file tree
Hide file tree
Showing 6 changed files with 506 additions and 64 deletions.
7 changes: 6 additions & 1 deletion apps/engineeringblog/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
module.exports = {
root: true,
extends: ["next/core-web-vitals", "plugin:prettier/recommended"],
extends: [
"next/core-web-vitals",
"plugin:prettier/recommended",
"plugin:mdx/recommended",
],
settings: {
"import/resolver": {
webpack: {
config: "./eslint.webpack.config.js",
},
},
"mdx/code-blocks": true,
},
};
14 changes: 7 additions & 7 deletions apps/engineeringblog/components/Markdown/Markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Addapted from https://amirardalan.com/blog/syntax-highlight-code-in-markdown
import { FC } from "react";
import React from "react";
import ReactMarkdown, { Components } from "react-markdown";
import { PrismLight as SyntaxHighlighter } from "react-syntax-highlighter";
import bash from "react-syntax-highlighter/dist/cjs/languages/prism/bash";
Expand Down Expand Up @@ -29,10 +29,6 @@ SyntaxHighlighter.registerLanguage("python", python);
SyntaxHighlighter.registerLanguage("jsx", jsx);
SyntaxHighlighter.registerLanguage("java", java);

type MarkdownProps = {
markdown: string;
};

const Pre = ({ children }: { children: JSX.Element }) => (
<Box
component="pre"
Expand All @@ -49,7 +45,11 @@ const Pre = ({ children }: { children: JSX.Element }) => (
</Box>
);

const Markdown: FC<MarkdownProps> = ({ markdown }) => {
const Markdown = React.forwardRef(function Markdown({
markdown,
}: {
markdown: string;
}) {
const syntaxTheme = oneDark;

const MarkdownComponents: Components = {
Expand Down Expand Up @@ -98,6 +98,6 @@ const Markdown: FC<MarkdownProps> = ({ markdown }) => {
return (
<ReactMarkdown components={MarkdownComponents}>{markdown}</ReactMarkdown>
);
};
});

export default Markdown;
4 changes: 3 additions & 1 deletion apps/engineeringblog/components/NoPosts/NoPosts.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"use client";

import { Section } from "@commons-ui/core";
import React from "react";
import bg from "@/engineeringblog/assets/images/1920x668px bg - 2 2.png";
import { alpha, Box, Typography } from "@mui/material";

import bg from "@/engineeringblog/assets/images/1920x668px bg - 2 2.png";

const NoPosts = React.forwardRef(function NoPosts() {
return (
<Box
Expand Down
1 change: 1 addition & 0 deletions apps/engineeringblog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"eslint-config-next": "catalog:",
"eslint-config-prettier": "catalog:",
"eslint-import-resolver-webpack": "catalog:",
"eslint-plugin-mdx": "catalog:",
"eslint-plugin-import": "catalog:",
"prettier": "catalog:",
"typescript": "catalog:"
Expand Down
Loading

0 comments on commit 2276210

Please sign in to comment.