diff options
author | crupest <crupest@outlook.com> | 2022-04-10 16:04:03 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-04-10 16:04:03 +0800 |
commit | 928ba0ce419bacba113951095278a5138ead34cf (patch) | |
tree | ad4bc6b985c21e751199a25a77f36da7163a47c5 /FrontEnd/src/views/user | |
parent | 86160e4a5697615452a7e06dc78f8be4c8b2515f (diff) | |
download | timeline-928ba0ce419bacba113951095278a5138ead34cf.tar.gz timeline-928ba0ce419bacba113951095278a5138ead34cf.tar.bz2 timeline-928ba0ce419bacba113951095278a5138ead34cf.zip |
...
Diffstat (limited to 'FrontEnd/src/views/user')
-rw-r--r-- | FrontEnd/src/views/user/UserCard.tsx | 53 | ||||
-rw-r--r-- | FrontEnd/src/views/user/index.css | 0 | ||||
-rw-r--r-- | FrontEnd/src/views/user/index.tsx | 36 |
3 files changed, 0 insertions, 89 deletions
diff --git a/FrontEnd/src/views/user/UserCard.tsx b/FrontEnd/src/views/user/UserCard.tsx deleted file mode 100644 index 739d26ee..00000000 --- a/FrontEnd/src/views/user/UserCard.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import React from "react"; - -import TimelinePageCardTemplate from "../timeline-common/TimelinePageCardTemplate"; -import { TimelinePageCardProps } from "../timeline-common/TimelinePageTemplate"; -import UserAvatar from "../common/user/UserAvatar"; - -const UserCard: React.FC<TimelinePageCardProps> = (props) => { - const { timeline } = props; - - const [dialog, setDialog] = React.useState<"member" | "property" | null>( - null - ); - - return ( - <> - <TimelinePageCardTemplate - infoArea={ - <> - <h3 className="cru-color-primary d-inline-block"> - {timeline.title} - <small className="ms-3 cru-color-secondary"> - {timeline.name} - </small> - </h3> - <div> - <UserAvatar - username={timeline.owner.username} - className="cru-avatar small cru-round me-3" - /> - {timeline.owner.nickname} - </div> - </> - } - manageItems={ - timeline.manageable - ? [ - { - type: "button", - text: "timeline.manageItem.property", - onClick: () => setDialog("property"), - }, - ] - : undefined - } - dialog={dialog} - setDialog={setDialog} - {...props} - /> - </> - ); -}; - -export default UserCard; diff --git a/FrontEnd/src/views/user/index.css b/FrontEnd/src/views/user/index.css deleted file mode 100644 index e69de29b..00000000 --- a/FrontEnd/src/views/user/index.css +++ /dev/null diff --git a/FrontEnd/src/views/user/index.tsx b/FrontEnd/src/views/user/index.tsx deleted file mode 100644 index 7913b788..00000000 --- a/FrontEnd/src/views/user/index.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from "react"; -import { useParams } from "react-router-dom"; - -import TimelinePageTemplate from "../timeline-common/TimelinePageTemplate"; -import UserCard from "./UserCard"; - -import { UiLogicError } from "@/common"; - -import "./index.css"; - -const UserPage: React.FC = () => { - const { username } = useParams(); - - if (username == null) { - throw new UiLogicError("No route param 'username'."); - } - - const [reloadKey, setReloadKey] = React.useState<number>(0); - - let dialogElement: React.ReactElement | undefined; - - return ( - <> - <TimelinePageTemplate - timelineName={`@${username}`} - notFoundI18nKey="timeline.userNotExist" - reloadKey={reloadKey} - onReload={() => setReloadKey(reloadKey + 1)} - CardComponent={UserCard} - /> - {dialogElement} - </> - ); -}; - -export default UserPage; |