diff --git a/shared/chat/audio/audio-recorder.native.tsx b/shared/chat/audio/audio-recorder.native.tsx index 6ef08d22bae1..ee49ea3608b5 100644 --- a/shared/chat/audio/audio-recorder.native.tsx +++ b/shared/chat/audio/audio-recorder.native.tsx @@ -20,6 +20,7 @@ import {useConversationSendActions} from '@/chat/conversation/send-actions' const {useSharedValue, Extrapolation, useAnimatedStyle} = Reanimated const {interpolate, withSequence, withSpring, runOnJS} = Reanimated const {useAnimatedReaction, withDelay, withTiming, interpolateColor, default: Animated} = Reanimated +const AnimatedBox2 = Animated.createAnimatedComponent(Kb.Box2) type SVN = Reanimated.SharedValue type Props = { @@ -668,18 +669,12 @@ const LockHint = (props: {fadeSV: SVN; lockedSV: SVN; dragXSV: SVN; dragYSV: SVN }) return ( <> - + - - + + - + ) } @@ -749,18 +744,12 @@ const CancelHint = (props: {fadeSV: SVN; dragXSV: SVN; lockedSV: SVN; onCancel: return ( <> - + - - + + - + { {popup} {isSmallTeam ? ( <> - { {(commitRef.commits || []).map((commit, i) => ( - }) => { return } /> } -export const Box2Animated = (p: Box2Props & {ref?: React.Ref}) => { - if (!isMobile) return - const {ref, ...rest} = p - const props = box2SharedProps(rest) - return } /> -} - const common = { alignItems: 'stretch', justifyContent: 'flex-start', diff --git a/shared/common-adapters/index.tsx b/shared/common-adapters/index.tsx index 21a06c919d8b..be0f3d017d40 100644 --- a/shared/common-adapters/index.tsx +++ b/shared/common-adapters/index.tsx @@ -8,14 +8,7 @@ export type {AnimationType} from './animation' export const LayoutAnimation: typeof NativeLayoutAnimation = isMobile ? NativeLayoutAnimation : ({} as typeof NativeLayoutAnimation) -export const ReAnimated = {} -export { - BottomSheetModal, - BottomSheetBackdrop, - BottomSheetScrollView, - type BottomSheetBackdropProps, -} from './popup/bottom-sheet' export {default as Animation} from './animation' export {default as Avatar} from './avatar/index' export {default as AvatarLine} from './avatar/avatar-line' @@ -23,7 +16,7 @@ export {BottomAccessory} from './bottom-accessory' export {default as BackButton} from './back-button' export {default as Badge} from './badge' export {Banner, BannerParagraph} from './banner' -export {Box2, Box2Animated} from './box' +export {Box2} from './box' export type {LayoutEvent} from './box' export type {MeasureRef} from './measure-ref' export {default as ButtonBar} from './button-bar' @@ -65,12 +58,9 @@ export {default as LoadingLine} from './loading-line' export {default as Markdown} from './markdown' export {default as Meta} from './meta' export {default as NameWithIcon} from './name-with-icon' -export {default as ConnectedNameWithIcon} from './name-with-icon' export {default as Popup, type PopupProps} from './popup/index' export {default as PhoneInput} from './phone-input' export {default as Placeholder} from './placeholder' -export {default as PlatformIcon} from './platform-icon' -export {default as ProfileCard} from './profile-card' export {default as ProgressBar} from './progress-bar' export {default as ProgressIndicator} from './progress-indicator' export {default as ProofBrokenBanner} from './proof-broken-banner' @@ -86,12 +76,10 @@ export {default as ScrollView, type ScrollViewRef} from './scroll-view' export {default as SectionList, type SectionListRef, type SectionType} from './section-list' export {default as Switch} from './switch' export {default as Tabs} from './tabs' -export {default as TeamWithPopup} from './team-with-popup' export {default as Text} from './text' export {useClickURL} from './text-url' export {default as Toast} from './toast' export {default as SimpleToast} from './simple-toast' -export {default as TimelineMarker} from './timeline-marker' export {default as ConnectedUsernames} from './usernames' export {default as WaitingButton} from './waiting-button' export {default as WaveButton} from './wave-button' diff --git a/shared/common-adapters/team-with-popup.tsx b/shared/common-adapters/team-with-popup.tsx deleted file mode 100644 index 97caa354fc3d..000000000000 --- a/shared/common-adapters/team-with-popup.tsx +++ /dev/null @@ -1,152 +0,0 @@ -import * as C from '@/constants' -import * as React from 'react' -import {Box2} from './box' -import * as Styles from '@/styles' -import Text from './text' -import type {TextType} from './text.shared' -import DelayedMounting from './delayed-mounting' -import type TeamInfoType from '../profile/user/teams/teaminfo' -import * as T from '@/constants/types' -import type {MeasureRef} from './measure-ref' -import {useLoadedTeam} from '@/teams/team/use-loaded-team' -import {useTeamsListNameToIDMap} from '@/teams/use-teams-list' - -const Kb = { - Box2, - Text, -} -export type Props = { - description: string - isMember: boolean - isOpen: boolean - inline?: boolean - memberCount: number - onJoinTeam: () => void - onPopupVisibleChange?: (visible: boolean) => void - onViewTeam: () => void - prefix?: string - shouldLoadTeam?: boolean - teamID: T.Teams.TeamID - teamName: string - type: TextType - underline?: boolean -} - -const TeamWithPopup = (props: Props) => { - const {onJoinTeam, onViewTeam} = props - const {description, isMember, isOpen, memberCount} = props - const {prefix, teamName, type, inline} = props - const popupRef = React.useRef(null) - const [showPopup, setShowPopup] = React.useState(false) - const onHidePopup = () => { - props.onPopupVisibleChange?.(false) - setShowPopup(false) - } - const onShowPopup = () => { - props.onPopupVisibleChange?.(true) - setShowPopup(true) - } - - const {default: TeamInfo} = require('../profile/user/teams/teaminfo') as {default: typeof TeamInfoType} - - const popup = showPopup && ( - <> - - - - - ) - return ( - - - {prefix} - - {teamName} - - - {popup} - - ) -} - -const styles = Styles.styleSheetCreate( - () => - ({ - inlineStyle: Styles.platformStyles({ - isElectron: { - display: 'inline', - ...Styles.textEllipsis, - }, - }), - }) as const -) - -type OwnProps = { - inline?: boolean - prefix?: string - shouldLoadTeam?: boolean - teamName: string - type: TextType - underline?: boolean -} - -const ConnectedTeamWithPopup = (ownProps: OwnProps) => { - const [showPopup, setShowPopup] = React.useState(false) - const teamNameToID = useTeamsListNameToIDMap() - const teamID = teamNameToID.get(ownProps.teamName) ?? T.Teams.noTeamID - const {teamDetails, teamMeta} = useLoadedTeam(teamID, showPopup || !!ownProps.shouldLoadTeam) - const stateProps = { - description: teamDetails.description, - isMember: teamMeta.isMember, - isOpen: teamMeta.isOpen, - memberCount: teamMeta.memberCount, - teamID, - } - const clearModals = C.Router2.clearModals - const navigateAppend = C.Router2.navigateAppend - const _onViewTeam = (teamID: T.Teams.TeamID) => { - clearModals() - navigateAppend({name: 'team', params: {teamID}}) - } - - const props = { - description: stateProps.description, - inline: ownProps.inline, - isMember: stateProps.isMember, - isOpen: stateProps.isOpen, - memberCount: stateProps.memberCount, - onJoinTeam: () => navigateAppend({name: 'teamJoinTeamDialog', params: {initialTeamname: ownProps.teamName}}), - onPopupVisibleChange: setShowPopup, - onViewTeam: () => { - if (stateProps.teamID !== T.Teams.noTeamID) { - _onViewTeam(stateProps.teamID) - } - }, - prefix: ownProps.prefix, - shouldLoadTeam: ownProps.shouldLoadTeam, - teamID: stateProps.teamID, - teamName: ownProps.teamName, - type: ownProps.type, - underline: ownProps.underline, - } - return -} - -export default ConnectedTeamWithPopup diff --git a/shared/common-adapters/timeline-marker.meta.tsx b/shared/common-adapters/timeline-marker.meta.tsx deleted file mode 100644 index db6041796cef..000000000000 --- a/shared/common-adapters/timeline-marker.meta.tsx +++ /dev/null @@ -1 +0,0 @@ -export const timeline_grey = '#D3DCE2' diff --git a/shared/people/follow-suggestions.tsx b/shared/people/follow-suggestions.tsx index 41028e8be2cb..8fa3fbdbcd66 100644 --- a/shared/people/follow-suggestions.tsx +++ b/shared/people/follow-suggestions.tsx @@ -17,7 +17,7 @@ const FollowSuggestions = (props: Props) => ( contentContainerStyle={styles.scrollViewContainer} > {props.suggestions.map(suggestion => ( - )} - )} - {title} - - + Fill in your public info. @@ -235,7 +236,7 @@ export default function Choice() { case 'generate': return ( - + Generating your unique key... Math time! You are about to discover a 4096-bit key pair. @@ -278,7 +279,7 @@ const Finished = (props: { return ( - + Here is your unique public key! {'Your private key has been written to Keybase\'s local keychain. You can learn to use it with `keybase pgp help` from your terminal. If you have GPG installed, it has also been written to GPG\'s keychain.'} diff --git a/shared/common-adapters/platform-icon.tsx b/shared/profile/platform-icon.tsx similarity index 89% rename from shared/common-adapters/platform-icon.tsx rename to shared/profile/platform-icon.tsx index fd56bca43cec..20c5e77c81e2 100644 --- a/shared/common-adapters/platform-icon.tsx +++ b/shared/profile/platform-icon.tsx @@ -1,8 +1,6 @@ import type * as T from '@/constants/types' -import {Box2} from './box' -import IconAuto from './icon-auto' -import type {IconType} from './icon.constants-gen' -import ImageIcon from './image-icon' +import {Box2, IconAuto, ImageIcon} from '@/common-adapters' +import type {IconType} from '@/common-adapters' type Props = { platform: T.More.PlatformsExpandedType @@ -46,7 +44,7 @@ const getSpecForPlatform = (platform: T.More.PlatformsExpandedType): IconSpec => return {...standardOffsets, ...specs[platform]} } -const Render = ({platform, overlay, style}: Props) => { +const PlatformIcon = ({platform, overlay, style}: Props) => { const iconSpec = getSpecForPlatform(platform) return ( @@ -63,4 +61,4 @@ const Render = ({platform, overlay, style}: Props) => { ) } -export default Render +export default PlatformIcon diff --git a/shared/profile/user/index.tsx b/shared/profile/user/index.tsx index 84cce9c1cc8e..d70bc05c2d7a 100644 --- a/shared/profile/user/index.tsx +++ b/shared/profile/user/index.tsx @@ -88,7 +88,7 @@ const SbsTitle = (p: SbsTitleProps) => ( ) const BioLayout = (p: BioTeamProofsProps) => ( - : undefined diff --git a/shared/router-v2/tab-bar.desktop.tsx b/shared/router-v2/tab-bar.desktop.tsx index 1b932e531734..4dcfde773991 100644 --- a/shared/router-v2/tab-bar.desktop.tsx +++ b/shared/router-v2/tab-bar.desktop.tsx @@ -86,7 +86,7 @@ const Header = () => { const menuHeader = ( - { const smallWidth = serviceMinWidthWhenSmall(Kb.Styles.dimensionWidth) const bigWidth = Math.max(smallWidth, 92) -const AnimatedBox2 = Kb.Box2Animated +const AnimatedBox2 = createAnimatedComponent(Kb.Box2) const AnimatedScrollView = createAnimatedComponent(ScrollView) const TabletBottomBorderExtension = function TabletBottomBorderExtension(props: { diff --git a/shared/team-building/user-bubble.tsx b/shared/team-building/user-bubble.tsx index ff4a3dae2f30..908f2c5595f5 100644 --- a/shared/team-building/user-bubble.tsx +++ b/shared/team-building/user-bubble.tsx @@ -28,7 +28,7 @@ const UserBubble = (props: Props) => { - { return null } const header = ( -