Просмотр исходного кода

Add new content link button on user page for activity log

arvid-e 3 месяцев назад
Родитель
Сommit
4041196cf6

+ 18 - 0
apps/app/src/client/components/ContentLinkButtons.tsx

@@ -38,6 +38,23 @@ const RecentlyCreatedLinkButton = React.memo(() => {
 
 
 RecentlyCreatedLinkButton.displayName = 'RecentlyCreatedLinkButton';
 RecentlyCreatedLinkButton.displayName = 'RecentlyCreatedLinkButton';
 
 
+const RecentActivityLinkButton = React.memo(() => {
+  const { t } = useTranslation();
+  return (
+    <ScrollLink to="recent-activity-list" offset={-120}>
+      <button
+        type="button"
+        className="btn btn-sm btn-outline-neutral-secondary rounded-pill d-flex align-items-center w-100 px-3"
+      >
+        <span className="material-symbols-outlined mx-1">update</span>
+        <span>{t('user_home_page.recent_activity')}</span>
+      </button>
+    </ScrollLink>
+  );
+});
+
+RecentActivityLinkButton.displayName = 'RecentActivityLinkButton';
+
 
 
 export type ContentLinkButtonsProps = {
 export type ContentLinkButtonsProps = {
   author?: IUserHasId,
   author?: IUserHasId,
@@ -54,6 +71,7 @@ export const ContentLinkButtons = (props: ContentLinkButtonsProps): JSX.Element
     <div className="d-grid gap-2">
     <div className="d-grid gap-2">
       <BookMarkLinkButton />
       <BookMarkLinkButton />
       <RecentlyCreatedLinkButton />
       <RecentlyCreatedLinkButton />
+      <RecentActivityLinkButton />
     </div>
     </div>
   );
   );
 };
 };

+ 2 - 2
apps/app/src/client/components/UsersHomepageFooter.tsx

@@ -47,11 +47,11 @@ export const UsersHomepageFooter = (props: UsersHomepageFooterProps): JSX.Elemen
           <RecentCreated userId={creatorId} />
           <RecentCreated userId={creatorId} />
         </div>
         </div>
 
 
-        <h2 id="user-created-list" className="grw-user-page-header border-bottom pb-2 mb-3 d-flex">
+        <h2 id="recent-activity-list" className="grw-user-page-header border-bottom pb-2 mb-3 d-flex">
           <span className="material-symbols-outlined me-1 fs-1">update</span>
           <span className="material-symbols-outlined me-1 fs-1">update</span>
           {t('user_home_page.recent_activity')}
           {t('user_home_page.recent_activity')}
         </h2>
         </h2>
-        <div id="user-created-list" className={`page-list ${styles['page-list']}`}>
+        <div id="recent-activity-list" className={`page-list ${styles['page-list']}`}>
           <RecentActivity userId={creatorId} />
           <RecentActivity userId={creatorId} />
         </div>
         </div>
       </div>
       </div>