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/profile | |
| 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/profile')
| -rw-r--r-- | src/screens/profile/EditProfile.tsx | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/src/screens/profile/EditProfile.tsx b/src/screens/profile/EditProfile.tsx index 55e19a51..d86ae7cb 100644 --- a/src/screens/profile/EditProfile.tsx +++ b/src/screens/profile/EditProfile.tsx @@ -131,43 +131,51 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => { 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, + }); + } + }); }; /* |
