1414 * limitations under the License.
1515 */
1616
17- import { PropsWithChildren } from 'react' ;
1817import { subscribe } from '../../decorators/subscribe' ;
1918import { translate , TranslateProps } from '../../decorators/translate' ;
2019import A from '../anchor/anchor' ;
2120import Status from '../status/status' ;
2221
23- interface BannerInfo {
22+ type TBannerInfo = {
2423 id : string ;
2524 message : { [ key : string ] : string ; } ;
2625 link ?: {
@@ -29,18 +28,18 @@ interface BannerInfo {
2928 } ;
3029}
3130
32- interface LoadedProps {
33- banner : BannerInfo | null ;
31+ type TLoadedProps = {
32+ banner : TBannerInfo | null ;
3433}
3534
36- interface BannerProps {
35+ type TBannerProps = {
3736 // eslint-disable-next-line react/no-unused-prop-types
3837 msgKey : 'bitbox01' ;
3938}
4039
41- type Props = LoadedProps & BannerProps & TranslateProps ;
40+ type TProps = TLoadedProps & TBannerProps & TranslateProps ;
4241
43- function Banner ( { banner, i18n, t } : PropsWithChildren < Props > ) : JSX . Element | null {
42+ function Banner ( { banner, i18n, t } : TProps ) {
4443 if ( ! i18n . options . fallbackLng ) {
4544 return null ;
4645 }
@@ -57,7 +56,7 @@ function Banner({ banner, i18n, t }: PropsWithChildren<Props>): JSX.Element | nu
5756}
5857
5958const HOC = translate ( ) (
60- subscribe < LoadedProps , BannerProps & TranslateProps > (
59+ subscribe < TLoadedProps , TBannerProps & TranslateProps > (
6160 ( { msgKey } ) => ( { banner : 'banners/' + msgKey } ) ,
6261 true ,
6362 false ,
0 commit comments