Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

🧹 refactor: Remove FC type annotations from functional components for cleaner code: v5 (#rm-fc)

Summary: Removed `FC` type annotations from functional components for cleaner code.

Highlights:

• Updated component definitions to remove `FC` type annotations, simplifying the code.
• Adjusted props destructuring in components to maintain type safety.
• Removed unused imports of `FC` from various files.

Read more: https://pierre.co/yo/hey/rm-fc

authored by yoginth.com and committed by

Pierre 341eaf06 1e292cbf

+64 -101
+1 -2
apps/web/src/components/Post/Actions/Comment.tsx
··· 4 4 import type { PostFragment } from "@hey/indexer"; 5 5 import { Tooltip } from "@hey/ui"; 6 6 import { useRouter } from "next/router"; 7 - import type { FC } from "react"; 8 7 9 8 interface CommentProps { 10 9 post: PostFragment; 11 10 showCount: boolean; 12 11 } 13 12 14 - const Comment: FC<CommentProps> = ({ post, showCount }) => { 13 + const Comment = ({ post, showCount }: CommentProps) => { 15 14 const { push } = useRouter(); 16 15 const count = post.stats.comments; 17 16 const iconClassName = showCount
+1 -2
apps/web/src/components/Post/Actions/Like.tsx
··· 16 16 import { Tooltip } from "@hey/ui"; 17 17 import cn from "@hey/ui/cn"; 18 18 import { useCounter, useToggle } from "@uidotdev/usehooks"; 19 - import type { FC } from "react"; 20 19 import toast from "react-hot-toast"; 21 20 import { useAccountStatus } from "src/store/non-persisted/useAccountStatus"; 22 21 import { useAccountStore } from "src/store/persisted/useAccountStore"; ··· 26 25 showCount: boolean; 27 26 } 28 27 29 - const Like: FC<LikeProps> = ({ post, showCount }) => { 28 + const Like = ({ post, showCount }: LikeProps) => { 30 29 const { currentAccount } = useAccountStore(); 31 30 const { isSuspended } = useAccountStatus(); 32 31
+1 -2
apps/web/src/components/Post/Actions/Menu/Bookmark.tsx
··· 12 12 } from "@hey/indexer"; 13 13 import cn from "@hey/ui/cn"; 14 14 import { useRouter } from "next/router"; 15 - import type { FC } from "react"; 16 15 import { toast } from "react-hot-toast"; 17 16 18 17 interface BookmarkProps { 19 18 post: PostFragment; 20 19 } 21 20 22 - const Bookmark: FC<BookmarkProps> = ({ post }) => { 21 + const Bookmark = ({ post }: BookmarkProps) => { 23 22 const { pathname } = useRouter(); 24 23 const hasBookmarked = post.operations?.hasBookmarked; 25 24
+1 -2
apps/web/src/components/Post/Actions/Menu/CopyPostText.tsx
··· 4 4 import stopEventPropagation from "@hey/helpers/stopEventPropagation"; 5 5 import type { PostFragment } from "@hey/indexer"; 6 6 import cn from "@hey/ui/cn"; 7 - import type { FC } from "react"; 8 7 import toast from "react-hot-toast"; 9 8 10 9 interface CopyPostTextProps { 11 10 post: PostFragment; 12 11 } 13 12 14 - const CopyPostText: FC<CopyPostTextProps> = ({ post }) => { 13 + const CopyPostText = ({ post }: CopyPostTextProps) => { 15 14 const filteredContent = getPostData(post.metadata)?.content || ""; 16 15 17 16 return (
+1 -2
apps/web/src/components/Post/Actions/Menu/Delete.tsx
··· 3 3 import stopEventPropagation from "@hey/helpers/stopEventPropagation"; 4 4 import type { PostFragment } from "@hey/indexer"; 5 5 import cn from "@hey/ui/cn"; 6 - import type { FC } from "react"; 7 6 import { useDeletePostAlertStore } from "src/store/non-persisted/alert/useDeletePostAlertStore"; 8 7 9 8 interface DeleteProps { 10 9 post: PostFragment; 11 10 } 12 11 13 - const Delete: FC<DeleteProps> = ({ post }) => { 12 + const Delete = ({ post }: DeleteProps) => { 14 13 const { setShowPostDeleteAlert } = useDeletePostAlertStore(); 15 14 16 15 return (
+1 -2
apps/web/src/components/Post/Actions/Menu/HideComment.tsx
··· 10 10 useUnhideReplyMutation 11 11 } from "@hey/indexer"; 12 12 import cn from "@hey/ui/cn"; 13 - import type { FC } from "react"; 14 13 import { toast } from "react-hot-toast"; 15 14 import { useAccountStore } from "src/store/persisted/useAccountStore"; 16 15 ··· 18 17 post: PostFragment; 19 18 } 20 19 21 - const HideComment: FC<HideCommentProps> = ({ post }) => { 20 + const HideComment = ({ post }: HideCommentProps) => { 22 21 const { currentAccount } = useAccountStore(); 23 22 const { showHiddenComments } = useHiddenCommentFeedStore(); 24 23
+1 -2
apps/web/src/components/Post/Actions/Menu/NotInterested.tsx
··· 11 11 useUndoPostNotInterestedMutation 12 12 } from "@hey/indexer"; 13 13 import cn from "@hey/ui/cn"; 14 - import type { FC } from "react"; 15 14 import { toast } from "react-hot-toast"; 16 15 17 16 interface NotInterestedProps { 18 17 post: PostFragment; 19 18 } 20 19 21 - const NotInterested: FC<NotInterestedProps> = ({ post }) => { 20 + const NotInterested = ({ post }: NotInterestedProps) => { 22 21 const notInterested = post.operations?.isNotInterested; 23 22 24 23 const request: PostNotInterestedRequest = {
+1 -2
apps/web/src/components/Post/Actions/Menu/Report.tsx
··· 3 3 import stopEventPropagation from "@hey/helpers/stopEventPropagation"; 4 4 import type { PostFragment } from "@hey/indexer"; 5 5 import cn from "@hey/ui/cn"; 6 - import type { FC } from "react"; 7 6 import { useReportPostModalStore } from "src/store/non-persisted/modal/useReportPostModalStore"; 8 7 9 8 interface ReportProps { 10 9 post: PostFragment; 11 10 } 12 11 13 - const Report: FC<ReportProps> = ({ post }) => { 12 + const Report = ({ post }: ReportProps) => { 14 13 const { setShowReportPostModal } = useReportPostModalStore(); 15 14 16 15 return (
+1 -2
apps/web/src/components/Post/Actions/Menu/Share.tsx
··· 3 3 import stopEventPropagation from "@hey/helpers/stopEventPropagation"; 4 4 import type { PostFragment } from "@hey/indexer"; 5 5 import cn from "@hey/ui/cn"; 6 - import type { FC } from "react"; 7 6 import toast from "react-hot-toast"; 8 7 9 8 interface ShareProps { 10 9 post: PostFragment; 11 10 } 12 11 13 - const Share: FC<ShareProps> = ({ post }) => { 12 + const Share = ({ post }: ShareProps) => { 14 13 return ( 15 14 <MenuItem 16 15 as="div"
+1 -2
apps/web/src/components/Post/Actions/Menu/index.tsx
··· 4 4 import stopEventPropagation from "@hey/helpers/stopEventPropagation"; 5 5 import type { PostFragment } from "@hey/indexer"; 6 6 import cn from "@hey/ui/cn"; 7 - import type { FC } from "react"; 8 7 import { Fragment } from "react"; 9 8 import { useAccountStore } from "src/store/persisted/useAccountStore"; 10 9 import Bookmark from "./Bookmark"; ··· 19 18 post: PostFragment; 20 19 } 21 20 22 - const PostMenu: FC<PostMenuProps> = ({ post }) => { 21 + const PostMenu = ({ post }: PostMenuProps) => { 23 22 const { currentAccount } = useAccountStore(); 24 23 const iconClassName = "w-[15px] sm:w-[18px]"; 25 24
+1 -2
apps/web/src/components/Post/Actions/Share/Quote.tsx
··· 3 3 import { Errors } from "@hey/data/errors"; 4 4 import type { PostFragment } from "@hey/indexer"; 5 5 import cn from "@hey/ui/cn"; 6 - import type { FC } from "react"; 7 6 import toast from "react-hot-toast"; 8 7 import { useNewPostModalStore } from "src/store/non-persisted/modal/useNewPostModalStore"; 9 8 import { usePostStore } from "src/store/non-persisted/post/usePostStore"; ··· 14 13 post: PostFragment; 15 14 } 16 15 17 - const Quote: FC<QuoteProps> = ({ post }) => { 16 + const Quote = ({ post }: QuoteProps) => { 18 17 const { currentAccount } = useAccountStore(); 19 18 const { setShowNewPostModal } = useNewPostModalStore(); 20 19 const { setQuotedPost } = usePostStore();
+2 -2
apps/web/src/components/Post/Actions/Share/Repost.tsx
··· 12 12 } from "@hey/indexer"; 13 13 import cn from "@hey/ui/cn"; 14 14 import { useCounter } from "@uidotdev/usehooks"; 15 - import type { Dispatch, FC, SetStateAction } from "react"; 15 + import type { Dispatch, SetStateAction } from "react"; 16 16 import { toast } from "react-hot-toast"; 17 17 import useTransactionLifecycle from "src/hooks/useTransactionLifecycle"; 18 18 import { useAccountStatus } from "src/store/non-persisted/useAccountStatus"; ··· 24 24 setIsSubmitting: Dispatch<SetStateAction<boolean>>; 25 25 } 26 26 27 - const Repost: FC<RepostProps> = ({ isSubmitting, post, setIsSubmitting }) => { 27 + const Repost = ({ isSubmitting, post, setIsSubmitting }: RepostProps) => { 28 28 const { currentAccount } = useAccountStore(); 29 29 const { isSuspended } = useAccountStatus(); 30 30 const hasReposted =
+3 -3
apps/web/src/components/Post/Actions/Share/UndoRepost.tsx
··· 6 6 import { isRepost } from "@hey/helpers/postHelpers"; 7 7 import { type AnyPostFragment, useDeletePostMutation } from "@hey/indexer"; 8 8 import cn from "@hey/ui/cn"; 9 - import type { Dispatch, FC, SetStateAction } from "react"; 9 + import type { Dispatch, SetStateAction } from "react"; 10 10 import { toast } from "react-hot-toast"; 11 11 import useTransactionLifecycle from "src/hooks/useTransactionLifecycle"; 12 12 import { useAccountStore } from "src/store/persisted/useAccountStore"; ··· 17 17 setIsSubmitting: Dispatch<SetStateAction<boolean>>; 18 18 } 19 19 20 - const UndoRepost: FC<UndoRepostProps> = ({ 20 + const UndoRepost = ({ 21 21 post, 22 22 isSubmitting, 23 23 setIsSubmitting 24 - }) => { 24 + }: UndoRepostProps) => { 25 25 const { currentAccount } = useAccountStore(); 26 26 const { cache } = useApolloClient(); 27 27 const handleTransactionLifecycle = useTransactionLifecycle();
+1 -2
apps/web/src/components/Post/Actions/Share/index.tsx
··· 8 8 import type { AnyPostFragment } from "@hey/indexer"; 9 9 import { Spinner, Tooltip } from "@hey/ui"; 10 10 import cn from "@hey/ui/cn"; 11 - import type { FC } from "react"; 12 11 import { useState } from "react"; 13 12 import Quote from "./Quote"; 14 13 import Repost from "./Repost"; ··· 19 18 showCount: boolean; 20 19 } 21 20 22 - const ShareMenu: FC<ShareMenuProps> = ({ post, showCount }) => { 21 + const ShareMenu = ({ post, showCount }: ShareMenuProps) => { 23 22 const [isSubmitting, setIsSubmitting] = useState(false); 24 23 const targetPost = isRepost(post) ? post?.repostOf : post; 25 24 const hasReposted =
+1 -2
apps/web/src/components/Post/Actions/index.tsx
··· 1 1 import { isRepost } from "@hey/helpers/postHelpers"; 2 2 import stopEventPropagation from "@hey/helpers/stopEventPropagation"; 3 3 import type { AnyPostFragment } from "@hey/indexer"; 4 - import type { FC } from "react"; 5 4 import { memo } from "react"; 6 5 import CollectAction from "../OpenAction/CollectAction"; 7 6 import SmallCollectButton from "../OpenAction/CollectAction/SmallCollectButton"; ··· 15 14 showCount?: boolean; 16 15 } 17 16 18 - const PostActions: FC<PostActionsProps> = ({ post, showCount = false }) => { 17 + const PostActions = ({ post, showCount = false }: PostActionsProps) => { 19 18 const targetPost = isRepost(post) ? post.repostOf : post; 20 19 const hasPostAction = (targetPost.actions?.length || 0) > 0; 21 20 const canAct =
+3 -3
apps/web/src/components/Post/OpenAction/CollectAction/CollectActionBody.tsx
··· 28 28 import { useCounter } from "@uidotdev/usehooks"; 29 29 import Link from "next/link"; 30 30 import plur from "plur"; 31 - import { type Dispatch, type FC, type SetStateAction, useState } from "react"; 31 + import { type Dispatch, type SetStateAction, useState } from "react"; 32 32 import CollectActionButton from "./CollectActionButton"; 33 33 import Splits from "./Splits"; 34 34 ··· 37 37 setShowCollectModal: Dispatch<SetStateAction<boolean>>; 38 38 } 39 39 40 - const CollectActionBody: FC<CollectActionBodyProps> = ({ 40 + const CollectActionBody = ({ 41 41 post, 42 42 setShowCollectModal 43 - }) => { 43 + }: CollectActionBodyProps) => { 44 44 const [showCollectorsModal, setShowCollectorsModal] = useState(false); 45 45 const targetPost = isRepost(post) ? post?.repostOf : post; 46 46 const [collects, { increment }] = useCounter(targetPost.stats.collects);
+2 -3
apps/web/src/components/Post/OpenAction/CollectAction/CollectActionButton.tsx
··· 14 14 useExecutePostActionMutation 15 15 } from "@hey/indexer"; 16 16 import { Button, WarningMessage } from "@hey/ui"; 17 - import type { FC } from "react"; 18 17 import { useState } from "react"; 19 18 import toast from "react-hot-toast"; 20 19 import useTransactionLifecycle from "src/hooks/useTransactionLifecycle"; ··· 30 29 post: PostFragment; 31 30 } 32 31 33 - const CollectActionButton: FC<CollectActionButtonProps> = ({ 32 + const CollectActionButton = ({ 34 33 collects, 35 34 onCollectSuccess = () => {}, 36 35 postAction, 37 36 post 38 - }) => { 37 + }: CollectActionButtonProps) => { 39 38 const collectAction = getCollectActionData(postAction as any); 40 39 const { currentAccount } = useAccountStore(); 41 40 const { isSuspended } = useAccountStatus();
+1 -2
apps/web/src/components/Post/OpenAction/CollectAction/SmallCollectButton.tsx
··· 1 1 import type { PostFragment } from "@hey/indexer"; 2 2 import { Button, Modal } from "@hey/ui"; 3 - import type { FC } from "react"; 4 3 import { useState } from "react"; 5 4 import CollectActionBody from "./CollectActionBody"; 6 5 ··· 8 7 post: PostFragment; 9 8 } 10 9 11 - const SmallCollectButton: FC<SmallCollectButtonProps> = ({ post }) => { 10 + const SmallCollectButton = ({ post }: SmallCollectButtonProps) => { 12 11 const [showCollectModal, setShowCollectModal] = useState(false); 13 12 const hasSimpleCollected = post.operations?.hasSimpleCollected; 14 13
+1 -2
apps/web/src/components/Post/OpenAction/CollectAction/Splits.tsx
··· 6 6 import { type RecipientPercent, useAccountsBulkQuery } from "@hey/indexer"; 7 7 import { Image } from "@hey/ui"; 8 8 import Link from "next/link"; 9 - import type { FC } from "react"; 10 9 11 10 interface SplitsProps { 12 11 recipients: RecipientPercent[]; 13 12 } 14 13 15 - const Splits: FC<SplitsProps> = ({ recipients }) => { 14 + const Splits = ({ recipients }: SplitsProps) => { 16 15 const { data: recipientProfilesData, loading } = useAccountsBulkQuery({ 17 16 skip: !recipients?.length, 18 17 variables: {
+2 -2
apps/web/src/components/Post/OpenAction/CollectAction/index.tsx
··· 4 4 import type { PostFragment } from "@hey/indexer"; 5 5 import { Modal, Tooltip } from "@hey/ui"; 6 6 import plur from "plur"; 7 - import { type FC, useState } from "react"; 7 + import { useState } from "react"; 8 8 import CollectActionBody from "./CollectActionBody"; 9 9 10 10 interface CollectActionProps { 11 11 post: PostFragment; 12 12 } 13 13 14 - const CollectAction: FC<CollectActionProps> = ({ post }) => { 14 + const CollectAction = ({ post }: CollectActionProps) => { 15 15 const [showCollectModal, setShowCollectModal] = useState(false); 16 16 const { collects } = post.stats; 17 17
+2 -2
apps/web/src/components/Post/OpenAction/TipAction/Action.tsx
··· 13 13 } from "@hey/indexer"; 14 14 import { Button, Input, Spinner } from "@hey/ui"; 15 15 import cn from "@hey/ui/cn"; 16 - import type { ChangeEvent, FC, RefObject } from "react"; 16 + import type { ChangeEvent, RefObject } from "react"; 17 17 import { useRef, useState } from "react"; 18 18 import toast from "react-hot-toast"; 19 19 import usePreventScrollOnNumberInput from "src/hooks/usePreventScrollOnNumberInput"; ··· 30 30 post: PostFragment; 31 31 } 32 32 33 - const Action: FC<ActionProps> = ({ closePopover, post }) => { 33 + const Action = ({ closePopover, post }: ActionProps) => { 34 34 const { currentAccount } = useAccountStore(); 35 35 const { isSuspended } = useAccountStatus(); 36 36 const [isSubmitting, setIsSubmitting] = useState(false);
+1 -2
apps/web/src/components/Post/OpenAction/TipAction/index.tsx
··· 6 6 import type { PostFragment } from "@hey/indexer"; 7 7 import { Tooltip } from "@hey/ui"; 8 8 import cn from "@hey/ui/cn"; 9 - import type { FC } from "react"; 10 9 import Action from "./Action"; 11 10 12 11 interface TipActionProps { ··· 14 13 showCount: boolean; 15 14 } 16 15 17 - const TipAction: FC<TipActionProps> = ({ post, showCount }) => { 16 + const TipAction = ({ post, showCount }: TipActionProps) => { 18 17 const hasTipped = post.operations?.hasTipped; 19 18 const { tips } = post.stats; 20 19
+1 -2
apps/web/src/components/Post/PostStats.tsx
··· 6 6 import { Modal } from "@hey/ui"; 7 7 import Link from "next/link"; 8 8 import plur from "plur"; 9 - import type { FC } from "react"; 10 9 import { memo, useState } from "react"; 11 10 12 11 interface PostStatsProps { 13 12 post: PostFragment; 14 13 } 15 14 16 - const PostStats: FC<PostStatsProps> = ({ post }) => { 15 + const PostStats = ({ post }: PostStatsProps) => { 17 16 const [showLikesModal, setShowLikesModal] = useState(false); 18 17 const [showRepostsModal, setShowRepostsModal] = useState(false); 19 18 const [showCollectorsModal, setShowCollectorsModal] = useState(false);
+1 -2
apps/web/src/components/Post/QuotedPost.tsx
··· 1 1 import PostWrapper from "@components/Shared/PostWrapper"; 2 2 import type { PostFragment } from "@hey/indexer"; 3 - import type { FC } from "react"; 4 3 import HiddenPost from "./HiddenPost"; 5 4 import PostAvatar from "./PostAvatar"; 6 5 import PostBody from "./PostBody"; ··· 11 10 post: PostFragment; 12 11 } 13 12 14 - const QuotedPost: FC<QuotedPostProps> = ({ isNew = false, post }) => { 13 + const QuotedPost = ({ isNew = false, post }: QuotedPostProps) => { 15 14 return ( 16 15 <PostWrapper 17 16 className="cursor-pointer p-4 transition-colors first:rounded-t-xl last:rounded-b-xl hover:bg-gray-100 dark:hover:bg-gray-900"
+1 -2
apps/web/src/components/Post/Quotes.tsx
··· 12 12 } from "@hey/indexer"; 13 13 import { Card, EmptyState, ErrorMessage, H5 } from "@hey/ui"; 14 14 import Link from "next/link"; 15 - import type { FC } from "react"; 16 15 import { Virtuoso } from "react-virtuoso"; 17 16 import SinglePost from "./SinglePost"; 18 17 ··· 20 19 post: PostFragment; 21 20 } 22 21 23 - const Quotes: FC<QuotesProps> = ({ post }) => { 22 + const Quotes = ({ post }: QuotesProps) => { 24 23 const request: PostReferencesRequest = { 25 24 pageSize: PageSize.Fifty, 26 25 referenceTypes: [PostReferenceType.QuoteOf],
+1 -2
apps/web/src/components/Post/RelevantPeople.tsx
··· 6 6 useAccountsBulkQuery 7 7 } from "@hey/indexer"; 8 8 import { Card, ErrorMessage, Modal } from "@hey/ui"; 9 - import type { FC } from "react"; 10 9 import { useState } from "react"; 11 10 import { useAccountStore } from "src/store/persisted/useAccountStore"; 12 11 import MoreRelevantPeople from "./MoreRelevantPeople"; ··· 15 14 mentions: PostMentionFragment[]; 16 15 } 17 16 18 - const RelevantPeople: FC<RelevantPeopleProps> = ({ mentions }) => { 17 + const RelevantPeople = ({ mentions }: RelevantPeopleProps) => { 19 18 const { currentAccount } = useAccountStore(); 20 19 const [showMore, setShowMore] = useState(false); 21 20
+2 -3
apps/web/src/components/Post/Shimmer.tsx
··· 4 4 import PostsShimmer from "@components/Shared/Shimmer/PostsShimmer"; 5 5 import SingleAccountShimmer from "@components/Shared/Shimmer/SingleAccountShimmer"; 6 6 import { Card, GridItemEight, GridItemFour, GridLayout } from "@hey/ui"; 7 - import type { FC } from "react"; 8 7 9 8 interface PublicationPageShimmerProps { 10 9 publicationList?: boolean; 11 10 } 12 11 13 - const PublicationPageShimmer: FC<PublicationPageShimmerProps> = ({ 12 + const PublicationPageShimmer = ({ 14 13 publicationList = false 15 - }) => { 14 + }: PublicationPageShimmerProps) => { 16 15 return ( 17 16 <GridLayout> 18 17 <GridItemEight className="space-y-5">
+1 -2
apps/web/src/components/Post/SingleImagePost.tsx
··· 3 3 import { isRepost } from "@hey/helpers/postHelpers"; 4 4 import type { AnyPostFragment } from "@hey/indexer"; 5 5 import Link from "next/link"; 6 - import type { FC } from "react"; 7 6 import { memo } from "react"; 8 7 9 8 interface SingleImagePostProps { 10 9 post: AnyPostFragment; 11 10 } 12 11 13 - const SingleImagePost: FC<SingleImagePostProps> = ({ post }) => { 12 + const SingleImagePost = ({ post }: SingleImagePostProps) => { 14 13 const targetPost = isRepost(post) ? post.repostOf : post; 15 14 const filteredAttachments = 16 15 getPostData(targetPost.metadata)?.attachments || [];
+2 -3
apps/web/src/components/Post/SinglePost.tsx
··· 2 2 import PostWrapper from "@components/Shared/PostWrapper"; 3 3 import type { AnyPostFragment, TimelineItemFragment } from "@hey/indexer"; 4 4 import cn from "@hey/ui/cn"; 5 - import type { FC } from "react"; 6 5 import { memo } from "react"; 7 6 import PostActions from "./Actions"; 8 7 import HiddenPost from "./HiddenPost"; ··· 22 21 showType?: boolean; 23 22 } 24 23 25 - const SinglePost: FC<SinglePostProps> = ({ 24 + const SinglePost = ({ 26 25 timelineItem, 27 26 isFirst = false, 28 27 isLast = false, ··· 31 30 showMore = true, 32 31 showThread = true, 33 32 showType = true 34 - }) => { 33 + }: SinglePostProps) => { 35 34 const rootPost = timelineItem ? timelineItem?.primary : post; 36 35 37 36 return (
+1 -2
apps/web/src/components/Post/ThreadBody.tsx
··· 1 1 import PostWrapper from "@components/Shared/PostWrapper"; 2 2 import type { PostFragment } from "@hey/indexer"; 3 - import type { FC } from "react"; 4 3 import PostActions from "./Actions"; 5 4 import HiddenPost from "./HiddenPost"; 6 5 import PostAvatar from "./PostAvatar"; ··· 11 10 post: PostFragment; 12 11 } 13 12 14 - const ThreadBody: FC<ThreadBodyProps> = ({ post }) => { 13 + const ThreadBody = ({ post }: ThreadBodyProps) => { 15 14 return ( 16 15 <PostWrapper post={post}> 17 16 <div className="relative flex items-start space-x-3 pb-3">
+2 -3
apps/web/src/components/Shared/Shimmer/SingleGroupShimmer.tsx
··· 1 1 import cn from "@hey/ui/cn"; 2 - import type { FC } from "react"; 3 2 4 3 interface SingleGroupShimmerProps { 5 4 className?: string; ··· 7 6 showJoinLeaveButton?: boolean; 8 7 } 9 8 10 - const SingleGroupShimmer: FC<SingleGroupShimmerProps> = ({ 9 + const SingleGroupShimmer = ({ 11 10 className = "", 12 11 isBig = false, 13 12 showJoinLeaveButton = false 14 - }) => { 13 + }: SingleGroupShimmerProps) => { 15 14 return ( 16 15 <div className={cn("flex items-center justify-between", className)}> 17 16 <div className="flex items-center space-x-3">
+2 -3
apps/web/src/components/Shared/Shimmer/SmallSingleAccountShimmer.tsx
··· 1 1 import cn from "@hey/ui/cn"; 2 - import type { FC } from "react"; 3 2 4 3 interface SmallSingleAccountShimmerProps { 5 4 hideSlug?: boolean; 6 5 smallAvatar?: boolean; 7 6 } 8 7 9 - const SmallSingleAccountShimmer: FC<SmallSingleAccountShimmerProps> = ({ 8 + const SmallSingleAccountShimmer = ({ 10 9 hideSlug = false, 11 10 smallAvatar = false 12 - }) => { 11 + }: SmallSingleAccountShimmerProps) => { 13 12 return ( 14 13 <div className="flex items-center space-x-3"> 15 14 <div
+1 -2
apps/web/src/components/Shared/Sidebar/SidebarMenu.tsx
··· 2 2 import { Card } from "@hey/ui"; 3 3 import cn from "@hey/ui/cn"; 4 4 import { useRouter } from "next/router"; 5 - import type { FC } from "react"; 6 5 import { useState } from "react"; 7 6 import type { SidebarProps } from "."; 8 7 import MenuTransition from "../MenuTransition"; 9 8 import { NextLink } from "../Navbar/MenuItems"; 10 9 11 - const SidebarMenu: FC<SidebarProps> = ({ items }) => { 10 + const SidebarMenu = ({ items }: SidebarProps) => { 12 11 const { pathname } = useRouter(); 13 12 const menuItems = items.filter((item) => item?.enabled !== false); 14 13 const [selectedItem, setSelectedItem] = useState(
+3 -3
apps/web/src/components/Shared/Sidebar/SidebarTabs.tsx
··· 1 1 import cn from "@hey/ui/cn"; 2 2 import Link from "next/link"; 3 3 import { useRouter } from "next/router"; 4 - import type { FC, ReactNode } from "react"; 4 + import type { ReactNode } from "react"; 5 5 6 6 interface MenuProps { 7 7 children: ReactNode; ··· 21 21 items: SidebarItem[]; 22 22 } 23 23 24 - const Menu: FC<MenuProps> = ({ children, current, url }) => ( 24 + const Menu = ({ children, current, url }: MenuProps) => ( 25 25 <Link 26 26 className={cn( 27 27 { "font-bold text-black dark:text-white": current }, ··· 36 36 </Link> 37 37 ); 38 38 39 - const SidebarTabs: FC<SidebarProps> = ({ items }) => { 39 + const SidebarTabs = ({ items }: SidebarProps) => { 40 40 const { pathname } = useRouter(); 41 41 const menuItems = items.filter((item) => item.enabled !== false); 42 42
+1 -2
apps/web/src/components/Shared/Sidebar/index.tsx
··· 1 1 import SidebarMenu from "@components/Shared/Sidebar/SidebarMenu"; 2 2 import SidebarTabs from "@components/Shared/Sidebar/SidebarTabs"; 3 - import type { FC } from "react"; 4 3 5 4 export interface SidebarProps { 6 5 items: { ··· 12 11 }[]; 13 12 } 14 13 15 - const Sidebar: FC<SidebarProps> = ({ items }) => { 14 + const Sidebar = ({ items }: SidebarProps) => { 16 15 return ( 17 16 <> 18 17 <div className="hidden lg:block">
+1 -2
apps/web/src/components/Staff/Accounts/Overview/Tool/AccountOverview.tsx
··· 4 4 import formatAddress from "@hey/helpers/formatAddress"; 5 5 import type { AccountFragment } from "@hey/indexer"; 6 6 import { H5 } from "@hey/ui"; 7 - import type { FC } from "react"; 8 7 9 8 interface AccountOverviewProps { 10 9 account: AccountFragment; 11 10 } 12 11 13 - const AccountOverview: FC<AccountOverviewProps> = ({ account }) => { 12 + const AccountOverview = ({ account }: AccountOverviewProps) => { 14 13 return ( 15 14 <> 16 15 <div className="divider my-5 border-yellow-600 border-dashed" />
+1 -2
apps/web/src/components/Staff/Accounts/Overview/Tool/AccountPreferences.tsx
··· 8 8 import { STATIC_IMAGES_URL } from "@hey/data/constants"; 9 9 import type { PreferencesRouterOutput } from "@hey/rpc/src/routers/preferences"; 10 10 import { H5 } from "@hey/ui"; 11 - import type { FC } from "react"; 12 11 13 12 interface AccountPreferencesProps { 14 13 preferences: PreferencesRouterOutput["get"]; 15 14 } 16 15 17 - const AccountPreferences: FC<AccountPreferencesProps> = ({ preferences }) => { 16 + const AccountPreferences = ({ preferences }: AccountPreferencesProps) => { 18 17 if (!preferences) { 19 18 return null; 20 19 }
+1 -2
apps/web/src/components/Staff/Accounts/Overview/Tool/Permissions.tsx
··· 1 1 import { FlagIcon } from "@heroicons/react/24/outline"; 2 2 import { H5 } from "@hey/ui"; 3 - import type { FC } from "react"; 4 3 import { useEffect, useState } from "react"; 5 4 import UpdatePermissions from "./UpdatePermissions"; 6 5 ··· 9 8 accountAddress: string; 10 9 } 11 10 12 - const Permissions: FC<PermissionsProps> = ({ permissions, accountAddress }) => { 11 + const Permissions = ({ permissions, accountAddress }: PermissionsProps) => { 13 12 const [keys, setKeys] = useState<string[]>([]); 14 13 15 14 useEffect(() => {
+3 -3
apps/web/src/components/Staff/Accounts/Overview/Tool/UpdatePermissions.tsx
··· 3 3 import { trpc } from "@helpers/trpc"; 4 4 import { Toggle } from "@hey/ui"; 5 5 import { useMutation, useQuery } from "@tanstack/react-query"; 6 - import type { Dispatch, FC, SetStateAction } from "react"; 6 + import type { Dispatch, SetStateAction } from "react"; 7 7 import toast from "react-hot-toast"; 8 8 import ToggleWrapper from "./ToggleWrapper"; 9 9 ··· 13 13 setPermissions: Dispatch<SetStateAction<string[]>>; 14 14 } 15 15 16 - const UpdatePermissions: FC<UpdatePermissionsProps> = ({ 16 + const UpdatePermissions = ({ 17 17 permissions, 18 18 accountAddress, 19 19 setPermissions 20 - }) => { 20 + }: UpdatePermissionsProps) => { 21 21 const { data: allPermissions, isLoading } = useQuery( 22 22 trpc.internal.permissions.all.queryOptions() 23 23 );
+1 -2
apps/web/src/components/Staff/Accounts/Overview/Tool/index.tsx
··· 2 2 import { trpc } from "@helpers/trpc"; 3 3 import type { AccountFragment } from "@hey/indexer"; 4 4 import { useQuery } from "@tanstack/react-query"; 5 - import type { FC } from "react"; 6 5 import AccountOverview from "./AccountOverview"; 7 6 import AccountPreferences from "./AccountPreferences"; 8 7 import ManagedAccounts from "./ManagedAccounts"; ··· 12 11 account: AccountFragment; 13 12 } 14 13 15 - const AccountStaffTool: FC<AccountStaffToolProps> = ({ account }) => { 14 + const AccountStaffTool = ({ account }: AccountStaffToolProps) => { 16 15 const { data: preferences } = useQuery( 17 16 trpc.internal.account.queryOptions({ address: account.address }) 18 17 );
+3 -3
packages/ui/src/Alert.tsx
··· 5 5 Transition, 6 6 TransitionChild 7 7 } from "@headlessui/react"; 8 - import type { FC, ReactNode } from "react"; 8 + import type { ReactNode } from "react"; 9 9 import { Fragment } from "react"; 10 10 import { Button } from "./Button"; 11 11 import { H4 } from "./Typography"; ··· 23 23 title: ReactNode; 24 24 } 25 25 26 - export const Alert: FC<AlertProps> = ({ 26 + export const Alert = ({ 27 27 cancelText = "Cancel", 28 28 children, 29 29 confirmText, ··· 34 34 onConfirm, 35 35 show, 36 36 title 37 - }) => { 37 + }: AlertProps) => { 38 38 return ( 39 39 <Transition as={Fragment} show={show}> 40 40 <Dialog
+3 -3
packages/ui/src/Card.tsx
··· 1 - import type { ElementType, FC, MouseEvent, ReactNode } from "react"; 1 + import type { ElementType, MouseEvent, ReactNode } from "react"; 2 2 import cn from "../cn"; 3 3 4 4 interface CardProps { ··· 9 9 onClick?: (event: MouseEvent<HTMLDivElement>) => void; 10 10 } 11 11 12 - export const Card: FC<CardProps> = ({ 12 + export const Card = ({ 13 13 as: Tag = "div", 14 14 children, 15 15 className = "", 16 16 forceRounded = false, 17 17 onClick 18 - }) => { 18 + }: CardProps) => { 19 19 return ( 20 20 <Tag 21 21 className={cn(
+2 -6
packages/ui/src/CardHeader.tsx
··· 1 - import type { FC, ReactNode } from "react"; 1 + import type { ReactNode } from "react"; 2 2 import { H5 } from "./Typography"; 3 3 4 4 interface CardHeaderProps { ··· 7 7 title: ReactNode; 8 8 } 9 9 10 - const CardHeader: FC<CardHeaderProps> = ({ 11 - body, 12 - hideDivider = false, 13 - title 14 - }) => { 10 + const CardHeader = ({ body, hideDivider = false, title }: CardHeaderProps) => { 15 11 return ( 16 12 <> 17 13 <div className="m-5 space-y-2">