From 6284996df5d0068c11a6a4ea3bd90672fab7bb00 Mon Sep 17 00:00:00 2001 From: mydearxym Date: Sat, 10 Apr 2021 13:12:13 +0800 Subject: [PATCH] chore(svg-icons): to ts & fix warnings --- src/components/ArticleItemPrefixLabel/styles/index.ts | 2 +- src/components/InlineTags/styles/index.ts | 2 +- src/components/SvgIcons/{HashTagSVG.js => HashTagSVG.tsx} | 2 +- .../SvgIcons/{HeaderMailSVG.js => HeaderMailSVG.tsx} | 2 +- .../SvgIcons/{HeaderSearchSVG.js => HeaderSearchSVG.tsx} | 2 +- .../SvgIcons/{HeaderStatesSVG.js => HeaderStatesSVG.tsx} | 2 +- src/components/SvgIcons/{PinSVG.js => PinSVG.tsx} | 2 +- src/components/SvgIcons/{TabAISVG.js => TabAISVG.tsx} | 2 +- .../SvgIcons/{TabBackendSVG.js => TabBackendSVG.tsx} | 2 +- .../SvgIcons/{TabBillingSVG.js => TabBillingSVG.tsx} | 2 +- .../SvgIcons/{TabBlockChainSVG.js => TabBlockChainSVG.tsx} | 2 +- .../SvgIcons/{TabCheatsheetSVG.js => TabCheatsheetSVG.tsx} | 2 +- src/components/SvgIcons/{TabCitySVG.js => TabCitySVG.tsx} | 2 +- .../SvgIcons/{TabCommentsSVG.js => TabCommentsSVG.tsx} | 2 +- src/components/SvgIcons/{TabDesignSVG.js => TabDesignSVG.tsx} | 2 +- .../SvgIcons/{TabFavoritesSVG.js => TabFavoritesSVG.tsx} | 2 +- .../SvgIcons/{TabFrontendSVG.js => TabFrontendSVG.tsx} | 2 +- src/components/SvgIcons/{TabJobSVG.js => TabJobSVG.tsx} | 2 +- src/components/SvgIcons/{TabLikesSVG.js => TabLikesSVG.tsx} | 2 +- src/components/SvgIcons/{TabMobileSVG.js => TabMobileSVG.tsx} | 2 +- src/components/SvgIcons/{TabPlSVG.js => TabPlSVG.tsx} | 2 +- src/components/SvgIcons/{TabPostSVG.js => TabPostSVG.tsx} | 2 +- .../SvgIcons/{TabPublishSVG.js => TabPublishSVG.tsx} | 2 +- src/components/SvgIcons/{TabRadarSVG.js => TabRadarSVG.tsx} | 2 +- src/components/SvgIcons/{TabRepoSVG.js => TabRepoSVG.tsx} | 2 +- .../SvgIcons/{TabSettingsSVG.js => TabSettingsSVG.tsx} | 2 +- src/components/SvgIcons/{TabShareSVG.js => TabShareSVG.tsx} | 2 +- src/components/SvgIcons/{TabTechSVG.js => TabTechSVG.tsx} | 2 +- src/components/SvgIcons/{TabUserSVG.js => TabUserSVG.tsx} | 2 +- src/components/SvgIcons/{TabVideoSVG.js => TabVideoSVG.tsx} | 2 +- src/components/SvgIcons/{TabWikiSVG.js => TabWikiSVG.tsx} | 2 +- src/containers/unit/TagsBar/styles/desktop_view/tag_item.ts | 3 ++- 32 files changed, 33 insertions(+), 32 deletions(-) rename src/components/SvgIcons/{HashTagSVG.js => HashTagSVG.tsx} (95%) rename src/components/SvgIcons/{HeaderMailSVG.js => HeaderMailSVG.tsx} (96%) rename src/components/SvgIcons/{HeaderSearchSVG.js => HeaderSearchSVG.tsx} (94%) rename src/components/SvgIcons/{HeaderStatesSVG.js => HeaderStatesSVG.tsx} (98%) rename src/components/SvgIcons/{PinSVG.js => PinSVG.tsx} (93%) rename src/components/SvgIcons/{TabAISVG.js => TabAISVG.tsx} (96%) rename src/components/SvgIcons/{TabBackendSVG.js => TabBackendSVG.tsx} (97%) rename src/components/SvgIcons/{TabBillingSVG.js => TabBillingSVG.tsx} (96%) rename src/components/SvgIcons/{TabBlockChainSVG.js => TabBlockChainSVG.tsx} (95%) rename src/components/SvgIcons/{TabCheatsheetSVG.js => TabCheatsheetSVG.tsx} (97%) rename src/components/SvgIcons/{TabCitySVG.js => TabCitySVG.tsx} (96%) rename src/components/SvgIcons/{TabCommentsSVG.js => TabCommentsSVG.tsx} (96%) rename src/components/SvgIcons/{TabDesignSVG.js => TabDesignSVG.tsx} (96%) rename src/components/SvgIcons/{TabFavoritesSVG.js => TabFavoritesSVG.tsx} (93%) rename src/components/SvgIcons/{TabFrontendSVG.js => TabFrontendSVG.tsx} (94%) rename src/components/SvgIcons/{TabJobSVG.js => TabJobSVG.tsx} (96%) rename src/components/SvgIcons/{TabLikesSVG.js => TabLikesSVG.tsx} (97%) rename src/components/SvgIcons/{TabMobileSVG.js => TabMobileSVG.tsx} (95%) rename src/components/SvgIcons/{TabPlSVG.js => TabPlSVG.tsx} (97%) rename src/components/SvgIcons/{TabPostSVG.js => TabPostSVG.tsx} (97%) rename src/components/SvgIcons/{TabPublishSVG.js => TabPublishSVG.tsx} (97%) rename src/components/SvgIcons/{TabRadarSVG.js => TabRadarSVG.tsx} (95%) rename src/components/SvgIcons/{TabRepoSVG.js => TabRepoSVG.tsx} (92%) rename src/components/SvgIcons/{TabSettingsSVG.js => TabSettingsSVG.tsx} (97%) rename src/components/SvgIcons/{TabShareSVG.js => TabShareSVG.tsx} (96%) rename src/components/SvgIcons/{TabTechSVG.js => TabTechSVG.tsx} (92%) rename src/components/SvgIcons/{TabUserSVG.js => TabUserSVG.tsx} (97%) rename src/components/SvgIcons/{TabVideoSVG.js => TabVideoSVG.tsx} (93%) rename src/components/SvgIcons/{TabWikiSVG.js => TabWikiSVG.tsx} (96%) diff --git a/src/components/ArticleItemPrefixLabel/styles/index.ts b/src/components/ArticleItemPrefixLabel/styles/index.ts index 42a6bab8a..cdc34b8dd 100755 --- a/src/components/ArticleItemPrefixLabel/styles/index.ts +++ b/src/components/ArticleItemPrefixLabel/styles/index.ts @@ -17,7 +17,7 @@ export const ReadedLabel = styled.div<{ topOffset: string }>` font-size: 0.8rem; `}; ` -export const PinIcon = styled(PinSVG)` +export const PinIcon = styled(PinSVG)<{ top: string }>` fill: ${theme('thread.articleDigest')}; position: absolute; ${css.size(18)}; diff --git a/src/components/InlineTags/styles/index.ts b/src/components/InlineTags/styles/index.ts index 550a9704e..ae5cfa76f 100755 --- a/src/components/InlineTags/styles/index.ts +++ b/src/components/InlineTags/styles/index.ts @@ -25,7 +25,7 @@ export const Title = styled.div` `}; ` export const MoreText = styled.div`` -export const HashSign = styled(HashTagSVG)` +export const HashSign = styled(HashTagSVG)<{ color: string }>` fill: ${({ color }) => color}; ${css.size(12)}; transform: rotate(18deg); diff --git a/src/components/SvgIcons/HashTagSVG.js b/src/components/SvgIcons/HashTagSVG.tsx similarity index 95% rename from src/components/SvgIcons/HashTagSVG.js rename to src/components/SvgIcons/HashTagSVG.tsx index 94c13a6e0..98459c65a 100644 --- a/src/components/SvgIcons/HashTagSVG.js +++ b/src/components/SvgIcons/HashTagSVG.tsx @@ -1,6 +1,6 @@ import React from 'react' -function SvgComponent(props) { +const SvgComponent: React.FC = (props) => { return ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( ( +const SvgComponent: React.FC = (props) => ( { return !active ? color : '#497684' } -export const HashSign = styled(HashTagSVG)` +type THashSign = TActive & { color: string; activeid: string; inline: boolean } +export const HashSign = styled(HashTagSVG)` fill: ${({ active, color, activeid }) => getActiveColor(active, color, activeid)}; ${css.size(14)};