diff --git a/frontend/web/src/components/CollectionView.tsx b/frontend/web/src/components/CollectionView.tsx index 8f40bd3..90bca8c 100644 --- a/frontend/web/src/components/CollectionView.tsx +++ b/frontend/web/src/components/CollectionView.tsx @@ -27,7 +27,8 @@ const CollectionView = (props: Props) => { const { t } = useTranslation(); const { sm } = useResponsiveWidth(); const navigateTo = useNavigateTo(); - const currentUser = useUserStore().getCurrentUser(); + const userStore = useUserStore(); + const currentUser = userStore.getCurrentUser(); const collectionStore = useCollectionStore(); const shortcutList = useShortcutStore().getShortcutList(); const [showEditDialog, setShowEditDialog] = useState(false); @@ -71,9 +72,9 @@ const CollectionView = (props: Props) => {

{collection.description}

-
+
- + {showAdminActions && ( = (props: Props) => { {isCreating ? "Create Collection" : "Edit Collection"} - +
diff --git a/frontend/web/src/components/CreateShortcutDrawer.tsx b/frontend/web/src/components/CreateShortcutDrawer.tsx index da53c4f..f6ae822 100644 --- a/frontend/web/src/components/CreateShortcutDrawer.tsx +++ b/frontend/web/src/components/CreateShortcutDrawer.tsx @@ -213,7 +213,7 @@ const CreateShortcutDrawer: React.FC = (props: Props) => { {isCreating ? "Create Shortcut" : "Edit Shortcut"} - +
diff --git a/frontend/web/src/components/ShortcutCard.tsx b/frontend/web/src/components/ShortcutCard.tsx index fdd932c..6b49c48 100644 --- a/frontend/web/src/components/ShortcutCard.tsx +++ b/frontend/web/src/components/ShortcutCard.tsx @@ -1,9 +1,11 @@ -import { Tooltip } from "@mui/joy"; +import { Avatar, Tooltip } from "@mui/joy"; import classNames from "classnames"; import copy from "copy-to-clipboard"; +import { useEffect } from "react"; import toast from "react-hot-toast"; import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; +import useUserStore from "@/stores/v1/user"; import { Shortcut } from "@/types/proto/api/v2/shortcut_service"; import { convertVisibilityFromPb } from "@/utils/visibility"; import { absolutifyLink, getFaviconWithGoogleS2 } from "../helpers/utils"; @@ -19,122 +21,135 @@ interface Props { const ShortcutCard = (props: Props) => { const { shortcut } = props; const { t } = useTranslation(); + const userStore = useUserStore(); const viewStore = useViewStore(); + const creator = userStore.getUserById(shortcut.creatorId); const shortcutLink = absolutifyLink(`/s/${shortcut.name}`); const favicon = getFaviconWithGoogleS2(shortcut.link); + useEffect(() => { + userStore.getOrFetchUserById(shortcut.creatorId); + }, []); + const handleCopyButtonClick = () => { copy(shortcutLink); toast.success("Shortcut link copied to clipboard."); }; return ( - <> -
-
- -
- -
-
-
- {shortcut.tags.map((tag) => { - return ( - viewStore.setFilter({ tag: tag })} - > - #{tag} - - ); - })} - {shortcut.tags.length === 0 && No tags} -
-
- +
+
+ -
viewStore.setFilter({ visibility: shortcut.visibility })} - > - - {t(`shortcut.visibility.${convertVisibilityFromPb(shortcut.visibility).toLowerCase()}.self`)} + {favicon ? ( + + ) : ( + + )} + +
+ - - - - - {t("shortcut.visits", { count: shortcut.viewCount })} - - + {shortcut.link} + +
+
+
+
- +
+ {shortcut.tags.map((tag) => { + return ( + viewStore.setFilter({ tag: tag })} + > + #{tag} + + ); + })} + {shortcut.tags.length === 0 && No tags} +
+
+ + + + +
viewStore.setFilter({ visibility: shortcut.visibility })} + > + + {t(`shortcut.visibility.${convertVisibilityFromPb(shortcut.visibility).toLowerCase()}.self`)} +
+
+ + + + {t("shortcut.visits", { count: shortcut.viewCount })} + + +
+
); }; diff --git a/frontend/web/src/components/SubscriptionFAQ.tsx b/frontend/web/src/components/SubscriptionFAQ.tsx index 14cf925..157af44 100644 --- a/frontend/web/src/components/SubscriptionFAQ.tsx +++ b/frontend/web/src/components/SubscriptionFAQ.tsx @@ -11,13 +11,13 @@ const SubscriptionFAQ = () => { Can I use the Free plan in my team? - Of course you can. In the free plan, you can invite up to 5 members to your team. If you need more, you can upgrade to the Pro - plan. + Of course you can. In the free plan, you can invite up to 5 members to your team. If you need more, you should upgrade to the + Pro plan. How many devices can the license key be used on? - {`It's unlimited for now, but please don't abuse it.`} + {`It's unlimited for now, but please do not abuse it.`} {`Can I get a refund if Slash doesn't meet my needs?`} diff --git a/frontend/web/src/pages/SubscriptionSetting.tsx b/frontend/web/src/pages/SubscriptionSetting.tsx index 033d6ed..a55e39b 100644 --- a/frontend/web/src/pages/SubscriptionSetting.tsx +++ b/frontend/web/src/pages/SubscriptionSetting.tsx @@ -56,7 +56,7 @@ const SubscriptionSetting: React.FC = () => {
{profile.plan === PlanType.FREE && ( - + Buy a license key