Skip to content

Commit cf90f25

Browse files
authored
1 (#2144)
1 parent 8ec0695 commit cf90f25

File tree

4 files changed

+66
-64
lines changed

4 files changed

+66
-64
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"grpc-web": "1.5.0",
2020
"is-url": "1.2.4",
2121
"jwt-decode": "4.0.0",
22-
"react": "19.0.0",
22+
"react": "18.3.1",
2323
"react-cropper": "2.3.3",
2424
"react-custom-scrollbars": "4.2.1",
25-
"react-dom": "19.0.0",
25+
"react-dom": "18.3.1",
2626
"react-markdown": "9.0.1",
2727
"react-otp-input": "3.1.1",
2828
"react-router-dom": "7.0.2",
@@ -38,9 +38,9 @@
3838
"@playwright/test": "1.49.1",
3939
"@types/is-url": "1.2.32",
4040
"@types/node": "22.10.2",
41-
"@types/react": "19.0.2",
41+
"@types/react": "18.3.14",
4242
"@types/react-custom-scrollbars": "4.0.13",
43-
"@types/react-dom": "19.0.2",
43+
"@types/react-dom": "18.3.2",
4444
"@types/react-router-dom": "5.3.3",
4545
"@types/styled-components": "5.1.34",
4646
"babel-plugin-styled-components": "2.1.4",

src/app/HomeSite/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const InfiniteScrollContainer: React.FC<ScrollContainerProps> = ({
108108
const [isScrolling] = useState(false);
109109
const [content, setContent] = useState<React.ReactNode[]>([]); // To hold original and cloned content
110110
const isPaused = useRef(false);
111-
const animationFrameRef = useRef<number>(null);
111+
const animationFrameRef = useRef<number>(0);
112112

113113
useEffect(() => {
114114
// Set the content (original + duplicate) only when the children change

src/app/ShareSite/CoursePage/CourseDetail.tsx

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -74,29 +74,26 @@ const CourseDetail: React.FC<CourseProps> = ({
7474
valueType: "option",
7575
width: "20%",
7676
key: "option",
77-
disable: true,
77+
hideInTable: !course_manager?.course_manager_by_pk,
7878
render: (_, row) => {
79-
// console.log(course_manager);
80-
if (course_manager?.course_manager_by_pk != null)
81-
return (
82-
<Space size="middle">
83-
<Button
84-
type="link"
85-
onClick={() => {
86-
setCurrentRow(row);
87-
setNewKey(row.key);
88-
setNewValue(String(row.value));
89-
setUpdateInfoModalVisible(true);
90-
}}
91-
>
92-
修改
93-
</Button>
94-
<Button type="link" onClick={() => showDeleteConfirm(row)}>
95-
删除
96-
</Button>
97-
</Space>
98-
);
99-
else return <></>;
79+
return course_manager?.course_manager_by_pk ? (
80+
<Space size="middle">
81+
<Button
82+
type="link"
83+
onClick={() => {
84+
setCurrentRow(row);
85+
setNewKey(row.key);
86+
setNewValue(String(row.value));
87+
setUpdateInfoModalVisible(true);
88+
}}
89+
>
90+
修改
91+
</Button>
92+
<Button type="link" onClick={() => showDeleteConfirm(row)}>
93+
删除
94+
</Button>
95+
</Space>
96+
) : null;
10097
},
10198
},
10299
];
@@ -290,18 +287,17 @@ const CourseDetail: React.FC<CourseProps> = ({
290287
}
291288
onClick={handleGetCourseDetail}
292289
/>
293-
<Button
294-
type="link"
295-
icon={
296-
<PlusOutlined
297-
style={{ fontSize: "1.5em", color: "#1890ff" }}
298-
/>
299-
}
300-
onClick={() => {
301-
if (course_manager?.course_manager_by_pk != null)
302-
setAddInfoModalVisible(true);
303-
}}
304-
/>
290+
{course_manager?.course_manager_by_pk ? (
291+
<Button
292+
type="link"
293+
icon={
294+
<PlusOutlined
295+
style={{ fontSize: "1.5em", color: "#1890ff" }}
296+
/>
297+
}
298+
onClick={() => setAddInfoModalVisible(true)}
299+
/>
300+
) : null}
305301
</Space>
306302
</div>
307303
}
@@ -338,7 +334,7 @@ const CourseDetail: React.FC<CourseProps> = ({
338334
labelWidth: "auto",
339335
}}
340336
dateFormatter="string"
341-
headerTitle="课程列表"
337+
headerTitle="详情列表"
342338
/>
343339
</Card>
344340
</Drawer>

yarn.lock

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3500,6 +3500,11 @@
35003500
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f"
35013501
integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==
35023502

3503+
"@types/prop-types@*":
3504+
version "15.7.14"
3505+
resolved "https://registry.npmmirror.com/@types/prop-types/-/prop-types-15.7.14.tgz#1433419d73b2a7ebfc6918dcefd2ec0d5cd698f2"
3506+
integrity sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==
3507+
35033508
"@types/q@^1.5.1":
35043509
version "1.5.8"
35053510
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.8.tgz#95f6c6a08f2ad868ba230ead1d2d7f7be3db3837"
@@ -3522,10 +3527,12 @@
35223527
dependencies:
35233528
"@types/react" "*"
35243529

3525-
3526-
version "19.0.2"
3527-
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-19.0.2.tgz#ad21f9a1ee881817995fd3f7fd33659c87e7b1b7"
3528-
integrity sha512-c1s+7TKFaDRRxr1TxccIX2u7sfCnc3RxkVyBIUA2lCpyqCF+QoAwQ/CBg7bsMdVwP120HEH143VQezKtef5nCg==
3530+
3531+
version "18.3.2"
3532+
resolved "https://registry.npmmirror.com/@types/react-dom/-/react-dom-18.3.2.tgz#b58a9520f5f317a00bbda0271502889b71c345f0"
3533+
integrity sha512-Fqp+rcvem9wEnGr3RY8dYNvSQ8PoLqjZ9HLgaPUOjJJD120uDyOxOjc/39M4Kddp9JQCxpGQbnhVQF0C0ncYVg==
3534+
dependencies:
3535+
"@types/react" "^18"
35293536

35303537
35313538
version "5.3.3"
@@ -3544,13 +3551,29 @@
35443551
"@types/history" "^4.7.11"
35453552
"@types/react" "*"
35463553

3547-
"@types/react@*", "@types/[email protected]":
3554+
"@types/react@*":
35483555
version "19.0.2"
35493556
resolved "https://registry.yarnpkg.com/@types/react/-/react-19.0.2.tgz#9363e6b3ef898c471cb182dd269decc4afc1b4f6"
35503557
integrity sha512-USU8ZI/xyKJwFTpjSVIrSeHBVAGagkHQKPNbxeWwql/vDmnTIBgx+TJnhFnj1NXgz8XfprU0egV2dROLGpsBEg==
35513558
dependencies:
35523559
csstype "^3.0.2"
35533560

3561+
3562+
version "18.3.14"
3563+
resolved "https://registry.npmmirror.com/@types/react/-/react-18.3.14.tgz#7ce43bbca0e15e1c4f67ad33ea3f83d75aa6756b"
3564+
integrity sha512-NzahNKvjNhVjuPBQ+2G7WlxstQ+47kXZNHlUvFakDViuIEfGY926GqhMueQFZ7woG+sPiQKlF36XfrIUVSUfFg==
3565+
dependencies:
3566+
"@types/prop-types" "*"
3567+
csstype "^3.0.2"
3568+
3569+
"@types/react@^18":
3570+
version "18.3.18"
3571+
resolved "https://registry.npmmirror.com/@types/react/-/react-18.3.18.tgz#9b382c4cd32e13e463f97df07c2ee3bbcd26904b"
3572+
integrity sha512-t4yC+vtgnkYjNSKlFx1jkAhH8LgTo2N/7Qvi83kdEaUtMDiwpbLAktKDaAMlRcJ5eSxZkH74eEGt1ky31d7kfQ==
3573+
dependencies:
3574+
"@types/prop-types" "*"
3575+
csstype "^3.0.2"
3576+
35543577
35553578
version "1.17.1"
35563579
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6"
@@ -11756,14 +11779,7 @@ react-dev-utils@^12.0.1:
1175611779
strip-ansi "^6.0.1"
1175711780
text-table "^0.2.0"
1175811781

11759-
11760-
version "19.0.0"
11761-
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.0.0.tgz#43446f1f01c65a4cd7f7588083e686a6726cfb57"
11762-
integrity sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==
11763-
dependencies:
11764-
scheduler "^0.25.0"
11765-
11766-
react-dom@^18.3.1:
11782+
[email protected], react-dom@^18.3.1:
1176711783
version "18.3.1"
1176811784
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4"
1176911785
integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
@@ -11913,12 +11929,7 @@ [email protected]:
1191311929
resolved "https://registry.yarnpkg.com/react-unity-webgl/-/react-unity-webgl-9.7.0.tgz#46eb91743a9ae1ae3553ab91957fab5dfafc459b"
1191411930
integrity sha512-j+Q/kfqpOt803G2xf4bn2N2REjmZGilG7kx3FQcOOUnCUvV+moP+TeY1w2HgsiYPZjLuzqw8Hx35KtlTWlHBwA==
1191511931

11916-
11917-
version "19.0.0"
11918-
resolved "https://registry.yarnpkg.com/react/-/react-19.0.0.tgz#6e1969251b9f108870aa4bff37a0ce9ddfaaabdd"
11919-
integrity sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==
11920-
11921-
react@^18.3.1:
11932+
[email protected], react@^18.3.1:
1192211933
version "18.3.1"
1192311934
resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891"
1192411935
integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
@@ -12392,11 +12403,6 @@ scheduler@^0.23.2:
1239212403
dependencies:
1239312404
loose-envify "^1.1.0"
1239412405

12395-
scheduler@^0.25.0:
12396-
version "0.25.0"
12397-
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0.tgz#336cd9768e8cceebf52d3c80e3dcf5de23e7e015"
12398-
integrity sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==
12399-
1240012406
1240112407
version "2.7.0"
1240212408
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.0.tgz#17151f76d8eae67fbbf77960c33c676ad9f4efc7"

0 commit comments

Comments
 (0)