|
@@ -1,14 +1,14 @@
|
|
|
-import "./ArticleList.sass";
|
|
|
|
|
import { useDispatch, useSelector } from "react-redux";
|
|
import { useDispatch, useSelector } from "react-redux";
|
|
|
import {
|
|
import {
|
|
|
fetchCodimd,
|
|
fetchCodimd,
|
|
|
selectAllCodimd,
|
|
selectAllCodimd,
|
|
|
selectCodimdState,
|
|
selectCodimdState,
|
|
|
-} from "../Redux/CodimdReducer";
|
|
|
|
|
|
|
+} from "../../Redux/CodimdReducer";
|
|
|
import ArticleListUnitComponent from "./ArticleListUnitComponent";
|
|
import ArticleListUnitComponent from "./ArticleListUnitComponent";
|
|
|
import { useEffect } from "react";
|
|
import { useEffect } from "react";
|
|
|
-import { Status } from "../Redux/CodimdReducer";
|
|
|
|
|
import { AnyAction, Dispatch } from "@reduxjs/toolkit";
|
|
import { AnyAction, Dispatch } from "@reduxjs/toolkit";
|
|
|
|
|
+import { Status } from "../../Redux/Store";
|
|
|
|
|
+import { selectWidth } from "../../Redux/WidthReducer";
|
|
|
|
|
|
|
|
function getList(codimdStatus: Status, dispatch: Dispatch<AnyAction>): void {
|
|
function getList(codimdStatus: Status, dispatch: Dispatch<AnyAction>): void {
|
|
|
if (codimdStatus === "idle") {
|
|
if (codimdStatus === "idle") {
|
|
@@ -17,6 +17,8 @@ function getList(codimdStatus: Status, dispatch: Dispatch<AnyAction>): void {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function ArticleList() {
|
|
function ArticleList() {
|
|
|
|
|
+ const width = useSelector(selectWidth);
|
|
|
|
|
+
|
|
|
const dispatch = useDispatch();
|
|
const dispatch = useDispatch();
|
|
|
|
|
|
|
|
const codimd = useSelector(selectAllCodimd);
|
|
const codimd = useSelector(selectAllCodimd);
|
|
@@ -42,7 +44,16 @@ function ArticleList() {
|
|
|
content = <div>{articleList}</div>;
|
|
content = <div>{articleList}</div>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return <div>{content}</div>;
|
|
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div
|
|
|
|
|
+ style={{
|
|
|
|
|
+ maxWidth: `${width < 1000 ? 600 : width / 2}px`,
|
|
|
|
|
+ margin: "0 auto",
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {content}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export default ArticleList;
|
|
export default ArticleList;
|