misc cleanup
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import { Table, Typography } from "antd";
|
||||
import { getGithubRelease } from "../utils/apis";
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import { Table, Typography } from 'antd';
|
||||
import { getGithubRelease } from '../utils/apis';
|
||||
|
||||
const { Title } = Typography;
|
||||
|
||||
@@ -10,32 +10,29 @@ function AssetTable(assets) {
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: "Name",
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
render: (text, entry) =>
|
||||
<a href={entry.browser_download_url}>{text}</a>,
|
||||
title: 'Name',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
render: (text, entry) => <a href={entry.browser_download_url}>{text}</a>,
|
||||
},
|
||||
{
|
||||
title: "Size",
|
||||
dataIndex: "size",
|
||||
key: "size",
|
||||
render: (text) => (`${(text/1024/1024).toFixed(2)} MB`),
|
||||
title: 'Size',
|
||||
dataIndex: 'size',
|
||||
key: 'size',
|
||||
render: text => `${(text / 1024 / 1024).toFixed(2)} MB`,
|
||||
},
|
||||
];
|
||||
|
||||
return <Table dataSource={data} columns={columns} rowKey="id" size="large" pagination={false} />
|
||||
return <Table dataSource={data} columns={columns} rowKey="id" size="large" pagination={false} />;
|
||||
}
|
||||
|
||||
|
||||
export default function Logs() {
|
||||
const [release, setRelease] = useState({
|
||||
html_url: "",
|
||||
name: "",
|
||||
html_url: '',
|
||||
name: '',
|
||||
created_at: null,
|
||||
body: "",
|
||||
body: '',
|
||||
assets: [],
|
||||
|
||||
});
|
||||
|
||||
const getRelease = async () => {
|
||||
@@ -43,7 +40,7 @@ export default function Logs() {
|
||||
const result = await getGithubRelease();
|
||||
setRelease(result);
|
||||
} catch (error) {
|
||||
console.log("==== error", error);
|
||||
console.log('==== error', error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -61,9 +58,9 @@ export default function Logs() {
|
||||
<a href={release.html_url}>{release.name}</a>
|
||||
</Title>
|
||||
<Title level={5}>{new Date(release.created_at).toDateString()}</Title>
|
||||
<ReactMarkdown>{release.body}</ReactMarkdown><h3>Downloads</h3>
|
||||
<ReactMarkdown>{release.body}</ReactMarkdown>
|
||||
<h3>Downloads</h3>
|
||||
<AssetTable {...release.assets} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user