diff options
| author | Ivan Chen <ivan@thetaggid.com> | 2021-01-12 12:38:46 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-12 12:38:46 -0500 | 
| commit | 6892c63b899b46fedc9d99b8274a17e9043fe361 (patch) | |
| tree | 454d836c5848b4d9b2e082ae19e4e64679ccd49d /src/screens/onboarding/ProfileOnboarding.tsx | |
| parent | d955c6bc31be3b2e3e289a8dec8b5970251d4090 (diff) | |
[TMA-527/506/523] Custom Moment Categories (#174)
* changed logic to allow ≥ 1 categories
* now using array of strings for moment categories
* updated error strings
* formatting and check for picker cancellation
* initial UI done
* cleaned up logic, added custom icon
* renamed onboarding stack to match main stack
* removed unused import
* deterministic color picker
* custom category defaults to selected instead of added
* removed function in route
Diffstat (limited to 'src/screens/onboarding/ProfileOnboarding.tsx')
| -rw-r--r-- | src/screens/onboarding/ProfileOnboarding.tsx | 52 | 
1 files changed, 30 insertions, 22 deletions
| diff --git a/src/screens/onboarding/ProfileOnboarding.tsx b/src/screens/onboarding/ProfileOnboarding.tsx index 70550f36..1f8e58da 100644 --- a/src/screens/onboarding/ProfileOnboarding.tsx +++ b/src/screens/onboarding/ProfileOnboarding.tsx @@ -147,43 +147,51 @@ const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({    const goToGalleryLargePic = () => {      ImagePicker.openPicker({ -      smartAlbums: ['Favorites', 'RecentlyAdded', 'SelfPortraits', 'Screenshots', 'UserLibrary'], +      smartAlbums: [ +        'Favorites', +        'RecentlyAdded', +        'SelfPortraits', +        'Screenshots', +        'UserLibrary', +      ],        width: 580,        height: 580,        cropping: true,        cropperToolbarTitle: 'Select Header',        mediaType: 'photo', -    }) -      .then((picture) => { -        if ('path' in picture) { -          setForm({ -            ...form, -            largePic: picture.path, -          }); -        } -      }) -      .catch(() => {}); +    }).then((picture) => { +      if ('path' in picture) { +        setForm({ +          ...form, +          largePic: picture.path, +        }); +      } +    });    };    const goToGallerySmallPic = () => {      ImagePicker.openPicker({ -      smartAlbums: ['Favorites', 'RecentlyAdded', 'SelfPortraits', 'Screenshots', 'UserLibrary'], +      smartAlbums: [ +        'Favorites', +        'RecentlyAdded', +        'SelfPortraits', +        'Screenshots', +        'UserLibrary', +      ],        width: 580,        height: 580,        cropping: true,        cropperToolbarTitle: 'Select Profile Picture',        mediaType: 'photo',        cropperCircleOverlay: true, -    }) -      .then((picture) => { -        if ('path' in picture) { -          setForm({ -            ...form, -            smallPic: picture.path, -          }); -        } -      }) -      .catch(() => {}); +    }).then((picture) => { +      if ('path' in picture) { +        setForm({ +          ...form, +          smallPic: picture.path, +        }); +      } +    });    };    /* | 
