diff --git a/src/components/post-ctrls/PostCtrlButton.tsx b/src/components/PostControls/PostControlButton.tsx similarity index 81% rename from src/components/post-ctrls/PostCtrlButton.tsx rename to src/components/PostControls/PostControlButton.tsx index 17566b93bb..200edaa563 100644 --- a/src/components/post-ctrls/PostCtrlButton.tsx +++ b/src/components/PostControls/PostControlButton.tsx @@ -8,14 +8,14 @@ import {Button, type ButtonProps} from '#/components/Button' import {type Props as SVGIconProps} from '#/components/icons/common' import {Text, type TextProps} from '#/components/Typography' -const PostCtrlContext = React.createContext<{ +const PostControlContext = React.createContext<{ big?: boolean active?: boolean color?: {color: string} }>({}) // Base button style, which the the other ones extend -export const PostCtrlButton = React.forwardRef< +export const PostControlButton = React.forwardRef< View, ButtonProps & { active?: boolean @@ -83,33 +83,33 @@ export const PostCtrlButton = React.forwardRef< {...props}> {typeof children === 'function' ? ( args => ( - + {children(args)} - + ) ) : ( - + {children} - + )} ) }, ) -PostCtrlButton.displayName = 'PostCtrlButton' +PostControlButton.displayName = 'PostControlButton' -export function PostCtrlButtonIcon({ +export function PostControlButtonIcon({ icon: Comp, }: { icon: React.ComponentType }) { - const {big, color} = useContext(PostCtrlContext) + const {big, color} = useContext(PostControlContext) return } -export function PostCtrlButtonText({style, ...props}: TextProps) { - const {big, active, color} = useContext(PostCtrlContext) +export function PostControlButtonText({style, ...props}: TextProps) { + const {big, active, color} = useContext(PostControlContext) return ( {({props}) => { return ( - - - + + ) }} diff --git a/src/components/post-ctrls/RepostButton.tsx b/src/components/PostControls/RepostButton.tsx similarity index 94% rename from src/components/post-ctrls/RepostButton.tsx rename to src/components/PostControls/RepostButton.tsx index 1970c7c770..cf03080477 100644 --- a/src/components/post-ctrls/RepostButton.tsx +++ b/src/components/PostControls/RepostButton.tsx @@ -13,10 +13,10 @@ import {CloseQuote_Stroke2_Corner1_Rounded as Quote} from '#/components/icons/Qu import {Repost_Stroke2_Corner2_Rounded as Repost} from '#/components/icons/Repost' import {Text} from '#/components/Typography' import { - PostCtrlButton, - PostCtrlButtonIcon, - PostCtrlButtonText, -} from './PostCtrlButton' + PostControlButton, + PostControlButtonIcon, + PostControlButtonText, +} from './PostControlButton' interface Props { isReposted: boolean @@ -42,7 +42,7 @@ let RepostButton = ({ return ( <> - - + {typeof repostCount !== 'undefined' && repostCount > 0 && ( - + {formatCount(i18n, repostCount)} - + )} - + diff --git a/src/components/post-ctrls/RepostButton.web.tsx b/src/components/PostControls/RepostButton.web.tsx similarity index 84% rename from src/components/post-ctrls/RepostButton.web.tsx rename to src/components/PostControls/RepostButton.web.tsx index ace4c360ee..48720b753b 100644 --- a/src/components/post-ctrls/RepostButton.web.tsx +++ b/src/components/PostControls/RepostButton.web.tsx @@ -10,10 +10,10 @@ import {CloseQuote_Stroke2_Corner1_Rounded as Quote} from '#/components/icons/Qu import {Repost_Stroke2_Corner2_Rounded as Repost} from '#/components/icons/Repost' import * as Menu from '#/components/Menu' import { - PostCtrlButton, - PostCtrlButtonIcon, - PostCtrlButtonText, -} from './PostCtrlButton' + PostControlButton, + PostControlButtonIcon, + PostControlButtonText, +} from './PostControlButton' interface Props { isReposted: boolean @@ -43,20 +43,20 @@ export const RepostButton = ({ {({props}) => { return ( - - + {typeof repostCount !== 'undefined' && repostCount > 0 && ( - + {formatCount(i18n, repostCount)} - + )} - + ) }} @@ -90,18 +90,18 @@ export const RepostButton = ({ ) : ( - requireAuth(() => {})} active={isReposted} activeColor={t.palette.positive_600} label={_(msg`Repost or quote post`)} big={big}> - + {typeof repostCount !== 'undefined' && repostCount > 0 && ( - + {formatCount(i18n, repostCount)} - + )} - + ) } diff --git a/src/components/post-ctrls/ShareMenuItems.tsx b/src/components/PostControls/ShareMenu/ShareMenuItems.tsx similarity index 100% rename from src/components/post-ctrls/ShareMenuItems.tsx rename to src/components/PostControls/ShareMenu/ShareMenuItems.tsx diff --git a/src/components/post-ctrls/ShareMenuItems.types.tsx b/src/components/PostControls/ShareMenu/ShareMenuItems.types.tsx similarity index 100% rename from src/components/post-ctrls/ShareMenuItems.types.tsx rename to src/components/PostControls/ShareMenu/ShareMenuItems.types.tsx diff --git a/src/components/post-ctrls/ShareMenuItems.web.tsx b/src/components/PostControls/ShareMenu/ShareMenuItems.web.tsx similarity index 100% rename from src/components/post-ctrls/ShareMenuItems.web.tsx rename to src/components/PostControls/ShareMenu/ShareMenuItems.web.tsx diff --git a/src/components/post-ctrls/ShareMenuButton.tsx b/src/components/PostControls/ShareMenu/index.tsx similarity index 91% rename from src/components/post-ctrls/ShareMenuButton.tsx rename to src/components/PostControls/ShareMenu/index.tsx index 123ac1a4db..c20e7d9a29 100644 --- a/src/components/post-ctrls/ShareMenuButton.tsx +++ b/src/components/PostControls/ShareMenu/index.tsx @@ -14,7 +14,7 @@ import {EventStopper} from '#/view/com/util/EventStopper' import {ArrowOutOfBox_Stroke2_Corner0_Rounded as ArrowOutOfBoxIcon} from '#/components/icons/ArrowOutOfBox' import {useMenuControl} from '#/components/Menu' import * as Menu from '#/components/Menu' -import {PostCtrlButton, PostCtrlButtonIcon} from './PostCtrlButton' +import {PostControlButton, PostControlButtonIcon} from '../PostControlButton' import {ShareMenuItems} from './ShareMenuItems' let ShareMenuButton = ({ @@ -58,13 +58,13 @@ let ShareMenuButton = ({ {({props}) => { return ( - - - + + ) }} diff --git a/src/components/post-ctrls/PostCtrls.tsx b/src/components/PostControls/index.tsx similarity index 94% rename from src/components/post-ctrls/PostCtrls.tsx rename to src/components/PostControls/index.tsx index d7acb46488..de02ff87c0 100644 --- a/src/components/post-ctrls/PostCtrls.tsx +++ b/src/components/PostControls/index.tsx @@ -34,15 +34,15 @@ import * as Toast from '#/view/com/util/Toast' import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {Bubble_Stroke2_Corner2_Rounded as Bubble} from '#/components/icons/Bubble' import { - PostCtrlButton, - PostCtrlButtonIcon, - PostCtrlButtonText, -} from './PostCtrlButton' -import {PostMenuButton} from './PostMenuButton' + PostControlButton, + PostControlButtonIcon, + PostControlButtonText, +} from './PostControlButton' +import {PostMenuButton} from './PostMenu' import {RepostButton} from './RepostButton' -import {ShareMenuButton} from './ShareMenuButton' +import {ShareMenuButton} from './ShareMenu' -let PostCtrls = ({ +let PostControls = ({ big, post, record, @@ -194,7 +194,7 @@ let PostCtrls = ({ big ? a.align_center : [a.flex_1, a.align_start, {marginLeft: -6}], replyDisabled ? {opacity: 0.5} : undefined, ]}> - requireAuth(() => onPressReply()) : undefined @@ -206,13 +206,13 @@ let PostCtrls = ({ })})`, )} big={big}> - + {typeof post.replyCount !== 'undefined' && post.replyCount > 0 && ( - + {formatCount(i18n, post.replyCount)} - + )} - + - requireAuth(() => onPressToggleLike())} @@ -255,7 +255,7 @@ let PostCtrls = ({ isLiked={Boolean(post.viewer?.like)} hasBeenToggled={hasLikeIconBeenToggled} /> - + ) } -PostCtrls = memo(PostCtrls) -export {PostCtrls} +PostControls = memo(PostControls) +export {PostControls} diff --git a/src/screens/VideoFeed/index.tsx b/src/screens/VideoFeed/index.tsx index d5b2e58cdf..2a61db7158 100644 --- a/src/screens/VideoFeed/index.tsx +++ b/src/screens/VideoFeed/index.tsx @@ -96,7 +96,7 @@ import * as Layout from '#/components/Layout' import {Link} from '#/components/Link' import {ListFooter} from '#/components/Lists' import * as Hider from '#/components/moderation/Hider' -import {PostCtrls} from '#/components/post-ctrls/PostCtrls' +import {PostControls} from '#/components/PostControls' import {RichText} from '#/components/RichText' import {Text} from '#/components/Typography' import * as bsky from '#/types/bsky' @@ -861,7 +861,7 @@ function Overlay({ )} {record && ( - - )} - ) : null} - -