diff --git a/src/components/App.tsx b/src/components/App.tsx index 8ee8903..178b758 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1,11 +1,11 @@ -import { FC, useState } from 'react' +import { useState } from 'react' import Header from './Header' import SearchBox from './SearchBox' import CharactersList from './CharactersList' import marvel from '../services/marvelApi' import loadingSpinner from '../assets/images/loading.gif' -const App: FC = () => { +function App() { const [metadata, setMetadata] = useState({}) const [characters, setCharacters] = useState([]) const [loading, setLoading] = useState(false) @@ -23,7 +23,7 @@ const App: FC = () => { setMetadata(responseMetadata) setCharacters(results) } catch (ex) { - console.error(ex) + console.error(ex) // eslint-disable-line no-console } finally { setLoading(false) } @@ -38,20 +38,19 @@ const App: FC = () => {

- + + {loading ? (
Loading animation
-
- - + ) : ( submitSearch(lastSearch, page)} /> - + )}
diff --git a/src/components/CharacterCard/index.tsx b/src/components/CharacterCard/index.tsx index e3b6af9..e3f53cc 100644 --- a/src/components/CharacterCard/index.tsx +++ b/src/components/CharacterCard/index.tsx @@ -1,38 +1,39 @@ -import { FC } from 'react' import './styles.scss' interface CharacterCardProps { - showDetails: (CharacterCard?: any) => any + showDetails: (record?: any) => any character: any } -const CharacterCard: FC = ({ character, showDetails }) => ( -
-
-
- Character thumbnail +function CharacterCard({ character, showDetails }: CharacterCardProps) { + return ( +
+
+
+ Character thumbnail -
-

- {character.name} -

-
- +
+

+ {character.name} +

+
+ +
-
-) + ) +} export default CharacterCard diff --git a/src/components/CharacterModal/index.tsx b/src/components/CharacterModal/index.tsx index 0d915b0..00dc551 100644 --- a/src/components/CharacterModal/index.tsx +++ b/src/components/CharacterModal/index.tsx @@ -1,4 +1,4 @@ -import { FC, useEffect } from 'react' +import { useEffect } from 'react' import $ from 'jquery' import './styles.scss' @@ -7,7 +7,7 @@ interface CharacterModalProps { character: any } -const CharacterModal: FC = ({ character, hideDetails }) => { +function CharacterModal({ character, hideDetails }: CharacterModalProps) { useEffect(() => { $('#character-details').modal('show') $(document.body).css({ @@ -23,7 +23,12 @@ const CharacterModal: FC = ({ character, hideDetails }) => }, [hideDetails]) return ( -