You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by de...@apache.org on 2024/03/29 07:12:10 UTC

(shenyu-website) branch main updated: Event List New Support Click on title to jump to details page (#1020)

This is an automated email from the ASF dual-hosted git repository.

dengliming pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/shenyu-website.git


The following commit(s) were added to refs/heads/main by this push:
     new a745d7b846 Event List New Support Click on title to jump to details page (#1020)
a745d7b846 is described below

commit a745d7b846f20b73b1439432d1fb4c29a185722e
Author: Kerwin Bryant <ke...@qq.com>
AuthorDate: Fri Mar 29 15:12:04 2024 +0800

    Event List New Support Click on title to jump to details page (#1020)
---
 src/pages/event.tsx | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/pages/event.tsx b/src/pages/event.tsx
index bc6424f1c4..28619be0ed 100644
--- a/src/pages/event.tsx
+++ b/src/pages/event.tsx
@@ -6,6 +6,9 @@ import event from '../data/event';
 import Translate from "@docusaurus/Translate";
 import { BrowserRouter as Router, Route, Link } from 'react-router-dom'
 
+function CustomLink({url, href, child}) {
+    return url ? <Link className={styles.link} to={'event/' + href}>{child}</Link> : <Link className={styles.link} to={href}>{child}</Link>
+}
 
 function Event() {
   const [url, setUrl] = useState(true)
@@ -28,12 +31,10 @@ function Event() {
             return (
               <div key={i} className={styles.cardItem} >
                 <div className={styles.cardInfo}>
-                  <div className={styles.cardTitle}>{eventItem.title}</div>
+                  <CustomLink url={url} href={eventItem.src} child={(<div className={styles.cardTitle}>{eventItem.title}</div>)}/>
                   <div className={styles.cardDesc}>{eventItem.description}</div>
                   <div className={styles.readMore}>
-                    {
-                      url ? <Link className={styles.link} to={'event/' + eventItem.src}> >> <Translate>Read More</Translate></Link> : <Link className={styles.link} to={eventItem.src}> >> <Translate>Read More</Translate></Link>
-                    }
+                    <CustomLink url={url} href={eventItem.src} child={(<> >> <Translate>Read More</Translate></>)}/>
                   </div>
                 </div>
               </div>
@@ -45,4 +46,4 @@ function Event() {
   );
 }
 
-export default Event;
\ No newline at end of file
+export default Event;