diff --git a/src/components/Navigator/MainEntries/DesktopView.js b/src/components/Navigator/MainEntries/DesktopView.tsx similarity index 70% rename from src/components/Navigator/MainEntries/DesktopView.js rename to src/components/Navigator/MainEntries/DesktopView.tsx index f375da1ee..a4bc8fa18 100644 --- a/src/components/Navigator/MainEntries/DesktopView.js +++ b/src/components/Navigator/MainEntries/DesktopView.tsx @@ -13,7 +13,11 @@ import { Wrapper, DotDivider, SiteLink, Icon } from '../styles/main_entries' const splitMargin = 7 -const DesktopView = ({ type }) => { +type TProps = { + type: string +} + +const DesktopView: React.FC = ({ type }) => { const router = useRouter() const mainPath = getRouteMainPath(router.asPath) @@ -27,18 +31,11 @@ const DesktopView = ({ type }) => { 发现 - {/* - 专栏 */} - {/* } - > - 专栏 - */} - 作品集市 + + 作品集市 + @@ -50,12 +47,13 @@ const DesktopView = ({ type }) => { - - 工作 - - - 活动 + + 活动 + @@ -73,7 +71,7 @@ const DesktopView = ({ type }) => { hideOnClick={false} noPadding > - + 更多 @@ -81,12 +79,4 @@ const DesktopView = ({ type }) => { ) } -DesktopView.propTypes = { - type: T.oneOfType([T.string, T.instanceOf(null)]), -} - -DesktopView.defaultProps = { - type: null, -} - export default React.memo(DesktopView) diff --git a/src/components/Navigator/MainEntries/MobileView.js b/src/components/Navigator/MainEntries/MobileView.tsx similarity index 68% rename from src/components/Navigator/MainEntries/MobileView.js rename to src/components/Navigator/MainEntries/MobileView.tsx index a46216b49..299238701 100644 --- a/src/components/Navigator/MainEntries/MobileView.js +++ b/src/components/Navigator/MainEntries/MobileView.tsx @@ -8,7 +8,7 @@ import { send } from '@/utils' // import MorePanel from '../MorePanel' import { Wrapper, SiteLink, MobileIcon } from '../styles/main_entries' -export const openMobileNaviMenu = () => { +export const openMobileNaviMenu = (): void => { send(EVENT.DRAWER.OPEN, { type: TYPE.DRAWER.MODELINE_MENU, data: TYPE.MM_TYPE.GLOBAL_MENU, @@ -16,22 +16,14 @@ export const openMobileNaviMenu = () => { }) } -const MainEntries = () => { +const MainEntries: React.FC = () => { return ( - - + + ) } -MainEntries.propTypes = { - // type: T.oneOfType([T.string, T.instanceOf(null)]), -} - -MainEntries.defaultProps = { - // type: null, -} - export default React.memo(MainEntries) diff --git a/src/components/Navigator/MainEntries/index.js b/src/components/Navigator/MainEntries/index.tsx similarity index 100% rename from src/components/Navigator/MainEntries/index.js rename to src/components/Navigator/MainEntries/index.tsx diff --git a/src/components/Navigator/styles/main_entries.ts b/src/components/Navigator/styles/main_entries.ts index bd5c348b7..5e89deafe 100755 --- a/src/components/Navigator/styles/main_entries.ts +++ b/src/components/Navigator/styles/main_entries.ts @@ -20,9 +20,10 @@ export const DotDivider = styled(DotDividerBase)` width: 4px; height: 4px; ` +type TSiteLink = TTestable & TActive export const SiteLink = styled.a.attrs(({ testid }: TTestable) => ({ 'data-test-id': testid, -}))` +}))` ${css.flex('align-center')}; color: ${({ active }) => active ? theme('banner.title') : theme('banner.desc')}; diff --git a/src/components/Tooltip/styles/index.ts b/src/components/Tooltip/styles/index.ts index aa810b780..a128c37f9 100755 --- a/src/components/Tooltip/styles/index.ts +++ b/src/components/Tooltip/styles/index.ts @@ -11,6 +11,7 @@ export const StyledTippy = styled(Tippy)` color: ${theme('thread.articleDigest')}; box-shadow: ${theme('popover.boxShadow')}; outline: none; + max-width: 480px !important; border-radius: 5px; padding: 10px; @@ -21,6 +22,9 @@ export const StyledTippy = styled(Tippy)` ` export const NoPaddingStyledTippy = styled(StyledTippy)` padding: 0; + .tippy-content { + padding: 0; + } ` export const ContentWrapper = styled.div<{ contentHeight: string }>` position: relative;