Skip to content

Commit

Permalink
Part 2 of the removal of the NEWS.md file, switch to using the same '…
Browse files Browse the repository at this point in the history
…productstatus' file as on the login screen
  • Loading branch information
obra committed Mar 14, 2024
1 parent f850da3 commit f543727
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 50 deletions.
4 changes: 0 additions & 4 deletions config/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ module.exports = {
// Removes/cleans build folders and unused assets when rebuilding
new CleanWebpackPlugin(),

new CopyWebpackPlugin({
patterns: [{ from: "NEWS.md", to: "assets" }],
}),

// Copies files from target to destination folder
new CopyWebpackPlugin({
patterns: [
Expand Down
51 changes: 5 additions & 46 deletions src/renderer/screens/ChangeLog.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,20 @@
import Card from "@mui/material/Card";
import CardContent from "@mui/material/CardContent";
import CardHeader from "@mui/material/CardHeader";
import Container from "@mui/material/Container";
import Typography from "@mui/material/Typography";
import { PageTitle } from "@renderer/components/PageTitle";
import logo from "@renderer/logo-small.png";
import pkg from "@root/package.json";
import React, { useState, useEffect } from "react";
import { ProductStatus } from "@renderer/screens/KeyboardSelect/ProductStatus";
import React from "react";
import { useTranslation } from "react-i18next";
import ReactMarkdown from "react-markdown";
import logger from "@renderer/utils/Logger";

const version = pkg.version;

const ChangeLog = (props) => {
const { classes } = props;
const ChangeLog = () => {
const { t } = useTranslation();

const [data, setData] = useState("");

useEffect(() => {
// Assuming you have the absolute path for the file, replace it accordingly
const changelogFile = "/assets/NEWS.md";

fetch(changelogFile)
.then((response) => response.text())
.then((text) => {
setData(text);
})
.catch((error) => {
logger.error("An error occurred while fetching the changelog:", error);
});
}, []);

return (
<Container>
<PageTitle title={t("changelog.title")} />
<Card sx={{ my: 2 }}>
<CardHeader
avatar={<img src={logo} alt={t("components.logo.altText")} />}
title="Chrysalis"
subheader={version}
/>
<CardContent>
<ReactMarkdown
components={{
h1({ node, ...props }) {
return (
<Typography component="h1" variant="h1" sx={{ textDecoration: "underline" }}>
{node.children[0].value}
</Typography>
);
},
}}
>
{data}
</ReactMarkdown>
<CardContent sx={{ width: "100%", px: 4 }}>
<ProductStatus />
</CardContent>
</Card>
</Container>
Expand Down

0 comments on commit f543727

Please sign in to comment.