Skip to content

Commit

Permalink
fix: fix bugs (#2171)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzdhybthu authored Jan 14, 2025
1 parent c8983b9 commit bd2d161
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/HomeSite/ContestPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const Contest1 = () => (
src={`${process.env.REACT_APP_STATIC_URL!}/public/images/2024/2024_THUAI_5.jpg`}
width={800}
/>
<P>THUAI5——机算夺魁</P>
<P>THUAI5——机算挑魁</P>
<P></P>
<Image
alt="THUAI_4_cover"
Expand Down
29 changes: 29 additions & 0 deletions src/app/ShareSite/CoursePage/CourseDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// 课程详情页面只有课程管理员可以编辑,普通学生只能查看
import React, { useState, useRef, useEffect } from "react";
import Markdown from "react-markdown";
import {
Badge,
Button,
Expand Down Expand Up @@ -64,11 +65,39 @@ const CourseDetail: React.FC<CourseProps> = ({
title: "项目",
dataIndex: "key",
key: "key",
render: (dom: React.ReactNode, entity: any) => (
<div
style={{
wordWrap: "break-word",
wordBreak: "break-word",
whiteSpace: "normal",
}}
>
<Markdown>{entity.key}</Markdown>
</div>
),
},
{
title: "内容",
dataIndex: "value",
key: "value",
render: (dom: React.ReactNode, entity: any) => (
<div
style={{
wordWrap: "break-word",
wordBreak: "break-word",
whiteSpace: "normal",
}}
>
{entity.value && entity.value.startsWith("http") ? (
<a href={entity.value} target="_blank" rel="noopener noreferrer">
{entity.value}
</a>
) : (
<Markdown>{entity.value || ""}</Markdown>
)}
</div>
),
},
{
title: "操作",
Expand Down
6 changes: 2 additions & 4 deletions src/app/ShareSite/CoursePage/DiscussDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,7 @@ const DiscussDrawer: React.FC<CourseProps> = ({
text=" "
/>
)}
{(user.role === "admin" ||
item.user_uuid === user.uuid) && (
{(isManager || item.user_uuid === user.uuid) && (
<IconText
icon={DeleteOutlined}
text=""
Expand Down Expand Up @@ -877,6 +876,7 @@ const DiscussDrawer: React.FC<CourseProps> = ({
fontWeight: "bold",
fontSize: "1.3em",
wordWrap: "break-word",
wordBreak: "break-word",
whiteSpace: "pre-wrap",
maxWidth: "90%",
display: "inline-block",
Expand Down Expand Up @@ -927,8 +927,6 @@ const DiscussDrawer: React.FC<CourseProps> = ({
) : (
item.comment
)}
<br />
<br />
</span>
<br />

Expand Down

0 comments on commit bd2d161

Please sign in to comment.