Skip to content

Commit

Permalink
update: development
Browse files Browse the repository at this point in the history
Signed-off-by: Vinyl-Davyl <[email protected]>
  • Loading branch information
Vinyl-Davyl committed Aug 23, 2024
1 parent 33a3482 commit ca5da09
Show file tree
Hide file tree
Showing 16 changed files with 567 additions and 119 deletions.
225 changes: 223 additions & 2 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@types/styled-components": "^5.1.34",
"antd": "^5.7.2",
"core-js": "^3.37.1",
"highlight.js": "^11.10.0",
"immer": "^10.1.1",
"lz-string": "^1.5.0",
"monaco-editor": "^0.50.0",
Expand All @@ -39,6 +40,8 @@
"react-shepherd": "^6.1.1",
"react-spring": "^9.7.4",
"regenerator-runtime": "^0.13.11",
"rehype-highlight": "^7.0.0",
"rehype-raw": "^7.0.0",
"shepherd.js": "^13.0.3",
"styled-components": "^6.1.12",
"ts-debounce": "^4.0.0",
Expand Down
Binary file added public/assets/content/template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/content/template_logic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/content/template_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/content/template_text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ const App = () => {
path="module2"
element={<LearnContent file="module2.md" />}
/>
<Route
path="module3"
element={<LearnContent file="module3.md" />}
/>
</Route>
</Routes>
</Content>
Expand Down
27 changes: 24 additions & 3 deletions src/components/Content.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import React, { useEffect, useState } from "react";
import ReactMarkdown from "react-markdown";
import rehypeRaw from "rehype-raw";
import rehypeHighlight from "rehype-highlight";
import { useNavigate } from "react-router-dom";
import {
ContentContainer,
NavigationButtons,
NavigationButton,
} from "../styles/components/Content";
import { LoadingOutlined } from "@ant-design/icons";
import {
LoadingOutlined,
LeftOutlined,
RightOutlined,
} from "@ant-design/icons";
import { Spin } from "antd";
import fetchContent from "../utils/fetchContent";
import { steps } from "../constants/learningSteps/steps";
import { LeftOutlined, RightOutlined } from "@ant-design/icons";

// markdown syntax highlighting theme
import "highlight.js/styles/github.css";

interface LearnContentProps {
file: string;
Expand Down Expand Up @@ -80,7 +88,20 @@ const LearnContent: React.FC<LearnContentProps> = ({ file }) => {

return (
<ContentContainer>
{content && <ReactMarkdown>{content}</ReactMarkdown>}
{content && (
<ReactMarkdown
rehypePlugins={[rehypeRaw, rehypeHighlight]}
components={{
img: ({ node, ...props }) => (
<div className="image-container">
<img {...props} alt={props.alt || ""} />
</div>
),
}}
>
{content}
</ReactMarkdown>
)}
<NavigationButtons>
<NavigationButton
onClick={handlePrevious}
Expand Down
Loading

0 comments on commit ca5da09

Please sign in to comment.