diff --git a/README.md b/README.md index 5ddf859..d71e1f7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ FIDAS Verona – Federazione Italiana Associazioni Donatori di Sangue ## Setup -### Install dependencies +### Project setup Clone the project @@ -24,7 +24,7 @@ Install dependencies yarn install ``` -### Setup environment +### Environment setup The `.env` and `.env.dev` file is needed to run this application. An example `.env.sample` file can be found inside the repository diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index a2f5908..5dd8710 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..ef2b19b Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png index 1b52399..7cd0ce5 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index ff10afd..735aadc 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..78ebdce Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png index 115a4c7..dc1d733 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index dcd3cd8..dc7b40c 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..6ef1629 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png index 459ca60..04298b2 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 8ca12fe..afc6507 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..3b92e33 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png index 8e19b41..46b9d08 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index b824ebd..a717f3e 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..7cd137b Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png index 4c19a13..99aa5c9 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/100.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/100.png new file mode 100644 index 0000000..b4ba89f Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/100.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/1024.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/1024.png new file mode 100644 index 0000000..c179f5b Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/1024.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/114.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/114.png new file mode 100644 index 0000000..a955577 Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/114.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/120.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/120.png new file mode 100644 index 0000000..bff872a Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/120.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/144.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/144.png new file mode 100644 index 0000000..00dd1ec Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/144.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/152.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/152.png new file mode 100644 index 0000000..08428a9 Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/152.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/167.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/167.png new file mode 100644 index 0000000..f6a3f07 Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/167.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/180.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/180.png new file mode 100644 index 0000000..459c86e Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/180.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/20.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/20.png new file mode 100644 index 0000000..85ffac3 Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/20.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/29.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/29.png new file mode 100644 index 0000000..bdf5f22 Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/29.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/40.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/40.png new file mode 100644 index 0000000..e93bab2 Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/40.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/50.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/50.png new file mode 100644 index 0000000..c67d16c Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/50.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/57.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/57.png new file mode 100644 index 0000000..9bcac4d Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/57.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/58.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/58.png new file mode 100644 index 0000000..9ee56cf Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/58.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/60.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/60.png new file mode 100644 index 0000000..9deb1f1 Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/60.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/72.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/72.png new file mode 100644 index 0000000..afab489 Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/72.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/76.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/76.png new file mode 100644 index 0000000..a3dbdd2 Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/76.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/80.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/80.png new file mode 100644 index 0000000..4050473 Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/80.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/87.png b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/87.png new file mode 100644 index 0000000..bf41d99 Binary files /dev/null and b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/87.png differ diff --git a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/Contents.json index ddd7fca..3966d71 100644 --- a/ios/fidasverona/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/fidasverona/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,53 +1,204 @@ { "images": [ { + "size": "60x60", + "expected-size": "180", + "filename": "180.png", + "folder": "Images.xcassets/AppIcon.appiconset/", "idiom": "iphone", - "scale": "2x", - "size": "20x20" + "scale": "3x" }, { + "size": "40x40", + "expected-size": "80", + "filename": "80.png", + "folder": "Images.xcassets/AppIcon.appiconset/", "idiom": "iphone", - "scale": "3x", - "size": "20x20" + "scale": "2x" }, { + "size": "40x40", + "expected-size": "120", + "filename": "120.png", + "folder": "Images.xcassets/AppIcon.appiconset/", "idiom": "iphone", - "scale": "2x", - "size": "29x29" + "scale": "3x" }, { + "size": "60x60", + "expected-size": "120", + "filename": "120.png", + "folder": "Images.xcassets/AppIcon.appiconset/", "idiom": "iphone", - "scale": "3x", - "size": "29x29" + "scale": "2x" }, { + "size": "57x57", + "expected-size": "57", + "filename": "57.png", + "folder": "Images.xcassets/AppIcon.appiconset/", "idiom": "iphone", - "scale": "2x", - "size": "40x40" + "scale": "1x" }, { + "size": "29x29", + "expected-size": "58", + "filename": "58.png", + "folder": "Images.xcassets/AppIcon.appiconset/", "idiom": "iphone", - "scale": "3x", - "size": "40x40" + "scale": "2x" }, { + "size": "29x29", + "expected-size": "29", + "filename": "29.png", + "folder": "Images.xcassets/AppIcon.appiconset/", "idiom": "iphone", - "scale": "2x", - "size": "60x60" + "scale": "1x" }, { + "size": "29x29", + "expected-size": "87", + "filename": "87.png", + "folder": "Images.xcassets/AppIcon.appiconset/", "idiom": "iphone", - "scale": "3x", - "size": "60x60" + "scale": "3x" }, { + "size": "57x57", + "expected-size": "114", + "filename": "114.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "iphone", + "scale": "2x" + }, + { + "size": "20x20", + "expected-size": "40", + "filename": "40.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "iphone", + "scale": "2x" + }, + { + "size": "20x20", + "expected-size": "60", + "filename": "60.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "iphone", + "scale": "3x" + }, + { + "size": "1024x1024", + "filename": "1024.png", + "expected-size": "1024", "idiom": "ios-marketing", - "scale": "1x", - "size": "1024x1024" + "folder": "Images.xcassets/AppIcon.appiconset/", + "scale": "1x" + }, + { + "size": "40x40", + "expected-size": "80", + "filename": "80.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "2x" + }, + { + "size": "72x72", + "expected-size": "72", + "filename": "72.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "1x" + }, + { + "size": "76x76", + "expected-size": "152", + "filename": "152.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "2x" + }, + { + "size": "50x50", + "expected-size": "100", + "filename": "100.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "2x" + }, + { + "size": "29x29", + "expected-size": "58", + "filename": "58.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "2x" + }, + { + "size": "76x76", + "expected-size": "76", + "filename": "76.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "1x" + }, + { + "size": "29x29", + "expected-size": "29", + "filename": "29.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "1x" + }, + { + "size": "50x50", + "expected-size": "50", + "filename": "50.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "1x" + }, + { + "size": "72x72", + "expected-size": "144", + "filename": "144.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "2x" + }, + { + "size": "40x40", + "expected-size": "40", + "filename": "40.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "1x" + }, + { + "size": "83.5x83.5", + "expected-size": "167", + "filename": "167.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "2x" + }, + { + "size": "20x20", + "expected-size": "20", + "filename": "20.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "1x" + }, + { + "size": "20x20", + "expected-size": "40", + "filename": "40.png", + "folder": "Images.xcassets/AppIcon.appiconset/", + "idiom": "ipad", + "scale": "2x" } - ], - "info": { - "author": "xcode", - "version": 1 - } + ] } diff --git a/src/components/commons/DonationsCenterCard.tsx b/src/components/commons/DonationsCenterCard.tsx index 97027ce..e00e9ee 100644 --- a/src/components/commons/DonationsCenterCard.tsx +++ b/src/components/commons/DonationsCenterCard.tsx @@ -43,7 +43,7 @@ function DonationsCenterCard({ donationsCenter, onBookmarkPress }: DonationsCent // Render return ( - + @@ -72,7 +72,7 @@ function DonationsCenterCard({ donationsCenter, onBookmarkPress }: DonationsCent const styles = StyleSheet.create({ contactContainer: { - columnGap: 12, + columnGap: 8, }, }); diff --git a/src/components/commons/NextDonationCard.tsx b/src/components/commons/NextDonationCard.tsx index 15cc77e..3e6bb03 100644 --- a/src/components/commons/NextDonationCard.tsx +++ b/src/components/commons/NextDonationCard.tsx @@ -22,7 +22,7 @@ import { formateDate } from '../../utils/formatters'; import { Donation } from '../../types/entities'; type NextDonationCardProps = { - lastDonation?: Donation; + lastDonation: Donation; }; /** @@ -32,29 +32,22 @@ type NextDonationCardProps = { function NextDonationCard({ lastDonation }: NextDonationCardProps) { // Memos const lastDonationDate = useMemo(() => { - if (!lastDonation) return undefined; return new Date(lastDonation.date); }, [lastDonation]); const nextSADonationDate = useMemo(() => { - if (!lastDonationDate) return new Date(); - const date = new Date(lastDonationDate); date.setDate(date.getDate() + SA_DONATION_INTERVAL); return date; }, [lastDonationDate]); const nextPLDonationDate = useMemo(() => { - if (!lastDonationDate) return new Date(); - const date = new Date(lastDonationDate); date.setDate(date.getDate() + PL_DONATION_INTERVAL); return date; }, [lastDonationDate]); const nextPIDonationDate = useMemo(() => { - if (!lastDonationDate) return new Date(); - const date = new Date(lastDonationDate); date.setDate(date.getDate() + PI_DONATION_INTERVAL); return date; diff --git a/src/components/commons/TotalDonationsCard.tsx b/src/components/commons/TotalDonationsCard.tsx index a9b26b7..bb8e7fd 100644 --- a/src/components/commons/TotalDonationsCard.tsx +++ b/src/components/commons/TotalDonationsCard.tsx @@ -56,7 +56,9 @@ function TotalDonationsCard({ donationsNumber, gender }: TotalDonationsCardProps return ( - + {donationsNumber > 0 && ( + + )} diff --git a/src/components/icons/Logo.tsx b/src/components/icons/Logo.tsx index cb5072a..b7e5f4a 100644 --- a/src/components/icons/Logo.tsx +++ b/src/components/icons/Logo.tsx @@ -1,24 +1,77 @@ // Assets -import { Defs, Image, Pattern, Rect, Svg, SvgProps, Use } from 'react-native-svg'; +import { Path, Svg, SvgProps } from 'react-native-svg'; function Logo(props: SvgProps & { size?: number }) { const { size } = props; // Render return ( - - - - - - - - + + + + + + + + + + + + + + ); } diff --git a/src/locales/en.json b/src/locales/en.json index 82c18f5..9d84db9 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -66,8 +66,10 @@ "confirmOperation": "Do you confirm the operation?", "congratulations": "Congratulations!", "hello": "Hello,", + "logoutMessage": "Are you sure you want to logout?", "nextAchievement": "Next achievement:", "nextDonation": "Next donation:", + "noDonationsToShow": "No donation to show", "totalDonations": "Total donations", "whereDonate": "Where you can donate", "youPerformed": "You performed:" diff --git a/src/locales/it.json b/src/locales/it.json index a5d7b24..cb7e373 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -66,8 +66,10 @@ "confirmOperation": "Confermi l'operazione?", "congratulations": "Complimenti!", "hello": "Ciao,", + "logoutMessage": "Sei sicuro di voler fare il logout?", "nextAchievement": "Prossimo traguardo:", "nextDonation": "Potrai donare tra:", + "noDonationsToShow": "Nessuna donaziona da mostrare", "totalDonations": "Donazioni totali", "whereDonate": "Dove puoi donare", "youPerformed": "Hai effettuato:" diff --git a/src/screens/DonationsScreen.tsx b/src/screens/DonationsScreen.tsx index 7a709f4..5ba3a92 100644 --- a/src/screens/DonationsScreen.tsx +++ b/src/screens/DonationsScreen.tsx @@ -65,40 +65,44 @@ function DonationsScreen() { - - - - - - - - - - {user.donations.map(donation => ( - - - + {user.donations.length ? ( + + + + - + - ))} - - + {user.donations.map(donation => ( + + + + + + + + + ))} + + + ) : ( + + )} ); diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index 46596da..de5c3f2 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -88,7 +88,7 @@ function HomeScreen() { /> - + {user.donations[0] && } navigation.navigate('DonationsCenters')} /> ); diff --git a/src/screens/UserScreen.tsx b/src/screens/UserScreen.tsx index 1b12df8..2a720a2 100644 --- a/src/screens/UserScreen.tsx +++ b/src/screens/UserScreen.tsx @@ -24,6 +24,7 @@ import Header from '../components/navigation/Header'; import { DONATIONS_ACHIEVEMENTS } from '../config/constants'; // Utils +import { showAlert } from '../utils/alert'; import { formateDate } from '../utils/formatters'; // Types @@ -58,7 +59,14 @@ function UserScreen() { // Callbacks const handleLogoutPress = useCallback(() => { - dispatch(logout()); + showAlert('general:warning', 'messages:logoutMessage', [ + { text: 'general:cancel', style: 'cancel' }, + { + text: 'general:logout', + style: 'destructive', + onPress: () => dispatch(logout()), + }, + ]); }, []); // Render @@ -99,17 +107,17 @@ function UserScreen() { - - - {user.secondaryPhone && ( - - + + {user.secondaryPhone && } - )} + - +