diff --git a/example/assets/album-art-1.jpg b/example/assets/album-art-01.jpg similarity index 55% rename from example/assets/album-art-1.jpg rename to example/assets/album-art-01.jpg index 25494e5b..74325b77 100644 Binary files a/example/assets/album-art-1.jpg and b/example/assets/album-art-01.jpg differ diff --git a/example/assets/album-art-2.jpg b/example/assets/album-art-02.jpg similarity index 52% rename from example/assets/album-art-2.jpg rename to example/assets/album-art-02.jpg index 6a6c0724..14d3f4ab 100644 Binary files a/example/assets/album-art-2.jpg and b/example/assets/album-art-02.jpg differ diff --git a/example/assets/album-art-3.jpg b/example/assets/album-art-03.jpg similarity index 55% rename from example/assets/album-art-3.jpg rename to example/assets/album-art-03.jpg index 5e9338d8..b7e87ccb 100644 Binary files a/example/assets/album-art-3.jpg and b/example/assets/album-art-03.jpg differ diff --git a/example/assets/album-art-04.jpg b/example/assets/album-art-04.jpg new file mode 100644 index 00000000..fcf9d645 Binary files /dev/null and b/example/assets/album-art-04.jpg differ diff --git a/example/assets/album-art-05.jpg b/example/assets/album-art-05.jpg new file mode 100644 index 00000000..36a26aa6 Binary files /dev/null and b/example/assets/album-art-05.jpg differ diff --git a/example/assets/album-art-06.jpg b/example/assets/album-art-06.jpg new file mode 100644 index 00000000..efbbcb81 Binary files /dev/null and b/example/assets/album-art-06.jpg differ diff --git a/example/assets/album-art-07.jpg b/example/assets/album-art-07.jpg new file mode 100644 index 00000000..122a069e Binary files /dev/null and b/example/assets/album-art-07.jpg differ diff --git a/example/assets/album-art-08.jpg b/example/assets/album-art-08.jpg new file mode 100644 index 00000000..8180910e Binary files /dev/null and b/example/assets/album-art-08.jpg differ diff --git a/example/assets/album-art-09.jpg b/example/assets/album-art-09.jpg new file mode 100644 index 00000000..a8083f1c Binary files /dev/null and b/example/assets/album-art-09.jpg differ diff --git a/example/assets/album-art-10.jpg b/example/assets/album-art-10.jpg new file mode 100644 index 00000000..19032489 Binary files /dev/null and b/example/assets/album-art-10.jpg differ diff --git a/example/assets/album-art-11.jpg b/example/assets/album-art-11.jpg new file mode 100644 index 00000000..ce67e77d Binary files /dev/null and b/example/assets/album-art-11.jpg differ diff --git a/example/assets/album-art-12.jpg b/example/assets/album-art-12.jpg new file mode 100644 index 00000000..589d1829 Binary files /dev/null and b/example/assets/album-art-12.jpg differ diff --git a/example/assets/album-art-13.jpg b/example/assets/album-art-13.jpg new file mode 100644 index 00000000..bc8f18b1 Binary files /dev/null and b/example/assets/album-art-13.jpg differ diff --git a/example/assets/album-art-14.jpg b/example/assets/album-art-14.jpg new file mode 100644 index 00000000..bba1e600 Binary files /dev/null and b/example/assets/album-art-14.jpg differ diff --git a/example/assets/album-art-15.jpg b/example/assets/album-art-15.jpg new file mode 100644 index 00000000..f21ce4c9 Binary files /dev/null and b/example/assets/album-art-15.jpg differ diff --git a/example/assets/album-art-16.jpg b/example/assets/album-art-16.jpg new file mode 100644 index 00000000..1a3c0a0d Binary files /dev/null and b/example/assets/album-art-16.jpg differ diff --git a/example/assets/album-art-17.jpg b/example/assets/album-art-17.jpg new file mode 100644 index 00000000..ac832bee Binary files /dev/null and b/example/assets/album-art-17.jpg differ diff --git a/example/assets/album-art-18.jpg b/example/assets/album-art-18.jpg new file mode 100644 index 00000000..90bedaff Binary files /dev/null and b/example/assets/album-art-18.jpg differ diff --git a/example/assets/album-art-19.jpg b/example/assets/album-art-19.jpg new file mode 100644 index 00000000..e471bc25 Binary files /dev/null and b/example/assets/album-art-19.jpg differ diff --git a/example/assets/album-art-20.jpg b/example/assets/album-art-20.jpg new file mode 100644 index 00000000..131938e5 Binary files /dev/null and b/example/assets/album-art-20.jpg differ diff --git a/example/assets/album-art-21.jpg b/example/assets/album-art-21.jpg new file mode 100644 index 00000000..962ec3dc Binary files /dev/null and b/example/assets/album-art-21.jpg differ diff --git a/example/assets/album-art-22.jpg b/example/assets/album-art-22.jpg new file mode 100644 index 00000000..10018e15 Binary files /dev/null and b/example/assets/album-art-22.jpg differ diff --git a/example/assets/album-art-23.jpg b/example/assets/album-art-23.jpg new file mode 100644 index 00000000..6f35a038 Binary files /dev/null and b/example/assets/album-art-23.jpg differ diff --git a/example/assets/album-art-24.jpg b/example/assets/album-art-24.jpg new file mode 100644 index 00000000..5c68c37d Binary files /dev/null and b/example/assets/album-art-24.jpg differ diff --git a/example/assets/album-art-4.jpg b/example/assets/album-art-4.jpg deleted file mode 100644 index e828a9c4..00000000 Binary files a/example/assets/album-art-4.jpg and /dev/null differ diff --git a/example/assets/album-art-5.jpg b/example/assets/album-art-5.jpg deleted file mode 100644 index 4f0599bd..00000000 Binary files a/example/assets/album-art-5.jpg and /dev/null differ diff --git a/example/assets/album-art-6.jpg b/example/assets/album-art-6.jpg deleted file mode 100644 index 2fe94278..00000000 Binary files a/example/assets/album-art-6.jpg and /dev/null differ diff --git a/example/assets/album-art-7.jpg b/example/assets/album-art-7.jpg deleted file mode 100644 index 2b2e68d2..00000000 Binary files a/example/assets/album-art-7.jpg and /dev/null differ diff --git a/example/assets/album-art-8.jpg b/example/assets/album-art-8.jpg deleted file mode 100644 index 139527c5..00000000 Binary files a/example/assets/album-art-8.jpg and /dev/null differ diff --git a/example/assets/book.jpg b/example/assets/book.jpg index e2244b5e..a3ad6ebf 100644 Binary files a/example/assets/book.jpg and b/example/assets/book.jpg differ diff --git a/example/assets/icon.png b/example/assets/icon.png index ddd97b64..da81484c 100644 Binary files a/example/assets/icon.png and b/example/assets/icon.png differ diff --git a/example/src/Shared/Albums.tsx b/example/src/Shared/Albums.tsx index 5af788c6..a4e772d8 100644 --- a/example/src/Shared/Albums.tsx +++ b/example/src/Shared/Albums.tsx @@ -2,23 +2,41 @@ import * as React from 'react'; import { + View, Image, - Dimensions, ScrollView, StyleSheet, ScrollViewProps, + Dimensions, + Platform, } from 'react-native'; import { useScrollToTop } from '@react-navigation/native'; const COVERS = [ - require('../../assets/album-art-1.jpg'), - require('../../assets/album-art-2.jpg'), - require('../../assets/album-art-3.jpg'), - require('../../assets/album-art-4.jpg'), - require('../../assets/album-art-5.jpg'), - require('../../assets/album-art-6.jpg'), - require('../../assets/album-art-7.jpg'), - require('../../assets/album-art-8.jpg'), + require('../../assets/album-art-01.jpg'), + require('../../assets/album-art-02.jpg'), + require('../../assets/album-art-03.jpg'), + require('../../assets/album-art-04.jpg'), + require('../../assets/album-art-05.jpg'), + require('../../assets/album-art-06.jpg'), + require('../../assets/album-art-07.jpg'), + require('../../assets/album-art-08.jpg'), + require('../../assets/album-art-09.jpg'), + require('../../assets/album-art-10.jpg'), + require('../../assets/album-art-11.jpg'), + require('../../assets/album-art-12.jpg'), + require('../../assets/album-art-13.jpg'), + require('../../assets/album-art-14.jpg'), + require('../../assets/album-art-15.jpg'), + require('../../assets/album-art-16.jpg'), + require('../../assets/album-art-17.jpg'), + require('../../assets/album-art-18.jpg'), + require('../../assets/album-art-19.jpg'), + require('../../assets/album-art-20.jpg'), + require('../../assets/album-art-21.jpg'), + require('../../assets/album-art-22.jpg'), + require('../../assets/album-art-23.jpg'), + require('../../assets/album-art-24.jpg'), ]; export default function Albums(props: Partial) { @@ -27,34 +45,46 @@ export default function Albums(props: Partial) { useScrollToTop(ref); return ( - + {COVERS.map((source, i) => ( // eslint-disable-next-line react/no-array-index-key - - ))} - {COVERS.map((source, i) => ( - // eslint-disable-next-line react/no-array-index-key - + + + ))} ); } const styles = StyleSheet.create({ - container: { - backgroundColor: '#000', - }, content: { flexDirection: 'row', flexWrap: 'wrap', }, - cover: { - width: '50%', - height: Dimensions.get('window').width / 2, + ...Platform.select({ + web: { + content: { + display: 'grid' as 'none', + gridTemplateColumns: 'repeat(auto-fill, minmax(150px, 1fr))', + }, + item: { + width: '100%', + }, + }, + default: { + content: { + flexDirection: 'row', + flexWrap: 'wrap', + }, + item: { + height: Dimensions.get('window').width / 2, + width: '50%', + }, + }, + }), + photo: { + flex: 1, + resizeMode: 'cover', + paddingTop: '100%', }, });