diff --git a/src/components/ImageList/index.css b/src/components/ImageList/index.css deleted file mode 100644 index 517c09b..0000000 --- a/src/components/ImageList/index.css +++ /dev/null @@ -1,10 +0,0 @@ -ion-card { - max-width: 450px; - margin-left: auto; - margin-right: auto; -} - -ion-button { - max-width: 450px; - margin: 40px auto; -} diff --git a/src/components/ImageList/index.tsx b/src/components/ImageList/index.tsx deleted file mode 100644 index 6bedbd4..0000000 --- a/src/components/ImageList/index.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import React from 'react'; -import { - IonCard, - IonCardHeader, - IonCardContent, - IonCardTitle, - IonCardSubtitle, - IonImg, - IonSkeletonText, - IonNote, - IonButton, - IonSpinner, -} from '@ionic/react'; -import './index.css'; -import { useTranslation } from 'react-i18next'; - -const ImageCardSkelleton = () => { - return ( - - - - - - - - - - - - - - - - - - - - - - ); -}; - -interface ImageListProps { - imageList: any; - loadImageListMore: Function; -} - -export const ImageList: React.FC = props => { - const { imageList, loadImageListMore } = props; - const { t } = useTranslation(); - - if (imageList.error) { - return ( -
- - {t('IMAGELIST.ERROR.NOTE.HEADER')} -

{t('IMAGELIST.ERROR.NOTE.PARAGRAPH')}

-
-
- ); - } - - const { loading, data } = imageList; - - if (loading && data.values.length === 0) { - return (new Array(10) - .fill(null) - .map((value, index) => ( - - )) as any) as JSX.Element; - } - - if (data.values.length === 0) { - return ( -
- - {t('IMAGELIST.NODATA.NOTE.HEADER')} -

{t('IMAGELIST.NODATA.NOTE.PARAGRAPH')}

-
-
- ); - } - - return ( - <> - {data.values.map((item: any) => { - return ( - - - {t('IMAGELIST.ITEM.AUTHOR')} - {item.author} - - - - {`Id: ${item.id}`} - - {JSON.stringify(item)} - - ); - })} - loadImageListMore(data.next)} - > - {loading ? : 'Load More'} - - - ); -}; - -export default ImageList;