diff --git a/src/App/App.tsx b/src/App/App.tsx index 3190d52..6e6aebc 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -20,10 +20,12 @@ export const AppContext = React.createContext<{}>({}); export const AppContextProvider = AppContext.Provider; export const AppContextConsumer = AppContext.Consumer; -interface AppStateInterface { +export interface AppStateInterface { error?: FormError; logoUrl: string; - user: {}; + user: { + username?: string; + }; scope: string; showLoginModal: boolean; isUserLoggedIn: boolean; diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 743ff11..4a1b30a 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -22,7 +22,7 @@ import RegistryInfoContent from '../RegistryInfoContent/RegistryInfoContent'; import { Greetings, NavBar, InnerNavBar, MobileNavBar, InnerMobileNavBar, LeftSide, RightSide, IconSearchButton, SearchWrapper } from './styles'; interface Props { - logo: string; + logo?: string; username?: string; onLogout: () => void; onToggleLoginModal: () => void; diff --git a/src/components/Icon/Icon.tsx b/src/components/Icon/Icon.tsx index 125d98a..4c603c9 100644 --- a/src/components/Icon/Icon.tsx +++ b/src/components/Icon/Icon.tsx @@ -61,7 +61,7 @@ export interface Props { size?: Breakpoint; pointer?: boolean; img?: boolean; - // modifiers?: null | undefined; + modifiers?: null | undefined; } const Icon: React.FC = ({ className, name, size = 'sm', img = false, pointer = false, ...props }) => { diff --git a/src/components/Icon/styles.ts b/src/components/Icon/styles.ts index fe1c892..366190e 100644 --- a/src/components/Icon/styles.ts +++ b/src/components/Icon/styles.ts @@ -36,8 +36,8 @@ export const Svg = styled('svg')` export const ImgWrapper: StyledOtherComponent< { size?: Breakpoint; - pointer: any; - modifiers?: any; + pointer: boolean; + modifiers?: null | undefined; name?: string | unknown; }, DetailedHTMLProps, HTMLSpanElement>, diff --git a/src/components/Label/Label.tsx b/src/components/Label/Label.tsx index c9aa93b..95fa878 100644 --- a/src/components/Label/Label.tsx +++ b/src/components/Label/Label.tsx @@ -6,7 +6,7 @@ interface Props { text: string; capitalize?: boolean; weight?: string; - modifiers?: any; + modifiers?: null | undefined; } const Wrapper = styled('div')` diff --git a/src/components/Versions/Versions.tsx b/src/components/Versions/Versions.tsx index 500e72e..a9a21da 100644 --- a/src/components/Versions/Versions.tsx +++ b/src/components/Versions/Versions.tsx @@ -19,7 +19,7 @@ class Versions extends React.PureComponent { ); } - public renderPackageList = (packages: any, isVersion: boolean = false, timeMap: Record = {}): ReactElement => { + public renderPackageList = (packages: {}, isVersion: boolean = false, timeMap: Record = {}): ReactElement => { return ( {Object.keys(packages) diff --git a/src/router.tsx b/src/router.tsx index 5906b28..dcc0e2b 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -2,7 +2,7 @@ import React, { Component, ReactElement } from 'react'; import { Router, Route, Switch } from 'react-router-dom'; -import { AppContextConsumer } from './App/App'; +import { AppContextConsumer, AppStateInterface } from './App/App'; import { asyncComponent } from './utils/asyncComponent'; import history from './history'; @@ -39,8 +39,8 @@ class RouterApp extends Component { return ( - {function renderConsumerVersionPage({ logoUrl, scope, user }: any) { - return
; + {function renderConsumerVersionPage({ logoUrl, scope = '', user }: Partial) { + return
; }} ); @@ -49,7 +49,7 @@ class RouterApp extends Component { public renderHomePage = (): ReactElement => { return ( - {function renderConsumerVersionPage({ isUserLoggedIn, packages }: any) { + {function renderConsumerVersionPage({ isUserLoggedIn, packages }: Partial) { // @ts-ignore return ; }} @@ -57,10 +57,10 @@ class RouterApp extends Component { ); }; - public renderVersionPage = (routerProps: any): ReactElement => { + public renderVersionPage = (routerProps): ReactElement => { return ( - {function renderConsumerVersionPage({ isUserLoggedIn }: any) { + {function renderConsumerVersionPage({ isUserLoggedIn }: Partial) { return ; }} diff --git a/src/utils/cli-utils.ts b/src/utils/cli-utils.ts index 1a313f6..de9471c 100644 --- a/src/utils/cli-utils.ts +++ b/src/utils/cli-utils.ts @@ -1,6 +1,6 @@ import { SyntheticEvent } from 'react'; -export const copyToClipBoardUtility = (str: string): any => (event: SyntheticEvent): void => { +export const copyToClipBoardUtility = (str: string): ((e: SyntheticEvent) => void) => (event: SyntheticEvent): void => { event.preventDefault(); const node = document.createElement('div');