Compare commits

...

403 commits

Author SHA1 Message Date
c1d02de5d2 Merge branch 'dev' 2020-05-27 11:22:28 +02:00
2b7ec560d2 Disabled hermes as it stops .aab from working on the play store 2020-05-27 11:19:18 +02:00
4af00b8802 Removed proximo list bottom padding 2020-05-20 11:48:01 +02:00
ea33e1c017 Updated libraries 2020-05-20 11:45:15 +02:00
f15b489989 Fixed about screen not following package.json version 2020-05-20 11:17:01 +02:00
b9269934a7 Updated changelog 2020-05-20 10:56:43 +02:00
b8236146ff Updated version number to 3.0.0 2020-05-20 10:46:34 +02:00
2cb5004a32 Removed coverage files 2020-05-20 10:41:54 +02:00
cad2c3e81c Updated install instructions without Expo 2020-05-20 10:40:35 +02:00
7ef23ca952 Changed running machine icon 2020-05-20 10:05:56 +02:00
4228a5555d Added update notes 2020-05-10 13:41:12 +02:00
41abbfb03f Added vote image 2020-05-10 12:42:00 +02:00
cbc1e88a37 Fixed webview crash on android 9+ 2020-05-02 22:46:44 +02:00
0c9b70998d Fixed planex theme change and removed unused planex controls 2020-05-01 21:41:08 +02:00
d8f7dc72d4 Removed console.log 2020-05-01 17:38:57 +02:00
ddfac76f4e Updated libraries 2020-05-01 17:36:04 +02:00
097ea5379a use react native community async storage 2020-05-01 16:57:37 +02:00
e96f55d142 Removed unused icons and changed android activity background 2020-05-01 16:43:20 +02:00
2dab27de22 Further performance improvements 2020-05-01 16:38:57 +02:00
3d0e03cb9d Removed expo from used technologies 2020-05-01 16:36:11 +02:00
854e03e893 Show settings and about buttons by default 2020-05-01 16:35:23 +02:00
885bf239d8 Changed icons color 2020-05-01 16:32:23 +02:00
9e4e340302 Fixed modal displaying negative remaining times 2020-05-01 16:18:55 +02:00
ea16a1f50f Improved planex group search performance 2020-05-01 16:13:46 +02:00
0b7191887d Improved settings screen elements 2020-05-01 15:59:47 +02:00
517e75f4b9 Fixed accordion auto closing on setting selection 2020-05-01 11:10:26 +02:00
cb522466c7 Fixed tab bar icon not updating on theme change 2020-05-01 11:06:37 +02:00
eda9edd21c Updated icons 2020-05-01 11:03:46 +02:00
b83b142942 Fixed crash 2020-04-30 23:05:59 +02:00
65eb4dd77b Added notification translation 2020-04-30 22:49:25 +02:00
aa2fad344a Improved notification activation on corner cases 2020-04-30 22:38:33 +02:00
1835fcadf9 Added tests for proxiwash util functions 2020-04-30 22:16:35 +02:00
7fb4de3c5b Augmented app delegate to use ios notifications 2020-04-30 18:13:39 +02:00
9882873861 added ios notifications dependency 2020-04-30 18:08:36 +02:00
e5299ed9c3 Moved util functions in own file 2020-04-30 14:58:12 +02:00
087331258a Added local notifications on android 2020-04-30 14:04:31 +02:00
f8ded811f4 Fixed ios build crash 2020-04-29 21:09:30 +02:00
7e4c385083 Removed unimodules from ios 2020-04-29 17:52:25 +02:00
f89aa2d2ff Load only used icon font 2020-04-29 17:43:18 +02:00
a4bbd84136 Completely removed expo from android project 2020-04-29 13:04:59 +02:00
8daa2641dc Use react native camera instead of expo one 2020-04-29 11:34:52 +02:00
4f49b48fc5 Disabled some expo unimodules 2020-04-29 10:10:36 +02:00
ca6f66c661 Use react native vector icons instead of expo implementation 2020-04-29 08:49:09 +02:00
660bbd856a Fixed default proximo sort order 2020-04-28 22:16:14 +02:00
aeb7c438b1 Changed feedback buttons style 2020-04-28 20:30:58 +02:00
252272cd55 Changed default transitions 2020-04-28 20:22:55 +02:00
070d6beb83 Improved accordion performance 2020-04-28 20:18:52 +02:00
1e0cc867b8 Forced android to allow http traffic 2020-04-28 19:06:22 +02:00
35141eaa21 Workaround android 9+ crash on planex group selection screen navigation 2020-04-28 15:33:37 +02:00
dfa7d2220f Fixed debug not dynamically activating 2020-04-28 10:59:55 +02:00
50a5f087b6 Fixed banner content offset 2020-04-28 10:57:36 +02:00
e1014a173e Merge branch 'bare' of https://git.etud.insa-toulouse.fr/vergnet/application-amicale into bare 2020-04-28 08:32:19 +02:00
2c8356f9d3 Improved splash screen 2020-04-28 08:31:11 +02:00
470ec8bcdb Updated console.log usage 2020-04-28 08:24:55 +02:00
987bbf9113 Updated permissions 2020-04-28 08:22:31 +02:00
9980e78918 use react native keystore instead of expo secure store 2020-04-27 22:55:24 +02:00
2b620fdc2d Updated script 2020-04-27 22:07:42 +02:00
bb5d453a2b Replaced expo permissions by react native one 2020-04-27 22:05:36 +02:00
b784a5d164 Replaced expo localization by react native one 2020-04-27 21:47:49 +02:00
6ca2ca67a5 Replaced expo linear gradient by react native one 2020-04-27 21:40:30 +02:00
7181579481 Use react native Linking instead of expo 2020-04-27 21:30:12 +02:00
a56d2978e1 Merge branch 'bare' of https://git.etud.insa-toulouse.fr/vergnet/application-amicale into bare 2020-04-27 08:48:01 +02:00
15733c2019 edited xcode project 2020-04-27 08:47:44 +02:00
cb5fac940b Added android splash screen 2020-04-26 23:05:27 +02:00
19d5663210 Added ios linking code 2020-04-26 22:35:34 +02:00
6607d9206b Fixed qr code crash 2020-04-26 22:33:43 +02:00
8a1f0d110b Added ios icons 2020-04-26 20:11:14 +02:00
2d9eed6d95 fixed build crash 2020-04-26 12:45:35 +02:00
31d68de2f8 loaded xcode project 2020-04-26 00:11:46 +02:00
aee51d5dfb Removed expo updates specific ios code 2020-04-25 22:59:53 +02:00
f1ed672824 Fixed intro statusbar color on android 2020-04-25 18:10:20 +02:00
5048f979a7 Fixed intro image 2020-04-25 17:54:14 +02:00
51ffb15365 Removed unnecessary permissions in release build 2020-04-25 17:29:02 +02:00
82f208b366 Fixed crash on club screen 2020-04-25 16:49:13 +02:00
13b9e8dad0 Fixed crash on about screen 2020-04-25 16:39:07 +02:00
9e904bc2d5 Updated android icon 2020-04-25 16:23:55 +02:00
04ad4901c1 Ejected to bare 2020-04-25 15:09:08 +02:00
a779a3049e Changed contact mail 2020-04-23 15:29:58 +02:00
cca091beef Updated Changelog.md to 2.0.0 (oupsi forgot) 2020-04-23 15:27:24 +02:00
8c9e068faa Added bug report button on home screen 2020-04-23 15:19:34 +02:00
9e251ad150 Replaced bug report modal by a screen 2020-04-23 15:06:19 +02:00
eb71316995 Moved services related files into services folder 2020-04-23 14:07:42 +02:00
03d57e91d9 Updated about screen 2020-04-23 14:05:39 +02:00
24106e9791 Fixed recursive import warning 2020-04-23 13:49:58 +02:00
7162978503 Fixed ios header back button title 2020-04-23 11:25:02 +02:00
b7e1d56ff6 Fixed ios warnings 2020-04-23 11:23:38 +02:00
f617dba1e6 Fixed ios style 2020-04-23 11:19:35 +02:00
0267ff70ce Improved error messages 2020-04-23 11:05:35 +02:00
2fc2db39c7 Fixed planning url link and added loading dialog on link scanned 2020-04-23 10:38:43 +02:00
f8363353c3 Changed home button click effect and added tetris on long press 2020-04-23 10:10:52 +02:00
0410499593 Removed paging as it caused problems on some screen sizes 2020-04-23 08:51:22 +02:00
43a3d64deb Made collapsible header opaque 2020-04-23 08:46:22 +02:00
c4337b13cb Added contact link 2020-04-23 08:39:07 +02:00
b7d6c98025 Updated default screen transition 2020-04-23 08:06:13 +02:00
033bb388fd Moved collapsible stack creating in own file 2020-04-23 08:02:34 +02:00
56effeaaf9 Moved amicale contact to services header button 2020-04-22 23:14:04 +02:00
b83e748d29 Fixed club information page 2020-04-22 21:40:04 +02:00
65ba27ea26 Fixed navigation white background 2020-04-22 21:37:40 +02:00
3a3cf200f5 Moved services screen outside of tab navigation for improved usability 2020-04-22 21:33:05 +02:00
3bac6d6662 Enabled horizontal paging 2020-04-22 20:44:05 +02:00
4c4f968e25 Updated settings default screen 2020-04-22 20:08:46 +02:00
0f0b63bdd7 Fixed broken reset button 2020-04-22 19:44:30 +02:00
ac9709d666 Updated translations 2020-04-22 18:54:34 +02:00
f7e66b1251 Reduced splash size 2020-04-22 18:46:54 +02:00
38a5761f23 Removed drawer related files and renamed navigator for more coherence 2020-04-22 18:36:57 +02:00
faa174b8f1 Moved proximo and proxiwash images on the web 2020-04-22 18:34:23 +02:00
030cf7b795 Fixed text alignement 2020-04-22 15:20:10 +02:00
e8fc8b79dc Updated translations 2020-04-22 15:19:00 +02:00
62db99cac7 Reduced image size 2020-04-22 14:58:08 +02:00
87f0c01024 Redirect to service screen index 2020-04-22 12:29:36 +02:00
b5d2f686dd Fixed image alignement 2020-04-22 12:28:35 +02:00
9207d02c2a Improved dashboard amicale item 2020-04-22 12:20:55 +02:00
b31269586b Use card items when viewing the section 2020-04-22 12:08:23 +02:00
fc7754588f Improved login flow 2020-04-22 11:49:22 +02:00
92fce1d425 Fixed login redirection error 2020-04-22 11:35:01 +02:00
0c71a78b22 Enabled collapsing header in login screen 2020-04-22 11:18:43 +02:00
c9b8a6e2ca Added login/logout icon on home 2020-04-22 11:12:24 +02:00
3f945fca7a Added services section title to match current section 2020-04-22 10:49:54 +02:00
49fa8a82e3 Improved readability 2020-04-22 10:47:18 +02:00
524dd5362a Changed sections icons 2020-04-22 10:45:31 +02:00
443f179f1d Changed cards to basic view 2020-04-22 10:42:02 +02:00
8eaa46b900 Added amicale section 2020-04-22 10:14:37 +02:00
926515213d Improved code readability 2020-04-22 09:54:40 +02:00
bbe343da3b Render services in sections 2020-04-22 09:37:31 +02:00
8fca2eac12 Moved tab order 2020-04-22 08:50:47 +02:00
20cff1aeb1 Fixed ref warning 2020-04-21 20:05:21 +02:00
96ed75ac72 Added collapsible header to profile 2020-04-21 20:02:17 +02:00
b151a8ff6f Updated translations and fixed filenames 2020-04-21 19:54:53 +02:00
1f0ada3b24 Improved project structure 2020-04-21 19:48:44 +02:00
78634b0c5d Added more websites 2020-04-21 19:46:33 +02:00
e6835b0d6f Improved dashboard interaction 2020-04-21 19:40:40 +02:00
03c4a43e58 Moved all services in same tab and planning in its own 2020-04-21 19:30:13 +02:00
0b17a35856 Improved selection screens 2020-04-21 15:17:00 +02:00
77cc5d8746 Changed tab order and stacks 2020-04-21 12:59:36 +02:00
3b977bdf64 Added badge animation 2020-04-21 10:38:38 +02:00
dca27e091c Always show home content even if an error occurred 2020-04-21 10:35:04 +02:00
dc57cbd7bd Improved dashboard items placement 2020-04-21 10:22:32 +02:00
c37e052aa2 Removed drawer and put all links in home screen 2020-04-21 09:50:13 +02:00
8943dcadcb Rewrote navigation to show back button when navigating away from home 2020-04-20 23:12:58 +02:00
b2073747c9 Improved statusbar color 2020-04-20 20:55:37 +02:00
6b04447535 Fixed header jumping on ProximoListScreen.js 2020-04-20 20:51:32 +02:00
02f3ff0ff9 Fixed app.json errors and updated image modal 2020-04-20 19:40:16 +02:00
01e3195be7 Improved screen changing performances and removed tab screen animations 2020-04-20 19:27:23 +02:00
da92856478 Changed planex bar animation 2020-04-20 14:42:17 +02:00
774f28a32e Moved assets loading in constructor to improve loading time 2020-04-20 14:28:32 +02:00
f0772dff38 Fixed app failing to load in apk format 2020-04-20 12:28:25 +02:00
a3a1b2e29c Fixed self menu icon 2020-04-20 09:52:32 +02:00
5db7649bec Removed logs 2020-04-20 09:48:24 +02:00
3a570bd993 Change icon based on focused state 2020-04-20 09:48:04 +02:00
1dbfe29037 Fixed tab bar losing sync with header when navigating back in same stack 2020-04-20 09:42:34 +02:00
80ff70c1f7 Improved group favorite section 2020-04-20 09:33:12 +02:00
dc3aed8bda Improved flow typing 2020-04-20 09:29:21 +02:00
7f24eb77ac Create animated accordion component for reuse in the app 2020-04-19 21:44:58 +02:00
581ea516ae Improved flow typing of home screen and associated components 2020-04-19 20:21:39 +02:00
b64b68dc8a Added dialogs flow typing 2020-04-19 19:10:38 +02:00
75b7412eb2 Improved animated components flow typing 2020-04-19 19:03:25 +02:00
6dbce2cc3e Improved flow typing for the vote screen 2020-04-19 18:49:24 +02:00
b85dab627a Prevent flickering on start 2020-04-19 17:33:25 +02:00
8c7ceb84fc Improved flow typing and moved tab related options in component file 2020-04-19 16:59:40 +02:00
759c369c93 Fixed crash on iOS 2020-04-19 15:03:40 +02:00
9eb925d1a1 Removed flow comments 2020-04-18 23:56:10 +02:00
433306e2a7 Improved flow type checking 2020-04-18 23:55:20 +02:00
bdeae6933a Improved project structure 2020-04-18 20:00:51 +02:00
f8e53a8a72 Fixed padding issues 2020-04-18 17:20:07 +02:00
8e7b213b4f Updated animation to match fab 2020-04-18 16:58:07 +02:00
7f5ade5999 Improved tab hiding by following header animation 2020-04-18 16:55:08 +02:00
91853092be Added support for auto hide tab bar and changed auto hide component animations 2020-04-18 12:57:30 +02:00
e157af57d1 Improved status bar height fix 2020-04-18 10:57:00 +02:00
41eaaac350 Temporary fix for statusbar height and image modal jump 2020-04-18 01:03:48 +02:00
2a3f19e092 Fixed app.json errors 2020-04-17 21:24:38 +02:00
1dff662696 Change running animation 2020-04-17 21:21:10 +02:00
e658cc2fa2 Added start animation 2020-04-17 21:19:44 +02:00
d0ced5d1e6 Fixed missing key warning 2020-04-17 21:16:02 +02:00
8b4348a6a2 Ignored navigation warning 2020-04-17 21:14:39 +02:00
401cf58aa9 Reduced tab icons size 2020-04-17 21:11:30 +02:00
eab232c4dc Fixed image modal view jump by setting status bar to opaque 2020-04-17 21:07:56 +02:00
b27c36056c Improved tab font size 2020-04-17 16:44:34 +02:00
46dfbb1048 Tried to fix image modal animation 2020-04-17 16:42:26 +02:00
9d52fd94ef Improved tab icon animations 2020-04-17 15:55:53 +02:00
13e7a3b593 Play tab switching animations 2020-04-17 15:51:28 +02:00
172842294c Improved attention seeking animation 2020-04-17 12:02:04 +02:00
0385e8ad76 Created custom tab bar 2020-04-17 11:57:12 +02:00
26cf3cf2c3 Added more animations 2020-04-17 00:08:39 +02:00
96394972eb Added icon animations 2020-04-16 23:50:32 +02:00
b336c95f20 Fixed body padding not applying on some cases 2020-04-16 23:03:57 +02:00
ef23280493 Greatly increased performance 2020-04-16 22:34:17 +02:00
7998fa47ca Added animated accordions in group selection 2020-04-16 20:15:56 +02:00
46d293564f Added accordion animations 2020-04-16 19:57:11 +02:00
5a9f33669c Fixed feed item action button cropped on iOS 2020-04-16 19:28:19 +02:00
9c6ebad502 Show attention seeker when no group selected 2020-04-16 19:26:40 +02:00
cb1aa8bcf2 Fixed buttons not clickable on iOS 2020-04-16 19:03:37 +02:00
645115cb78 Removed log 2020-04-16 18:59:55 +02:00
31f7a2e539 Fixed auto hide components hiding on iOS refresh gesture 2020-04-16 18:59:35 +02:00
8b021356b8 Improved header safe bounce height 2020-04-16 18:54:57 +02:00
54861d729d Added new home tab icon 2020-04-16 16:04:22 +02:00
30e726b694 Improved bottom bar fab position 2020-04-16 14:54:10 +02:00
0cbd263801 Fixed velocity prop not available on iOS 2020-04-16 14:52:03 +02:00
44f7a99bea Fixed crash on iOS and inject javascript instead of sending messages 2020-04-16 14:45:03 +02:00
9346178c9d Removed logs 2020-04-16 11:56:11 +02:00
b2d7cf61cc Fixed search results not showing 2020-04-16 11:55:18 +02:00
9baaed9f6a Added support for favorite groups 2020-04-16 11:30:15 +02:00
2abed04a9d Updated libs 2020-04-16 10:47:48 +02:00
b6b87b6c06 Set header title to match currently selected group 2020-04-16 10:31:51 +02:00
28168aacf8 Go to next week on weekends 2020-04-16 10:18:38 +02:00
912a30edc6 Fixed navigation parameters 2020-04-16 10:08:42 +02:00
fe4d9ffecf Fix toolbar icon not updating 2020-04-16 00:09:43 +02:00
c52fa3a7d8 Fix crash on group selection 2020-04-16 00:05:58 +02:00
ac59121609 Show information message when no group is selected 2020-04-15 22:38:57 +02:00
ffb0b03b41 Improved group selection button 2020-04-15 22:18:14 +02:00
e693636464 Added planex group search and selection with native UI 2020-04-15 20:14:58 +02:00
c7527d8c6b Improved injected javascript + css and use native buttons to communicate with webview 2020-04-15 01:24:06 +02:00
d0847dc0fd Created a component to handle hide on scroll behavior 2020-04-14 20:14:39 +02:00
c684872a54 Added webview communication and display popup on planex event click 2020-04-14 18:56:50 +02:00
7d2bdc0d34 Fixed available rooms header not collapsing 2020-04-14 12:21:41 +02:00
3e583a6b39 Fixed crash on webview method calls 2020-04-14 11:56:12 +02:00
c67e2fa405 Implemented collapsible header on major lists and webviews 2020-04-13 18:11:53 +02:00
5d08134511 Fixed menu color 2020-04-13 00:10:35 +02:00
d22e7bb50d Fixed crash on self menu 2020-04-12 22:01:11 +02:00
f88c98537a Hide qr code fab button when scrolling down using spring animation 2020-04-12 21:53:47 +02:00
7128a68641 Change icon color is machines available 2020-04-12 20:51:38 +02:00
3d631cc816 Updated translation 2020-04-12 20:48:10 +02:00
fa42f09efb Fixed feed item size and display all data on click 2020-04-12 20:45:03 +02:00
3d57361908 Improved home screen items render cycle 2020-04-12 19:56:29 +02:00
00e7da4bd2 Improved proximo sort menu 2020-04-12 17:14:14 +02:00
47fd8b7474 Improved list update performance 2020-04-12 17:05:38 +02:00
08de6765a7 Handle android back button to go back in the webview 2020-04-12 12:57:23 +02:00
50334fb609 Open amicale links in the webview 2020-04-12 12:46:55 +02:00
a5dfa4f021 use back webview and linking instead of expo web browser 2020-04-12 12:36:29 +02:00
fe24fce882 Improved webview screen header buttons and removed unused props 2020-04-12 12:03:26 +02:00
f12029eae9 Revert "Collapse header when scrolling"
This reverts commit f70a289c
2020-04-12 00:34:41 +02:00
f70a289cdf Collapse header when scrolling 2020-04-11 22:35:57 +02:00
f3b7bafdca Use external library to render header buttons 2020-04-11 21:47:09 +02:00
24fb1e3f9b Improved html component to ignore text styles 2020-04-10 23:06:13 +02:00
db1d5166c6 Added amicale contact page 2020-04-10 17:10:10 +02:00
0f8e028159 Improved club about screen 2020-04-10 16:20:52 +02:00
f9f27dd7b7 Updated translations 2020-04-10 16:02:22 +02:00
369756207f Use lower case default screens to match actual route names 2020-04-10 14:35:33 +02:00
7216789cfc Fixed typo 2020-04-10 14:33:12 +02:00
5b994aab95 Fixed ios icon position 2020-04-10 14:25:50 +02:00
b46e671d83 Fixed android permissions 2020-04-10 10:53:00 +02:00
8563fea835 Display clubs the user is a manager of in first 2020-04-10 00:37:51 +02:00
ebbd4df591 Removed logs 2020-04-10 00:29:09 +02:00
9f74e64d70 Fixed login redirection 2020-04-10 00:23:22 +02:00
4f80cadfed Fixed event preview click and dark mode display 2020-04-10 00:09:25 +02:00
f282a1dd84 Further theme switching improvements 2020-04-09 23:59:45 +02:00
9bdfe3944e Fix for theme not updating 2020-04-09 23:30:42 +02:00
9f391fc335 Fixed tab bar color not updating with theme change 2020-04-09 22:55:53 +02:00
cbb0624189 Allow pull down to refresh 2020-04-09 17:48:39 +02:00
88478c15b5 Change icon if draw 2020-04-09 17:42:41 +02:00
d032b80158 Fixed vote api errors and handle draw 2020-04-09 17:39:09 +02:00
0ba48adb6e Improved error handling and added new api endpoints 2020-04-09 15:59:54 +02:00
3fe6be4238 Allow going back to last screen after login 2020-04-09 00:43:43 +02:00
205162605f Improved doc 2020-04-09 00:04:44 +02:00
2e4fa20895 Allow clicking on a club in profile screen to show its information 2020-04-08 20:55:56 +02:00
299a940ba4 Improved vote eror handling 2020-04-08 20:36:02 +02:00
71f39a64cc Improved app links and error handling on qr code opening 2020-04-08 20:11:39 +02:00
53daa6671a Improved scanner information display 2020-04-08 16:23:33 +02:00
96e9da162e Added qr code scanner screen 2020-04-08 15:47:40 +02:00
8e2d1c7a2b Do not create listeners on each focus 2020-04-08 12:32:08 +02:00
a54493a23f Allow links to open if home is already focused 2020-04-08 12:29:49 +02:00
6a6049220d Improved url handling 2020-04-08 12:10:06 +02:00
41b9194d98 Allow to open app with links to clubs and events 2020-04-08 00:47:38 +02:00
1e45f39045 Fixed typo 2020-04-07 20:11:11 +02:00
0ee0a6db3a Logout user if token expires 2020-04-07 20:11:04 +02:00
2ee3ed001c Correctly use arrow function instead of bind 2020-04-07 17:57:39 +02:00
f433edf902 Hide side bar items in accordions 2020-04-07 17:44:48 +02:00
46dbdb0740 Improved debug and dependencies performances 2020-04-07 16:40:34 +02:00
48fdca72c0 updated translations 2020-04-07 16:09:39 +02:00
9fc3620044 Moved vote cards in own component files 2020-04-07 15:24:52 +02:00
34594f82d9 Reload page when vote fails and move user to wait when submit vote 2020-04-07 14:38:55 +02:00
c70bafe273 Improved error handling 2020-04-07 14:17:53 +02:00
49dced05ab Show error dialog on error 2020-04-07 12:34:55 +02:00
ed2bf89d2f Created error dialog component for error handling 2020-04-07 00:52:17 +02:00
2da2b631ee Fixed scrollView warning 2020-04-07 00:31:07 +02:00
b2891ddeea Created a loading dialog component to handle async requests 2020-04-07 00:27:32 +02:00
0b85b1630c Polished vote display 2020-04-06 23:38:35 +02:00
98b1d267ec Added basic vote display 2020-04-06 19:49:32 +02:00
db96700693 Display card according to elections state 2020-04-06 19:22:28 +02:00
e1a57487a2 Implemented base vote screen and updated ConnectionManager.js to match new protocol 2020-04-06 18:32:10 +02:00
7b332e11fc Fixed buttons not having enough room on some devices 2020-04-06 15:18:15 +02:00
7295108832 Fixed crash on navigation reset 2020-04-06 14:39:29 +02:00
4c746a0b60 Improved script 2020-04-06 14:34:44 +02:00
dc3a49ee6c Moved all source files in src folder 2020-04-05 23:56:43 +02:00
28dd680bd1 Fixed missing import 2020-04-05 23:53:14 +02:00
daae4984ad Updated libs to latest compatible version 2020-04-05 23:51:15 +02:00
8026f8b223 Improved login screen 2020-04-05 21:29:33 +02:00
04793d057e Further FlatList performance improvements 2020-04-05 21:06:00 +02:00
8a1b90a860 Merge remote-tracking branch 'origin/dev' into dev 2020-04-05 20:32:25 +02:00
f1b5a767ba Listen for route change to update sidebar 2020-04-05 20:32:11 +02:00
fd3f6393fe Improved performance and used paper drawer items instead of navigation drawer items 2020-04-05 19:44:34 +02:00
8e996b0d16 Typo in fr translation 2020-04-05 13:18:46 +02:00
7554fb2854 Greatly improved FlatList performance 2020-04-05 11:51:03 +02:00
106227fbbb Improved search and fixed navigation warning on club about screen 2020-04-05 10:29:50 +02:00
8723765e43 Improved overall performance by remove FlatList extraData and adding keys 2020-04-04 21:36:58 +02:00
ab554cae94 Removed useless PureFlatList.js as FlatList is already a pure component 2020-04-04 20:19:18 +02:00
ba893495e1 Improved proximo search and display performance 2020-04-04 20:17:55 +02:00
7829b893c5 Added button translation 2020-04-04 19:46:53 +02:00
557dd000ae Fixed home header button + fixed snackbar button not working 2020-04-04 19:42:04 +02:00
2d26f2c395 Added settings button in ActionsDashboardItem 2020-04-04 16:31:24 +02:00
cacfb2862c Updated unit tests 2020-04-04 16:24:26 +02:00
17016b6452 Recover credentials on startup for increased performance and added login/profile button on home 2020-04-04 16:09:04 +02:00
1ede8f4e9a Show more services button on home 2020-04-04 13:52:16 +02:00
20336c699e Added about screen 2020-04-04 12:47:26 +02:00
e0378d4bc5 Improve club list header 2020-04-04 12:30:08 +02:00
c48887a0d8 Improved search performance 2020-04-04 11:55:51 +02:00
8f1fc3f1bd Added search feature 2020-04-03 23:58:44 +02:00
c148529b94 Display club managers status 2020-04-03 14:42:43 +02:00
784872ed96 Use flatlist empty list render to display errors and loading 2020-04-03 14:28:33 +02:00
94d2db97ad Added useful links 2020-04-03 13:52:19 +02:00
dc4feebbbd Fixed links containing special characters not working 2020-04-03 13:45:55 +02:00
2a19d5a67a Updated links 2020-04-03 13:44:20 +02:00
9b31a8c249 Edited link 2020-04-03 13:41:36 +02:00
fe5b29a5cd Added install instructions and moved in separated file 2020-04-03 13:40:20 +02:00
0db000f602 Updated package to use flow as dev dependency 2020-04-03 13:05:39 +02:00
64c69fed47 removed unused lib 2020-04-03 11:33:51 +02:00
a27fdfd8dc Updated translations 2020-04-02 20:01:56 +02:00
44ff396ae3 Added club categories on display screen 2020-04-02 19:55:50 +02:00
8380fb9a3d Used other image modal lib as the previous one broke back button on android 2020-04-02 19:38:39 +02:00
a42d743aeb Added club list 2020-04-02 19:19:30 +02:00
754c43a81a Added fullscreen image modal 2020-04-02 15:33:12 +02:00
cb98e1c546 Display custom error view on webview error 2020-04-02 13:27:25 +02:00
5e35086a9c Moved loading screen in own component 2020-04-02 10:45:42 +02:00
3f576c2287 Organized custom components 2020-04-02 10:07:20 +02:00
2010170e8b Updated translations 2020-04-02 09:58:25 +02:00
4bc6ae07b5 Allow reload when error 2020-04-02 09:52:43 +02:00
4ce6865b6a Improved profile display and added new translations 2020-04-01 14:48:11 +02:00
a1f20fbf4e Disable login button when loading to prevent multiple login requests 2020-04-01 14:27:59 +02:00
ee13d099fe Improved translations and improved alert popup 2020-04-01 14:25:25 +02:00
f10242b187 Improved logout popup and fixed warnings 2020-04-01 13:01:28 +02:00
cff18d8256 Remove log function 2020-03-31 21:24:03 +02:00
5a788f4b6d Added profile translations 2020-03-31 21:22:35 +02:00
5e40e271b7 Added club information 2020-03-31 21:10:13 +02:00
d7d6146245 Added translations for login screen 2020-03-31 20:40:52 +02:00
1c473a1712 Prevent login when user has not given his consent on data 2020-03-31 19:56:14 +02:00
b118c98e93 Improved profile display 2020-03-31 19:36:02 +02:00
6b2aca3131 Improved error display 2020-03-31 19:00:47 +02:00
4406efaf41 Improved authenticated screens states 2020-03-31 18:40:06 +02:00
c5e79f45c3 Implemented basic login state 2020-03-31 14:21:01 +02:00
2b0945fe5b Improved error handling 2020-03-31 11:05:00 +02:00
4259dd779d Added authenticated post request support and added more tests 2020-03-31 10:57:53 +02:00
5aa3afd383 Improved connection manager and added new tests 2020-03-30 23:44:06 +02:00
0b19915a62 Implemented mail validation and improved responsiveness 2020-03-30 20:42:27 +02:00
6b336cfd03 Improved login screen 2020-03-30 19:50:16 +02:00
e3b3657e6e Improved web browser handling 2020-03-30 17:39:59 +02:00
5bf1e7586b Moved files to follow new project structure 2020-03-30 15:49:54 +02:00
4b370d5810 Merge branch 'login' into dev 2020-03-30 15:46:48 +02:00
14856616df Use promise instead of await 2020-03-30 15:43:22 +02:00
aff897c8ce Fixed agenda generation 2020-03-30 15:43:08 +02:00
7e90b80ca2 Improved project structure 2020-03-30 15:28:08 +02:00
fac9d8208e Improved doc 2020-03-29 15:59:25 +02:00
03549957a8 Improved documentation and fixed debug mode 2020-03-29 15:08:51 +02:00
4cdfc607e6 Improved documentation 2020-03-29 14:46:44 +02:00
fbabb4d7af First draft of connection 2020-03-29 11:47:27 +02:00
a533f48a12 Updated rotate icon to better match action 2020-03-28 12:26:24 +01:00
fb1d2cf045 Updated translations 2020-03-28 12:21:33 +01:00
cded72137e Updated doc and used private class members 2020-03-28 12:08:08 +01:00
931d7b0fe6 Added grid tests 2020-03-24 14:23:19 +01:00
3d45bc62b8 Added more tests and improved performance by not making deep copies of the grid 2020-03-24 10:43:05 +01:00
e6fcbdb165 Added score tests 2020-03-23 19:31:02 +01:00
8dc620b987 Moved grid and score logic in separate files 2020-03-23 18:10:45 +01:00
fcec2a3c8a Added tests for Piece class 2020-03-23 17:30:24 +01:00
c75a7dc8fc Improved game organization 2020-03-23 11:32:50 +01:00
965ddd3cb2 Removed remaining flow errors 2020-03-22 17:02:00 +01:00
38a52a9e95 Added coverage report 2020-03-22 16:09:39 +01:00
667ceb0e71 Added remaining tests 2020-03-22 16:05:28 +01:00
bf0c81166c Improved JSdoc 2020-03-22 12:15:16 +01:00
c6fb369863 removed seconds for new api implementation 2020-03-22 11:58:24 +01:00
a6771f442a Improved flow type checking 2020-03-22 11:21:55 +01:00
160dbb00c8 Reorganized code 2020-03-22 10:37:59 +01:00
81eddd9bdd Removed unused functions 2020-03-22 10:22:57 +01:00
c37f6d07a4 Updated api link 2020-03-22 10:00:35 +01:00
53ef08219c Removed multiple day management (will be handled by server) 2020-03-21 21:10:57 +01:00
3824683385 Removed unused function 2020-03-21 21:07:39 +01:00
40d7985bbd Allow events to span on multiple days 2020-03-21 20:32:28 +01:00
7a3d5f16b1 Moved functions to manager and wrote tests 2020-03-21 18:59:42 +01:00
3a301bcbef Added more tests and removed useless functions 2020-03-21 18:46:12 +01:00
0b84da8b93 Added more tests 2020-03-21 17:23:59 +01:00
df79d78165 Improved test and replace method 2020-03-21 11:24:30 +01:00
a4c38168ad Added first real test 2020-03-20 22:50:28 +01:00
96c9b57d92 Improved .gitignore 2020-03-20 22:34:55 +01:00
5221b73bf2 Added default run and test configs 2020-03-20 22:32:48 +01:00
b0094716be Added basic jest tests 2020-03-20 22:31:27 +01:00
3bc45704f6 Improved ui on larger screens 2020-03-20 21:15:37 +01:00
7da30e0af6 Added previews 2020-03-17 14:22:49 +01:00
7a00452cc0 Improved level cap 2020-03-17 11:12:55 +01:00
879ae46abe Improved score management 2020-03-17 11:00:45 +01:00
dbe03a2a2d Fixed level 6 missing 2020-03-17 00:25:44 +01:00
7d718141e7 Added touch and hold controls 2020-03-17 00:24:57 +01:00
79e72784d1 Improved piece rotation 2020-03-16 23:36:01 +01:00
b29973189f Use pretty date formatting 2020-03-16 20:23:29 +01:00
07d8fb8d15 Added levels 2020-03-16 20:10:54 +01:00
e5bde81964 Improved light mode colors and game over message 2020-03-16 19:48:03 +01:00
7980b8b422 Made clock use seconds not game ticks 2020-03-16 19:40:52 +01:00
3affbfcb40 Improved buttons position 2020-03-16 19:29:57 +01:00
c9237cc824 Improved score updates 2020-03-16 19:26:42 +01:00
7f33c8376d Improved game UI and state management 2020-03-16 19:10:32 +01:00
8fc5cfb25e Remove full lines 2020-03-16 14:58:13 +01:00
3fe1d85eec Fixed start position 2020-03-16 08:22:18 +01:00
a32294e394 Improved colors 2020-03-15 20:34:20 +01:00
7b45841c30 Use pure component for cells 2020-03-15 20:18:48 +01:00
bb54186d9e Added rotation feature 2020-03-15 19:28:41 +01:00
3aaf56a660 Added basic tetris functionality 2020-03-15 18:44:32 +01:00
42731d26a1 Refactored some lines 2020-03-14 15:58:57 +01:00
231 changed files with 16176 additions and 4409 deletions

73
.gitignore vendored
View file

@ -8,3 +8,76 @@ npm-debug.*
*.orig.*
web-build/
web-report/
/.expo-shared/
/package-lock.json
!/.idea/
/.idea/*
!/.idea/runConfigurations
# The following contents were automatically generated by expo-cli during eject
# ----------------------------------------------------------------------------
# OSX
#
.DS_Store
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
# node.js
#
node_modules/
npm-debug.log
yarn-error.log
# BUCK
buck-out/
\.buckd/
*.keystore
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
# Bundle artifacts
*.jsbundle
# CocoaPods
/ios/Pods/
# Expo
.expo/*
/android/gradle.properties

View file

@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>

View file

@ -0,0 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Expo" type="ReactNative" factoryName="React Native">
<node-interpreter value="project" />
<react-native value="$USER_HOME$/.nvm/versions/node/v12.4.0/lib/node_modules/react-native-cli" />
<platform value="ANDROID" />
<envs />
<only-packager />
<build-and-launch value="false" />
<browser value="98ca6316-2f89-46d9-a9e5-fa9e2b0625b3" />
<debug-host value="127.0.0.1" />
<debug-port value="19001" />
<method v="2">
<option name="ReactNativePackager" enabled="true" />
</method>
</configuration>
</component>

183
App.js
View file

@ -1,19 +1,31 @@
// @flow
import * as React from 'react';
import {Platform, StatusBar} from 'react-native';
import LocaleManager from './utils/LocaleManager';
import AsyncStorageManager from "./utils/AsyncStorageManager";
import CustomIntroSlider from "./components/CustomIntroSlider";
import {SplashScreen} from 'expo';
import ThemeManager from './utils/ThemeManager';
import {Platform, StatusBar, View, YellowBox} from 'react-native';
import LocaleManager from './src/managers/LocaleManager';
import AsyncStorageManager from "./src/managers/AsyncStorageManager";
import CustomIntroSlider from "./src/components/Overrides/CustomIntroSlider";
import type {CustomTheme} from "./src/managers/ThemeManager";
import ThemeManager from './src/managers/ThemeManager';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import DrawerNavigator from './navigation/DrawerNavigator';
import NotificationsManager from "./utils/NotificationsManager";
import MainNavigator from './src/navigation/MainNavigator';
import {Provider as PaperProvider} from 'react-native-paper';
import AprilFoolsManager from "./utils/AprilFoolsManager";
import Update from "./constants/Update";
import AprilFoolsManager from "./src/managers/AprilFoolsManager";
import Update from "./src/constants/Update";
import ConnectionManager from "./src/managers/ConnectionManager";
import URLHandler from "./src/utils/URLHandler";
import {setSafeBounceHeight} from "react-navigation-collapsible";
import SplashScreen from 'react-native-splash-screen'
import {OverflowMenuProvider} from "react-navigation-header-buttons";
// Native optimizations https://reactnavigation.org/docs/react-native-screens
// Crashes app when navigating away from webview on android 9+
// enableScreens(true);
YellowBox.ignoreWarnings([ // collapsible headers cause this warning, just ignore as it is not an issue
'Non-serializable values were found in the navigation state',
]);
type Props = {};
@ -22,11 +34,9 @@ type State = {
showIntro: boolean,
showUpdate: boolean,
showAprilFools: boolean,
currentTheme: ?Object,
currentTheme: CustomTheme | null,
};
const Stack = createStackNavigator();
export default class App extends React.Component<Props, State> {
state = {
@ -37,75 +47,131 @@ export default class App extends React.Component<Props, State> {
currentTheme: null,
};
onIntroDone: Function;
onUpdateTheme: Function;
navigatorRef: { current: null | NavigationContainer };
defaultHomeRoute: string | null;
defaultHomeData: { [key: string]: any }
createDrawerNavigator: () => React.Node;
urlHandler: URLHandler;
storageManager: AsyncStorageManager;
constructor() {
super();
LocaleManager.initTranslations();
this.onIntroDone = this.onIntroDone.bind(this);
this.onUpdateTheme = this.onUpdateTheme.bind(this);
SplashScreen.preventAutoHide();
this.navigatorRef = React.createRef();
this.defaultHomeRoute = null;
this.defaultHomeData = {};
this.storageManager = AsyncStorageManager.getInstance();
this.urlHandler = new URLHandler(this.onInitialURLParsed, this.onDetectURL);
this.urlHandler.listen();
setSafeBounceHeight(Platform.OS === 'ios' ? 100 : 20);
this.loadAssetsAsync().then(() => {
this.onLoadFinished();
});
}
/**
* Updates the theme
* THe app has been started by an url, and it has been parsed.
* Set a new default start route based on the data parsed.
*
* @param parsedData The data parsed from the url
*/
onUpdateTheme() {
onInitialURLParsed = (parsedData: { route: string, data: { [key: string]: any } }) => {
this.defaultHomeRoute = parsedData.route;
this.defaultHomeData = parsedData.data;
};
/**
* An url has been opened and parsed while the app was active.
* Redirect the user to the screen according to parsed data.
*
* @param parsedData The data parsed from the url
*/
onDetectURL = (parsedData: { route: string, data: { [key: string]: any } }) => {
// Navigate to nested navigator and pass data to the index screen
if (this.navigatorRef.current != null) {
this.navigatorRef.current.navigate('home', {
screen: 'index',
params: {nextScreen: parsedData.route, data: parsedData.data}
});
}
};
/**
* Updates the current theme
*/
onUpdateTheme = () => {
this.setState({
currentTheme: ThemeManager.getCurrentTheme()
});
this.setupStatusBar();
}
};
/**
* Updates status bar content color if on iOS only,
* as the android status bar is always set to black.
*/
setupStatusBar() {
if (Platform.OS === 'ios') {
if (ThemeManager.getNightMode()) {
StatusBar.setBarStyle('light-content', true);
} else {
StatusBar.setBarStyle('dark-content', true);
}
if (ThemeManager.getNightMode()) {
StatusBar.setBarStyle('light-content', true);
} else {
StatusBar.setBarStyle('dark-content', true);
}
if (Platform.OS === "android")
StatusBar.setBackgroundColor(ThemeManager.getCurrentTheme().colors.surface, true);
}
/**
* Callback when user ends the intro. Save in preferences to avaoid showing back the introSlides
* Callback when user ends the intro. Save in preferences to avoid showing back the introSlides
*/
onIntroDone() {
onIntroDone = () => {
this.setState({
showIntro: false,
showUpdate: false,
showAprilFools: false,
});
AsyncStorageManager.getInstance().savePref(AsyncStorageManager.getInstance().preferences.showIntro.key, '0');
AsyncStorageManager.getInstance().savePref(AsyncStorageManager.getInstance().preferences.updateNumber.key, Update.number.toString());
AsyncStorageManager.getInstance().savePref(AsyncStorageManager.getInstance().preferences.showAprilFoolsStart.key, '0');
}
async componentDidMount() {
await this.loadAssetsAsync();
}
async loadAssetsAsync() {
// Wait for custom fonts to be loaded before showing the app
await AsyncStorageManager.getInstance().loadPreferences();
ThemeManager.getInstance().setUpdateThemeCallback(this.onUpdateTheme);
await NotificationsManager.initExpoToken();
this.onLoadFinished();
this.storageManager.savePref(this.storageManager.preferences.showIntro.key, '0');
this.storageManager.savePref(this.storageManager.preferences.updateNumber.key, Update.number.toString());
this.storageManager.savePref(this.storageManager.preferences.showAprilFoolsStart.key, '0');
};
/**
* Loads every async data
*
* @returns {Promise<void>}
*/
loadAssetsAsync = async () => {
await this.storageManager.loadPreferences();
try {
await ConnectionManager.getInstance().recoverLogin();
} catch (e) {
}
}
/**
* Async loading is done, finish processing startup data
*/
onLoadFinished() {
// console.log("finished");
// Only show intro if this is the first time starting the app
this.createDrawerNavigator = () => <MainNavigator
defaultHomeRoute={this.defaultHomeRoute}
defaultHomeData={this.defaultHomeData}
/>;
ThemeManager.getInstance().setUpdateThemeCallback(this.onUpdateTheme);
// Status bar goes dark if set too fast on ios
if (Platform.OS === 'ios')
setTimeout(this.setupStatusBar, 1000);
else
this.setupStatusBar();
this.setState({
isLoading: false,
currentTheme: ThemeManager.getCurrentTheme(),
showIntro: AsyncStorageManager.getInstance().preferences.showIntro.current === '1',
showUpdate: AsyncStorageManager.getInstance().preferences.updateNumber.current !== Update.number.toString(),
showAprilFools: AprilFoolsManager.getInstance().isAprilFoolsEnabled() && AsyncStorageManager.getInstance().preferences.showAprilFoolsStart.current === '1',
showIntro: this.storageManager.preferences.showIntro.current === '1',
showUpdate: this.storageManager.preferences.updateNumber.current !== Update.number.toString(),
showAprilFools: AprilFoolsManager.getInstance().isAprilFoolsEnabled() && this.storageManager.preferences.showAprilFoolsStart.current === '1',
});
// Status bar goes dark if set too fast
setTimeout(this.setupStatusBar, 1000);
SplashScreen.hide();
}
@ -124,11 +190,16 @@ export default class App extends React.Component<Props, State> {
} else {
return (
<PaperProvider theme={this.state.currentTheme}>
<NavigationContainer theme={this.state.currentTheme}>
<Stack.Navigator headerMode="none">
<Stack.Screen name="Root" component={DrawerNavigator}/>
</Stack.Navigator>
</NavigationContainer>
<OverflowMenuProvider>
<View style={{backgroundColor: ThemeManager.getCurrentTheme().colors.background, flex: 1}}>
<NavigationContainer theme={this.state.currentTheme} ref={this.navigatorRef}>
<MainNavigator
defaultHomeRoute={this.defaultHomeRoute}
defaultHomeData={this.defaultHomeData}
/>
</NavigationContainer>
</View>
</OverflowMenuProvider>
</PaperProvider>
);
}

View file

@ -2,6 +2,32 @@
Pensez à garder l'appli à jour pour profiter des dernières fonctionnalités !
- **v3.0.0** - _TBA_
- Nouvelle barre de navigation !
- Suppression du menu déroulant gauche
- Création d'une nouvelle catégorie dans la barre de navigation pour regrouper tous les services
- Ajout d'animations un peu partout parce que c'est joli et j'ai compris comment faire :D
- Ajout de la connexion au compte Amicale
- Ajout de la liste des clubs, des élections et du profil utilisateur à travers son compte Amicale
- Amélioration importante de la vitesse de démarrage et des performances sur Android
- Réduction importante de la taille de l'application à télécharger et une fois installée
- _Notes de développement :_
- Migration de Expo Managed Workflow à React Native Bare Workflow
- **v2.0.0** - _12/03/2020_
- Nouvelle interface !
- Amélioration des performances
- Amélioration de la vitesse de démarrage
- _Notes de développement :_
- Utilisation de react-native-paper à la place de native base
- **v1.5.2** - _25/02/2020_
- Correction d'un problème d'affichage des détail du Proximo
- **v1.5.1** - _24/02/2020_
- Amélioration des performances
- Utilisation d'un tri des catégories du Proximo plus cohérent
- **v1.5.0** - _05/02/2020_
- Amélioration des performances de l'application
- Amélioration du menu gauche

123
INSTALL.md Normal file
View file

@ -0,0 +1,123 @@
# Installer l'application depuis ce dépot
**Vous allez devoir installer git, node et npm sur votre machine, puis cloner ce dépôt.**
Tout est expliqué dans ce guide, si vous avez un problème ou une question, merci de me contacter par mail : app@amicale-insat.fr
## Table des matières
* [Installation de Git](#installation-de-git)
* [Installation de node](#installation-de-node)
* [Installation de React Native](#installation-de-react-native)
* [Configuration de NPM](#configuration-de-npm)
* [Installation](#installation)
* [Téléchargement du dépot](#téléchargement-du-dépot)
* [Téléchargement des dépendances](#téléchargement-des-dépendances)
* [Lancement de l'appli](#lancement-de-lappli)
* [Tester sur un appareil](#tester-sur-un-appareil)
## Installation de Git
Entrez la commande suivante pour l'installer :
```shell script
sudo apt install git
```
## Installation de node
Vous devez avoir une version de node > 12.0.
Pour cela, vérifiez avec la commande :
```shell script
nodejs -v
```
Si ce n'est pas le cas, entrez les commandes suivantes pour installer la version 12 ([plus d'informations sur ce lien](https://github.com/nodesource/distributions/blob/master/README.md#debinstall)):
```shell script
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
```
## Installation de React Native
Merci de suivre les [instructions d'installation](https://reactnative.dev/docs/environment-setup) sur le site officiel.
## Téléchargement du dépôt
Clonez ce dépôt à l'aide de la commande suivante :
````shell script
git clone https://git.etud.insa-toulouse.fr/vergnet/application-amicale.git
````
## Téléchargement des dépendances
Une fois le dépôt sur votre machine, ouvrez le terminal dans le dossier du dépôt cloné et tapez :
````shell script
npm install
````
Ceci installera toutes les dépendances listées dans le fichier _package.json_. Cette opération peut prendre quelques minutes et utilisera beaucoup d'espace disque (plus de 300Mo).
### Instructions pour iOS
Pour iOS, en plus de la commande précédente, il faut aussi installer les dépendances iOS. Pour cela, allez dans le dossier `ios` et installez les pods :
```shell script
cd ios && pod install
```
## Lancement de l'appli
Il est conseillé d'utiliser un logiciel comme **WebStorm** (logiciel pro gratuit pour les étudiants) pour éditer l'application car ce logiciel est compatible avec les technologies utilisées.
Vous aurez besoin de 2 consoles :
* Une pour lancer le *Bundler*, qui permet de mettre à jour l'application en temps réel (vous pouvez le laisser tout le temps ouvert).
* Une autre pour installer l'application sur votre appareil/simulateur.
Pour lancer le *Bundler*, assurez vous d'être dans le dossier de l'application, et lancez cette commande :
````shell script
npx react-native start
````
### Android
Dans la deuxième console, lancez la commande suivante :
````shell script
npx react-native run-android
````
### iOS
Dans la deuxième console, lancez la commande suivante (valable que sur Mac) :
````shell script
npx react-native run-ios
````
**Ne stoppez pas le Metro Bundler dans la console à chaque changement !** Toutes les modifications sont appliquées automatiquement, pas besoin de stopper et de redémarrer pour des petits changements ! Il est seulement nécessaire de redémarrer le Metro Bundler quand vous changez des librairies ou des fichiers.
## Tester sur un appareil
Assurez vous d'avoir installé et lancé le projet comme expliqué plus haut.
### Android
#### Émulateur
[Suivez la procédure sur ce lien pour installer un émulateur](https://docs.expo.io/versions/latest/workflow/android-studio-emulator/).
Une fois l'emulateur installé et démarré, lancez l'application comme expliqué plus haut.
#### Appareil Physique
Branchez votre appareil, allez dans les options développeurs et activer le *USB Debugging*. Une fois qu'il est activé et branché, lancez l'appli comme expliqué plus haut.
### iOS
#### Émulateur
Installez le logiciel Xcode et téléchargez l'émulateur de votre choix. Ensuite, lancez la commande suivante pour lancer l'application sur votre émulateur.
````shell script
npx react-native run-ios --simulator="NOM DU SIMULATEUR"
````
En remplaçant `NOM DU SIMULATEUR` par le simulateur que vous voulez.
#### Appareil Physique
Aucune idée je suis pauvre je n'ai pas de Mac.
[reference]: ##Installation de Git

View file

@ -10,85 +10,29 @@ Créée pendant l'été 2019, cette application compatible Android et iOS permet
- Disponibilité des salles libre accès
- Réservation des Bib'Box
Ce dépot contient la source de cette application, modifiable par les étudiants de l'INSA Toulouse, sous licence GPLv3.
Ce dépot contient la source de cette application, sous licence GPLv3.
## Contribuer
Vous voulez influencer le développement ? C'est très simple !
Pas besoin de connaissance, il est possible d'aider simplement en proposant des améliorations ou en rapportant des bugs par mail (vergnet@etud.insa-toulouse.fr) ou sur [cette page](https://git.etud.insa-toulouse.fr/vergnet/application-amicale/issues), en vous connectant avec vos login INSA.
Pas besoin de connaissance, il est possible d'aider simplement en proposant des améliorations ou en rapportant des bugs par mail ([app@amicale-insat.fr](mailto:app@amicale-insat.fr)) ou sur [cette page](https://git.etud.insa-toulouse.fr/vergnet/application-amicale/issues), en vous connectant avec vos login INSA.
Si vous avez assez de connaissances et vous souhaitez proposer des modification dans le code, installez l'application sur votre machine, réalisez votre modification et créez une 'pull request'.
Si vous avez assez de connaissances et vous souhaitez proposer des modifications dans le code, [installez l'application](INSTALL.md) sur votre machine, réalisez votre modification et créez une 'pull request'. Si vous avez des problèmes ou des questions, n'hésitez pas à me contacter par mail ([app@amicale-insat.fr](mailto:app@amicale-insat.fr)).
## Technologies Utilisées
Cette application est faite en JavaScript avec React Native (framework Open Source créé par Facebook), combinée avec Expo.
Cette application est faite en JavaScript avec React Native (framework Open Source créé par Facebook).
Cette combinaison permet de n'avoir qu'un seul code JavaScript à écrire pour Android et iOS. Pour compiler pour la plateforme souhaitée, il suffit d'effectuer une commande, qui envoie le code sur les serveurs d'Expo pour compilation (voir section Installer). Plus besoin de Mac pour développer une application iOS ! (Mais toujours besoin d'un pour publier sur l'App store...)
React Native permet de n'avoir qu'un seul code JavaScript à écrire pour Android et iOS. Pour compiler pour la plateforme souhaitée, il suffit d'effectuer une simple commande. Plus besoin de Mac pour développer une application iOS ! (Mais toujours besoin d'un pour compiler et publier sur l'App store...)
Cette application utilisait initialement Expo, permettant de simplifier grandement le développement et le déploiement, mais il a été abandonné à cause de ses limitations et de son impact sur les performances. Revenir sur Expo n'est pas possible sans un gros travail et une suppression de fonctionnalités non compatibles.
## Installer l'application depuis ce dépot
## [Installer l'application depuis ce dépot](INSTALL.md)
**Avant de commencer, installez git, node et npm sur votre machine, puis clonez ce dépot.**
### Téléchargement du dépot et des dépendances
Il est conseillé d'utiliser un logiciel comme **PHPStorm** (logiciel pro gratuit pour les étudiants) pour éditer l'application car ce logiciel est compatible avec les technologies utilisées.
Une fois le dépot sur votre machine, ouvrez le projet dans PHPStorm, ouvrez le terminal et tapez `npm install`. Ceci installera toutes les dépendances listées dans le fichier _package.json_. Cette opération peut prendre quelques minutes et utilisera beaucoup d'espace disque (plus de 300Mo).
### Lancement de l'appli
#### En console
Ouvrez simplement une console dans le répertoire du projet et tapez :
`expo start`
Cette commande va démarrer le Metro Bundler permettant de lancer l'appli. Attendez quelques instants, quand un QR code apparait, l'application est prête à être lancée sur votre téléphone.
**Ne stoppez pas le Metro Bundler dans la console a chaque changement !** Toutes les modifications sont appliquées automatiquement, pas besoin de stopper et de redémarrer pour des petits changements ! Il est seulement nécessaire de redémarrer le Metro Bundler quand vous changez des librairies ou des fichiers.
#### Directement avec PHPStorm
Si vous n'aimez pas la console et voulez utiliser le merveilleux bouton play de PHPStorm, il faut le paramétrer. Nous utilisons ici expo, il faut donc dire à PHPStorm de lancer une commande expo quand nous cliquons sur le bouton play.
Pour cela, cliquez sur **Edit Configurations** en haut à droite, dans la nouvelle fenêtre, cliquez sur **+**, et choisissez **React Native**.
Donnez un petit nom à cette configuration, décochez **Build and launch application** (nous utilisons expo pour ça, pas react native), mettez `127.0.0.1` dans le champ **Bundler Host**, et `19001` dans **Bundler Port**.
Ensuite, dans **Before Launch**; cliquez sur **+** pour ajouter une nouvelle configuration, et choisissez **Start React Native Bundler** si il n'est pas déjà présent. Une fois ajouté, cliquez dessus, puis sur le bouton éditer (une icone de crayon). Dans la nouvelle fenetre, choisissez **npm script** dans le champ **Command** et **start** dans **Script**. Vérifiez que vous utilisez bien l'interpreteur Node associé au projet (pour utiliser les bonnes dépendances installées précédement), et cliquez sur OK.
[Plus d'informations ici](https://www.jetbrains.com/help/phpstorm/react-native.html)
Le projet est maintenant pret, quand vous cliquez sur run (ou shift+F10), le projet sera lancé (cela peut prendre plusieurs minutes).
Quand un QR code apparait, vous pouvez tester sur un appareil.
**Ne stoppez pas le Metro Bundler dans la console a chaque changement !** Toutes les modifications sont appliquées automatiquement, pas besoin de stopper et de redémarrer pour des petits changements ! Il est seulement nécessaire de redémarrer le Metro Bundler quand vous changez des librairies ou des fichiers.
### Tester sur un appareil
Assurez vous d'avoir installé et lancé le projet comme expliqué plus haut.
#### Émulateur android
[Suivez la procédure sur ce lien pour installer un émulateur](https://docs.expo.io/versions/latest/workflow/android-studio-emulator/).
Une fois l'emulateur installé et démarré, lancez le projet, puis appuyez sur la touche **a** dans la console, cela lancera l'aplication dans l'émulateur.
#### Appareil Physique
Installez l'application **Expo** sur votre appareil (android ou iOS), assurez vous d'avoir démarré le projet et d'avoir votre machine de développement et le téléphone sur le même réseau wifi (non publique). Ouvrez l'application expo, Votre projet devrait apparaitre dans la liste. Cliquez dessus et c'est bon !
Si vous utilisez le réseau Wifirst des résidences INSA (ou tout autre wifi publique), il y a une méthode très simple pour créer un réseau privé entre votre PC et votre téléphone (en tout cas avec un téléphone android). Connectez votre téléphone en Wifi au réseau, puis connectez le en USB à votre PC. Une fois connecté, allez dans les paramètres et activez le "USB Tethering". Votre PC est maintenant connecté en réseau filaire à votre téléphone, qui lui est connecté à Internet par la wifi. Si vous voulez connecter d'autres appareils, il suffit de créer un Hotspot sur votre PC et de connecter vos autres appareils à ce Hotspot. Profitez de votre réseau privé dans votre Promolo !
## Compilation
Avant de compiler, créez vous un compte Expo. Ensuite, lancez le Metro Bundler et connectez vous a votre compte dans la console (les touches sont indiquées).
Pour compiler sur android, vous avez deux solutions:
- Vous voulez générer un `.apk` pour pour l'installer sur votre téléphone, lancez cette commande dans un terminal dans le projet : `expo build:android`. Cette commande va générer les paquets nécessaires à Expo et les envoyer sur leurs serveurs. Ne touchez à rien pendant la création des paquets (cela peut prendre une à deux minutes). Une fois que vous voyez écrit `Build in progress...`, vous pouvez fermer votre console : les serveurs ont pris la main et vous avez un lien pour analyser la progression. Ce processus dure en général 8 minutes. Si vous ne fermez pas la console, vous aurez un lien direct pour télécharger le fichier `.apk`, sinon connectez vous sur votre compte Expo, rubrique Builds pour le télécharger.
- Vous voulez compiler pour ensuite publier sur le Play Store, lancez cette commande dans un terminal dans le projet : `expo build:android -t app-bundle`. Cette commande fait exactement la même chose que la précédente à une chose près. Vous obtiendre un fichier `.aab`, qui est un format optimisé pour le Play Store. Ce fichier est plus volumineux mais permet au Play Store de générer les apk les plus optimisés possible pour différentes architectures de téléphone.
Pou compiler sur iOS, vous aurez besoin du compte développeur de l'amicale car un tel compte est payant.
## Liens utiles
* [Documentation React Native](https://reactnative.dev/docs/getting-started)
* [Documentation Expo](https://docs.expo.io/versions/latest/)
* [Documentation React Native Paper](https://callstack.github.io/react-native-paper/)
* [Documentation React navigation](https://reactnavigation.org/docs/getting-started)
* [Documentation Jest](https://jestjs.io/docs/en/getting-started)
* [Documentation Flow](https://flow.org/en/docs/react/)

View file

@ -0,0 +1,7 @@
const keychainMock = {
SECURITY_LEVEL_ANY: "MOCK_SECURITY_LEVEL_ANY",
SECURITY_LEVEL_SECURE_SOFTWARE: "MOCK_SECURITY_LEVEL_SECURE_SOFTWARE",
SECURITY_LEVEL_SECURE_HARDWARE: "MOCK_SECURITY_LEVEL_SECURE_HARDWARE",
}
export default keychainMock;

View file

@ -0,0 +1,210 @@
jest.mock('react-native-keychain');
import React from 'react';
import ConnectionManager from "../../src/managers/ConnectionManager";
import {ERROR_TYPE} from "../../src/utils/WebData";
let fetch = require('isomorphic-fetch'); // fetch is not implemented in nodeJS but in react-native
const c = ConnectionManager.getInstance();
afterEach(() => {
jest.restoreAllMocks();
});
test('isLoggedIn yes', () => {
jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
return 'token';
});
return expect(c.isLoggedIn()).toBe(true);
});
test('isLoggedIn no', () => {
jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
return null;
});
return expect(c.isLoggedIn()).toBe(false);
});
test("isConnectionResponseValid", () => {
let json = {
error: 0,
data: {token: 'token'}
};
expect(c.isConnectionResponseValid(json)).toBeTrue();
json = {
error: 2,
data: {}
};
expect(c.isConnectionResponseValid(json)).toBeTrue();
json = {
error: 0,
data: {token: ''}
};
expect(c.isConnectionResponseValid(json)).toBeFalse();
json = {
error: 'prout',
data: {token: ''}
};
expect(c.isConnectionResponseValid(json)).toBeFalse();
});
test("connect bad credentials", () => {
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
return Promise.resolve({
json: () => {
return {
error: ERROR_TYPE.BAD_CREDENTIALS,
data: {}
};
},
})
});
return expect(c.connect('email', 'password'))
.rejects.toBe(ERROR_TYPE.BAD_CREDENTIALS);
});
test("connect good credentials", () => {
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
return Promise.resolve({
json: () => {
return {
error: ERROR_TYPE.SUCCESS,
data: {token: 'token'}
};
},
})
});
jest.spyOn(ConnectionManager.prototype, 'saveLogin').mockImplementationOnce(() => {
return Promise.resolve(true);
});
return expect(c.connect('email', 'password')).resolves.toBeTruthy();
});
test("connect good credentials no consent", () => {
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
return Promise.resolve({
json: () => {
return {
error: ERROR_TYPE.NO_CONSENT,
data: {}
};
},
})
});
return expect(c.connect('email', 'password'))
.rejects.toBe(ERROR_TYPE.NO_CONSENT);
});
test("connect good credentials, fail save token", () => {
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
return Promise.resolve({
json: () => {
return {
error: ERROR_TYPE.SUCCESS,
data: {token: 'token'}
};
},
})
});
jest.spyOn(ConnectionManager.prototype, 'saveLogin').mockImplementationOnce(() => {
return Promise.reject(false);
});
return expect(c.connect('email', 'password')).rejects.toBe(ERROR_TYPE.UNKNOWN);
});
test("connect connection error", () => {
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
return Promise.reject();
});
return expect(c.connect('email', 'password'))
.rejects.toBe(ERROR_TYPE.CONNECTION_ERROR);
});
test("connect bogus response 1", () => {
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
return Promise.resolve({
json: () => {
return {
thing: true,
wrong: '',
}
},
})
});
return expect(c.connect('email', 'password'))
.rejects.toBe(ERROR_TYPE.CONNECTION_ERROR);
});
test("authenticatedRequest success", () => {
jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
return 'token';
});
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
return Promise.resolve({
json: () => {
return {
error: ERROR_TYPE.SUCCESS,
data: {coucou: 'toi'}
};
},
})
});
return expect(c.authenticatedRequest('https://www.amicale-insat.fr/api/token/check'))
.resolves.toStrictEqual({coucou: 'toi'});
});
test("authenticatedRequest error wrong token", () => {
jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
return 'token';
});
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
return Promise.resolve({
json: () => {
return {
error: ERROR_TYPE.BAD_TOKEN,
data: {}
};
},
})
});
return expect(c.authenticatedRequest('https://www.amicale-insat.fr/api/token/check'))
.rejects.toBe(ERROR_TYPE.BAD_TOKEN);
});
test("authenticatedRequest error bogus response", () => {
jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
return 'token';
});
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
return Promise.resolve({
json: () => {
return {
error: ERROR_TYPE.SUCCESS,
};
},
})
});
return expect(c.authenticatedRequest('https://www.amicale-insat.fr/api/token/check'))
.rejects.toBe(ERROR_TYPE.CONNECTION_ERROR);
});
test("authenticatedRequest connection error", () => {
jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
return 'token';
});
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
return Promise.reject()
});
return expect(c.authenticatedRequest('https://www.amicale-insat.fr/api/token/check'))
.rejects.toBe(ERROR_TYPE.CONNECTION_ERROR);
});
test("authenticatedRequest error no token", () => {
jest.spyOn(ConnectionManager.prototype, 'getToken').mockImplementationOnce(() => {
return null;
});
return expect(c.authenticatedRequest('https://www.amicale-insat.fr/api/token/check'))
.rejects.toBe(ERROR_TYPE.UNKNOWN);
});

View file

@ -0,0 +1,210 @@
import React from 'react';
import * as Planning from "../../src/utils/Planning";
test('isDescriptionEmpty', () => {
expect(Planning.isDescriptionEmpty("")).toBeTrue();
expect(Planning.isDescriptionEmpty(" ")).toBeTrue();
// noinspection CheckTagEmptyBody
expect(Planning.isDescriptionEmpty("<p></p>")).toBeTrue();
expect(Planning.isDescriptionEmpty("<p> </p>")).toBeTrue();
expect(Planning.isDescriptionEmpty("<p><br></p>")).toBeTrue();
expect(Planning.isDescriptionEmpty("<p><br></p><p><br></p>")).toBeTrue();
expect(Planning.isDescriptionEmpty("<p><br><br><br></p>")).toBeTrue();
expect(Planning.isDescriptionEmpty("<p><br>")).toBeTrue();
expect(Planning.isDescriptionEmpty(null)).toBeTrue();
expect(Planning.isDescriptionEmpty(undefined)).toBeTrue();
expect(Planning.isDescriptionEmpty("coucou")).toBeFalse();
expect(Planning.isDescriptionEmpty("<p>coucou</p>")).toBeFalse();
});
test('isEventDateStringFormatValid', () => {
expect(Planning.isEventDateStringFormatValid("2020-03-21 09:00")).toBeTrue();
expect(Planning.isEventDateStringFormatValid("3214-64-12 01:16")).toBeTrue();
expect(Planning.isEventDateStringFormatValid("3214-64-12 01:16:00")).toBeFalse();
expect(Planning.isEventDateStringFormatValid("3214-64-12 1:16")).toBeFalse();
expect(Planning.isEventDateStringFormatValid("3214-f4-12 01:16")).toBeFalse();
expect(Planning.isEventDateStringFormatValid("sqdd 09:00")).toBeFalse();
expect(Planning.isEventDateStringFormatValid("2020-03-21")).toBeFalse();
expect(Planning.isEventDateStringFormatValid("2020-03-21 truc")).toBeFalse();
expect(Planning.isEventDateStringFormatValid("3214-64-12 1:16:65")).toBeFalse();
expect(Planning.isEventDateStringFormatValid("garbage")).toBeFalse();
expect(Planning.isEventDateStringFormatValid("")).toBeFalse();
expect(Planning.isEventDateStringFormatValid(undefined)).toBeFalse();
expect(Planning.isEventDateStringFormatValid(null)).toBeFalse();
});
test('stringToDate', () => {
let testDate = new Date();
expect(Planning.stringToDate(undefined)).toBeNull();
expect(Planning.stringToDate("")).toBeNull();
expect(Planning.stringToDate("garbage")).toBeNull();
expect(Planning.stringToDate("2020-03-21")).toBeNull();
expect(Planning.stringToDate("09:00:00")).toBeNull();
expect(Planning.stringToDate("2020-03-21 09:g0")).toBeNull();
expect(Planning.stringToDate("2020-03-21 09:g0:")).toBeNull();
testDate.setFullYear(2020, 2, 21);
testDate.setHours(9, 0, 0, 0);
expect(Planning.stringToDate("2020-03-21 09:00")).toEqual(testDate);
testDate.setFullYear(2020, 0, 31);
testDate.setHours(18, 30, 0, 0);
expect(Planning.stringToDate("2020-01-31 18:30")).toEqual(testDate);
testDate.setFullYear(2020, 50, 50);
testDate.setHours(65, 65, 0, 0);
expect(Planning.stringToDate("2020-51-50 65:65")).toEqual(testDate);
});
test('getFormattedEventTime', () => {
expect(Planning.getFormattedEventTime(null, null))
.toBe('/ - /');
expect(Planning.getFormattedEventTime(undefined, undefined))
.toBe('/ - /');
expect(Planning.getFormattedEventTime("20:30", "23:00"))
.toBe('/ - /');
expect(Planning.getFormattedEventTime("2020-03-30", "2020-03-31"))
.toBe('/ - /');
expect(Planning.getFormattedEventTime("2020-03-21 09:00", "2020-03-21 09:00"))
.toBe('09:00');
expect(Planning.getFormattedEventTime("2020-03-21 09:00", "2020-03-22 17:00"))
.toBe('09:00 - 23:59');
expect(Planning.getFormattedEventTime("2020-03-30 20:30", "2020-03-30 23:00"))
.toBe('20:30 - 23:00');
});
test('getDateOnlyString', () => {
expect(Planning.getDateOnlyString("2020-03-21 09:00")).toBe("2020-03-21");
expect(Planning.getDateOnlyString("2021-12-15 09:00")).toBe("2021-12-15");
expect(Planning.getDateOnlyString("2021-12-o5 09:00")).toBeNull();
expect(Planning.getDateOnlyString("2021-12-15 09:")).toBeNull();
expect(Planning.getDateOnlyString("2021-12-15")).toBeNull();
expect(Planning.getDateOnlyString("garbage")).toBeNull();
});
test('isEventBefore', () => {
expect(Planning.isEventBefore(
"2020-03-21 09:00", "2020-03-21 10:00")).toBeTrue();
expect(Planning.isEventBefore(
"2020-03-21 10:00", "2020-03-21 10:15")).toBeTrue();
expect(Planning.isEventBefore(
"2020-03-21 10:15", "2021-03-21 10:15")).toBeTrue();
expect(Planning.isEventBefore(
"2020-03-21 10:15", "2020-05-21 10:15")).toBeTrue();
expect(Planning.isEventBefore(
"2020-03-21 10:15", "2020-03-30 10:15")).toBeTrue();
expect(Planning.isEventBefore(
"2020-03-21 10:00", "2020-03-21 10:00")).toBeFalse();
expect(Planning.isEventBefore(
"2020-03-21 10:00", "2020-03-21 09:00")).toBeFalse();
expect(Planning.isEventBefore(
"2020-03-21 10:15", "2020-03-21 10:00")).toBeFalse();
expect(Planning.isEventBefore(
"2021-03-21 10:15", "2020-03-21 10:15")).toBeFalse();
expect(Planning.isEventBefore(
"2020-05-21 10:15", "2020-03-21 10:15")).toBeFalse();
expect(Planning.isEventBefore(
"2020-03-30 10:15", "2020-03-21 10:15")).toBeFalse();
expect(Planning.isEventBefore(
"garbage", "2020-03-21 10:15")).toBeFalse();
expect(Planning.isEventBefore(
undefined, undefined)).toBeFalse();
});
test('dateToString', () => {
let testDate = new Date();
testDate.setFullYear(2020, 2, 21);
testDate.setHours(9, 0, 0, 0);
expect(Planning.dateToString(testDate)).toBe("2020-03-21 09:00");
testDate.setFullYear(2021, 0, 12);
testDate.setHours(9, 10, 0, 0);
expect(Planning.dateToString(testDate)).toBe("2021-01-12 09:10");
testDate.setFullYear(2022, 11, 31);
testDate.setHours(9, 10, 15, 0);
expect(Planning.dateToString(testDate)).toBe("2022-12-31 09:10");
});
test('generateEmptyCalendar', () => {
jest.spyOn(Date, 'now')
.mockImplementation(() =>
new Date('2020-01-14T00:00:00.000Z').getTime()
);
let calendar = Planning.generateEmptyCalendar(1);
expect(calendar).toHaveProperty("2020-01-14");
expect(calendar).toHaveProperty("2020-01-20");
expect(calendar).toHaveProperty("2020-02-10");
expect(Object.keys(calendar).length).toBe(32);
calendar = Planning.generateEmptyCalendar(3);
expect(calendar).toHaveProperty("2020-01-14");
expect(calendar).toHaveProperty("2020-01-20");
expect(calendar).toHaveProperty("2020-02-10");
expect(calendar).toHaveProperty("2020-02-14");
expect(calendar).toHaveProperty("2020-03-20");
expect(calendar).toHaveProperty("2020-04-12");
expect(Object.keys(calendar).length).toBe(92);
});
test('pushEventInOrder', () => {
let eventArray = [];
let event1 = {date_begin: "2020-01-14 09:15"};
Planning.pushEventInOrder(eventArray, event1);
expect(eventArray.length).toBe(1);
expect(eventArray[0]).toBe(event1);
let event2 = {date_begin: "2020-01-14 10:15"};
Planning.pushEventInOrder(eventArray, event2);
expect(eventArray.length).toBe(2);
expect(eventArray[0]).toBe(event1);
expect(eventArray[1]).toBe(event2);
let event3 = {date_begin: "2020-01-14 10:15", title: "garbage"};
Planning.pushEventInOrder(eventArray, event3);
expect(eventArray.length).toBe(3);
expect(eventArray[0]).toBe(event1);
expect(eventArray[1]).toBe(event2);
expect(eventArray[2]).toBe(event3);
let event4 = {date_begin: "2020-01-13 09:00"};
Planning.pushEventInOrder(eventArray, event4);
expect(eventArray.length).toBe(4);
expect(eventArray[0]).toBe(event4);
expect(eventArray[1]).toBe(event1);
expect(eventArray[2]).toBe(event2);
expect(eventArray[3]).toBe(event3);
});
test('generateEventAgenda', () => {
jest.spyOn(Date, 'now')
.mockImplementation(() =>
new Date('2020-01-14T00:00:00.000Z').getTime()
);
let eventList = [
{date_begin: "2020-01-14 09:15"},
{date_begin: "2020-02-01 09:15"},
{date_begin: "2020-01-15 09:15"},
{date_begin: "2020-02-01 09:30"},
{date_begin: "2020-02-01 08:30"},
];
const calendar = Planning.generateEventAgenda(eventList, 2);
expect(calendar["2020-01-14"].length).toBe(1);
expect(calendar["2020-01-14"][0]).toBe(eventList[0]);
expect(calendar["2020-01-15"].length).toBe(1);
expect(calendar["2020-01-15"][0]).toBe(eventList[2]);
expect(calendar["2020-02-01"].length).toBe(3);
expect(calendar["2020-02-01"][0]).toBe(eventList[4]);
expect(calendar["2020-02-01"][1]).toBe(eventList[1]);
expect(calendar["2020-02-01"][2]).toBe(eventList[3]);
});
test('getCurrentDateString', () => {
jest.spyOn(Date, 'now')
.mockImplementation(() => {
let date = new Date();
date.setFullYear(2020, 0, 14);
date.setHours(15, 30, 54, 65);
return date.getTime();
});
expect(Planning.getCurrentDateString()).toBe('2020-01-14 15:30');
});

View file

@ -0,0 +1,142 @@
import React from 'react';
import {getCleanedMachineWatched, getMachineEndDate, getMachineOfId, isMachineWatched} from "../../src/utils/Proxiwash";
test('getMachineEndDate', () => {
jest.spyOn(Date, 'now')
.mockImplementation(() =>
new Date('2020-01-14T15:00:00.000Z').getTime()
);
let expectDate = new Date('2020-01-14T15:00:00.000Z');
expectDate.setHours(23);
expectDate.setMinutes(10);
expect(getMachineEndDate({endTime: "23:10"}).getTime()).toBe(expectDate.getTime());
expectDate.setHours(16);
expectDate.setMinutes(30);
expect(getMachineEndDate({endTime: "16:30"}).getTime()).toBe(expectDate.getTime());
expect(getMachineEndDate({endTime: "15:30"})).toBeNull();
expect(getMachineEndDate({endTime: "13:10"})).toBeNull();
jest.spyOn(Date, 'now')
.mockImplementation(() =>
new Date('2020-01-14T23:00:00.000Z').getTime()
);
expectDate = new Date('2020-01-14T23:00:00.000Z');
expectDate.setHours(0);
expectDate.setMinutes(30);
expect(getMachineEndDate({endTime: "00:30"}).getTime()).toBe(expectDate.getTime());
});
test('isMachineWatched', () => {
let machineList = [
{
number: "0",
endTime: "23:30",
},
{
number: "1",
endTime: "20:30",
},
];
expect(isMachineWatched({number: "0", endTime: "23:30"}, machineList)).toBeTrue();
expect(isMachineWatched({number: "1", endTime: "20:30"}, machineList)).toBeTrue();
expect(isMachineWatched({number: "3", endTime: "20:30"}, machineList)).toBeFalse();
expect(isMachineWatched({number: "1", endTime: "23:30"}, machineList)).toBeFalse();
});
test('getMachineOfId', () => {
let machineList = [
{
number: "0",
},
{
number: "1",
},
];
expect(getMachineOfId("0", machineList)).toStrictEqual({number: "0"});
expect(getMachineOfId("1", machineList)).toStrictEqual({number: "1"});
expect(getMachineOfId("3", machineList)).toBeNull();
});
test('getCleanedMachineWatched', () => {
let machineList = [
{
number: "0",
endTime: "23:30",
},
{
number: "1",
endTime: "20:30",
},
{
number: "2",
endTime: "",
},
];
let watchList = [
{
number: "0",
endTime: "23:30",
},
{
number: "1",
endTime: "20:30",
},
{
number: "2",
endTime: "",
},
];
let cleanedList = watchList;
expect(getCleanedMachineWatched(watchList, machineList)).toStrictEqual(cleanedList);
watchList = [
{
number: "0",
endTime: "23:30",
},
{
number: "1",
endTime: "20:30",
},
{
number: "2",
endTime: "15:30",
},
];
cleanedList = [
{
number: "0",
endTime: "23:30",
},
{
number: "1",
endTime: "20:30",
},
];
expect(getCleanedMachineWatched(watchList, machineList)).toStrictEqual(cleanedList);
watchList = [
{
number: "0",
endTime: "23:30",
},
{
number: "1",
endTime: "20:31",
},
{
number: "3",
endTime: "15:30",
},
];
cleanedList = [
{
number: "0",
endTime: "23:30",
},
];
expect(getCleanedMachineWatched(watchList, machineList)).toStrictEqual(cleanedList);
});

View file

@ -0,0 +1,45 @@
import React from 'react';
import {isResponseValid} from "../../src/utils/WebData";
let fetch = require('isomorphic-fetch'); // fetch is not implemented in nodeJS but in react-native
test('isRequestResponseValid', () => {
let json = {
error: 0,
data: {}
};
expect(isResponseValid(json)).toBeTrue();
json = {
error: 1,
data: {}
};
expect(isResponseValid(json)).toBeTrue();
json = {
error: 50,
data: {}
};
expect(isResponseValid(json)).toBeTrue();
json = {
error: 50,
data: {truc: 'machin'}
};
expect(isResponseValid(json)).toBeTrue();
json = {
message: 'coucou'
};
expect(isResponseValid(json)).toBeFalse();
json = {
error: 'coucou',
data: {truc: 'machin'}
};
expect(isResponseValid(json)).toBeFalse();
json = {
error: 0,
data: 'coucou'
};
expect(isResponseValid(json)).toBeFalse();
json = {
error: 0,
};
expect(isResponseValid(json)).toBeFalse();
});

55
android/app/BUCK Normal file
View file

@ -0,0 +1,55 @@
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
lib_deps = []
create_aar_targets(glob(["libs/*.aar"]))
create_jar_targets(glob(["libs/*.jar"]))
android_library(
name = "all-libs",
exported_deps = lib_deps,
)
android_library(
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)
android_build_config(
name = "build_config",
package = "fr.amicaleinsat.application",
)
android_resource(
name = "res",
package = "fr.amicaleinsat.application",
res = "src/main/res",
)
android_binary(
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)

215
android/app/build.gradle Normal file
View file

@ -0,0 +1,215 @@
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
entryFile: "index.js",
enableHermes: false,
]
apply from: "../../node_modules/react-native/react.gradle"
project.ext.vectoricons = [
iconFontNames: [ 'MaterialCommunityIcons.ttf'] // Name of the font files you want to copy
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore.
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and mirrored here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId 'fr.amicaleinsat.application'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 19
versionName "3.0.2"
missingDimensionStrategy 'react-native-camera', 'general'
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file(MYAPP_UPLOAD_STORE_FILE)
storePassword MYAPP_UPLOAD_STORE_PASSWORD
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
}
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

View file

@ -0,0 +1,19 @@
"""Helper definitions to glob .aar and .jar targets"""
def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
def create_jar_targets(jarfiles):
for jarfile in jarfiles:
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
lib_deps.append(":" + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)

13
android/app/proguard-rules.pro vendored Normal file
View file

@ -0,0 +1,13 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }

View file

@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
</manifest>

View file

@ -0,0 +1,66 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="fr.amicaleinsat.application">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
>
<!-- NOTIFICATIONS -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_name"
android:value="reminders"/>
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_description"
android:value="reminders"/>
<!-- Change the resource name to your App's accent color - or any other color you want -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color"
android:resource="@color/colorPrimary"/> <!-- or @android:color/{name} to use a standard color -->
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- END NOTIFICATIONS-->
<meta-data android:name="com.facebook.sdk.AutoInitEnabled" android:value="false"/>
<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="false"/>
<meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled" android:value="false"/>
<activity android:name=".MainActivity" android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask" android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="campus-insat"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
</application>
</manifest>

View file

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1,48 @@
package fr.amicaleinsat.application;
import android.os.Bundle;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
import android.content.Intent;
import android.content.res.Configuration;
import org.devio.rn.splashscreen.SplashScreen;
public class MainActivity extends ReactActivity {
// Added automatically by Expo Config
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Intent intent = new Intent("onConfigurationChanged");
intent.putExtra("newConfig", newConfig);
sendBroadcast(intent);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this);
super.onCreate(savedInstanceState);
}
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "main";
}
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
}

View file

@ -0,0 +1,75 @@
package fr.amicaleinsat.application;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Nullable;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this); // Remove this line if you don't want Flipper enabled
}
/**
* Loads Flipper in React Native templates.
*
* @param context
*/
private static void initializeFlipper(Context context) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:scaleType="fitCenter"
android:src="@drawable/launch_screen" />
</RelativeLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources>
<color name="activityBackground">#be1522</color>
<color name="navigationBarColor">#121212</color>
<color name="colorPrimaryDark">#be1522</color>
<color name="colorPrimary">#be1522</color>
<color name="primary_dark">#be1522</color>
</resources>

View file

@ -0,0 +1,3 @@
<resources>
<string name="app_name">Campus</string>
</resources>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:textColor">#000000</item>
<item name="android:windowBackground">@color/activityBackground</item>
<item name="android:navigationBarColor">@color/navigationBarColor</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorPrimary">@color/colorPrimary</item>
</style>
</resources>

View file

@ -0,0 +1,27 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE"/>
<uses-permission tools:node="remove" android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission tools:node="remove" android:name="android.permission.MANAGE_DOCUMENTS"/>
<uses-permission tools:node="remove" android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission tools:node="remove" android:name="android.permission.USE_FINGERPRINT"/>
<uses-permission tools:node="remove" android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission tools:node="remove" android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission tools:node="remove" android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission tools:node="remove" android:name="android.permission.READ_CONTACTS"/>
<uses-permission tools:node="remove" android:name="android.permission.READ_CALENDAR"/>
<uses-permission tools:node="remove" android:name="android.permission.WRITE_CALENDAR"/>
<uses-permission tools:node="remove" android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission tools:node="remove" android:name="android.permission.RECORD_AUDIO"/>
<uses-permission tools:node="remove" android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission tools:node="remove" android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission tools:node="remove" android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>

41
android/build.gradle Normal file
View file

@ -0,0 +1,41 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.3")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven {
// expo-camera bundles a custom com.google.android:cameraview
url "$rootDir/../node_modules/expo-camera/android/maven"
}
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}

Binary file not shown.

View file

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

188
android/gradlew vendored Executable file
View file

@ -0,0 +1,188 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

100
android/gradlew.bat vendored Normal file
View file

@ -0,0 +1,100 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

6
android/settings.gradle Normal file
View file

@ -0,0 +1,6 @@
rootProject.name = 'Campus'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
applyNativeModulesSettingsGradle(settings)
include ':app'

View file

@ -1,51 +1,4 @@
{
"expo": {
"name": "Campus",
"description": "Application mobile compatible Android et iOS pour l'Amicale INSA Toulouse. Grâce à cette application, vous avez facilement accès aux news du campus, aux emplois du temps, à l'état de la laverie, et bien d'autres services ! Ceci est une version Beta, Toutes les fonctionnalités ne sont pas encore implémentées, et il est possible de rencontrer quelques bugs.",
"slug": "application-amicale",
"privacy": "public",
"sdkVersion": "36.0.0",
"platforms": [
"ios",
"android",
"web"
],
"version": "2.0.0",
"orientation": "portrait",
"primaryColor": "#be1522",
"userInterfaceStyle": "automatic",
"icon": "./assets/android.icon.png",
"splash": {
"backgroundColor": "#be1522",
"resizeMode": "contain",
"image": "./assets/splash.png"
},
"notification": {
"icon": "./assets/icon-notification.png",
"color": "#be1522",
"androidMode": "default"
},
"updates": {
"enabled": false
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"bundleIdentifier": "fr.amicaleinsat.application",
"icon": "./assets/ios.icon.png"
},
"android": {
"package": "fr.amicaleinsat.application",
"versionCode": 16,
"icon": "./assets/android.icon.png",
"adaptiveIcon": {
"foregroundImage": "./assets/android.adaptive-icon.png",
"backgroundColor": "#be1522"
},
"permissions": [
"VIBRATE"
]
}
}
}
"name": "Campus",
"displayName": "Campus"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 147 KiB

BIN
assets/tab-icon-outline.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
assets/tab-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -1,11 +1,3 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
env: {
production: {
plugins: ['react-native-paper/babel'],
},
},
};
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};

View file

@ -1 +1,18 @@
rm -rf node_modules/ && rm -f package-lock.json && rm -f yarn.lock && npm cache verify && npm install && expo r -c
#!/bin/bash
echo "Removing node_modules..."
rm -rf node_modules/
echo -e "Done\n"
echo "Removing locks..."
rm -f package-lock.json && rm -f yarn.lock
echo -e "Done\n"
#echo "Verifying npm cache..."
#npm cache verify
#echo -e "Done\n"
echo "Installing dependencies..."
npm install
echo -e "Done\n"

View file

@ -1,40 +0,0 @@
import * as React from 'react';
import {withTheme} from 'react-native-paper';
import {Agenda} from "react-native-calendars";
function CustomAgenda(props) {
const { colors } = props.theme;
return (
<Agenda
{...props}
ref={props.onRef}
theme={{
backgroundColor: colors.agendaBackgroundColor,
calendarBackground: colors.background,
textSectionTitleColor: colors.agendaDayTextColor,
selectedDayBackgroundColor: colors.primary,
selectedDayTextColor: '#ffffff',
todayTextColor: colors.primary,
dayTextColor: colors.text,
textDisabledColor: colors.agendaDayTextColor,
dotColor: colors.primary,
selectedDotColor: '#ffffff',
arrowColor: 'orange',
monthTextColor: colors.primary,
indicatorColor: colors.primary,
textDayFontWeight: '300',
textMonthFontWeight: 'bold',
textDayHeaderFontWeight: '300',
textDayFontSize: 16,
textMonthFontSize: 16,
textDayHeaderFontSize: 16,
agendaDayTextColor: colors.agendaDayTextColor,
agendaDayNumColor: colors.agendaDayTextColor,
agendaTodayColor: colors.primary,
agendaKnobColor: colors.primary,
}}
/>
);
}
export default withTheme(CustomAgenda);

View file

@ -1,41 +0,0 @@
import * as React from 'react';
import {ActivityIndicator, Subheading, withTheme} from 'react-native-paper';
import {View} from "react-native";
import {MaterialCommunityIcons} from "@expo/vector-icons";
function EmptyWebSectionListItem(props) {
const { colors } = props.theme;
return (
<View>
<View style={{
justifyContent: 'center',
alignItems: 'center',
width: '100%',
height: 100,
marginBottom: 20
}}>
{props.refreshing ?
<ActivityIndicator
animating={true}
size={'large'}
color={colors.primary}/>
:
<MaterialCommunityIcons
name={props.icon}
size={100}
color={colors.textDisabled}/>}
</View>
<Subheading style={{
textAlign: 'center',
marginRight: 20,
marginLeft: 20,
color: colors.textDisabled
}}>
{props.text}
</Subheading>
</View>
);
}
export default withTheme(EmptyWebSectionListItem);

View file

@ -1,44 +0,0 @@
// @flow
import * as React from 'react';
import {Avatar, Card, withTheme} from 'react-native-paper';
function EventDashBoardItem(props) {
const {colors} = props.theme;
const iconColor = props.isAvailable ?
colors.planningColor :
colors.textDisabled;
const textColor = props.isAvailable ?
colors.text :
colors.textDisabled;
return (
<Card
style={{
width: 'auto',
marginLeft: 10,
marginRight: 10,
marginTop: 10,
overflow: 'hidden',
}}
onPress={props.clickAction}>
<Card.Title
title={props.title}
titleStyle={{color: textColor}}
subtitle={props.subtitle}
subtitleStyle={{color: textColor}}
left={() =>
<Avatar.Icon
icon={props.icon}
color={iconColor}
size={60}
style={{backgroundColor: 'transparent'}}/>}
/>
<Card.Content>
{props.children}
</Card.Content>
</Card>
);
}
export default withTheme(EventDashBoardItem);

View file

@ -1,48 +0,0 @@
import * as React from 'react';
import {Avatar, Button, Card, withTheme} from 'react-native-paper';
import {TouchableOpacity, View} from "react-native";
import Autolink from "react-native-autolink";
import i18n from "i18n-js";
const ICON_AMICALE = require('../assets/amicale.png');
function getAvatar() {
return (
<Avatar.Image size={48} source={ICON_AMICALE}
style={{backgroundColor: 'transparent'}}/>
);
}
function FeedItem(props) {
const {colors} = props.theme;
return (
<Card style={{margin: 10}}>
<Card.Title
title={props.title}
subtitle={props.subtitle}
left={getAvatar}
/>
{props.full_picture !== '' && props.full_picture !== undefined ?
<TouchableOpacity onPress={props.onImagePress}>
<Card.Cover source={{uri: props.full_picture}}/>
</TouchableOpacity> : <View/>}
<Card.Content>
{props.message !== undefined ?
<Autolink
text={props.message}
hashtag="facebook"
style={{color: colors.text}}
/> : <View/>
}
</Card.Content>
<Card.Actions>
<Button
color={'#57aeff'}
onPress={props.onOutLinkPress}
icon={'facebook'}>{i18n.t('homeScreen.dashboard.seeMore')}</Button>
</Card.Actions>
</Card>
);
}
export default withTheme(FeedItem);

View file

@ -1,16 +0,0 @@
import * as React from 'react';
import {IconButton, withTheme} from 'react-native-paper';
function HeaderButton(props) {
const { colors } = props.theme;
return (
<IconButton
icon={props.icon}
size={26}
color={colors.text}
onPress={props.onPress}
/>
);
}
export default withTheme(HeaderButton);

View file

@ -1,66 +0,0 @@
// @flow
import * as React from 'react';
import {View} from "react-native";
import HTML from "react-native-render-html";
import i18n from "i18n-js";
import {Avatar, Button, Card, withTheme} from 'react-native-paper';
import PlanningEventManager from "../utils/PlanningEventManager";
function PreviewEventDashboardItem(props) {
const {colors} = props.theme;
const isEmpty = props.event === undefined ? true : PlanningEventManager.isDescriptionEmpty(props.event['description']);
if (props.event !== undefined && props.event !== null) {
const hasImage = props.event['logo'] !== '' && props.event['logo'] !== null;
const getImage = () => <Avatar.Image
source={{uri: props.event['logo']}}
size={50}
style={{backgroundColor: 'transparent'}}/>;
return (
<Card
style={{marginBottom: 10}}
onPress={props.clickAction}
elevation={3}
>
{hasImage ?
<Card.Title
title={props.event['title']}
subtitle={PlanningEventManager.getFormattedEventTime(props.event)}
left={getImage}
/> :
<Card.Title
title={props.event['title']}
subtitle={PlanningEventManager.getFormattedEventTime(props.event)}
/>}
{!isEmpty ?
<Card.Content style={{
maxHeight: 150,
overflow: 'hidden',
}}>
<HTML html={"<div>" + props.event['description'] + "</div>"}
tagsStyles={{
p: {color: colors.text,},
div: {color: colors.text},
}}/>
</Card.Content> : null}
<Card.Actions style={{
marginLeft: 'auto',
marginTop: 'auto',
flexDirection: 'row'
}}>
<Button
icon={'chevron-right'}
>
{i18n.t("homeScreen.dashboard.seeMore")}
</Button>
</Card.Actions>
</Card>
);
} else
return <View/>
}
export default withTheme(PreviewEventDashboardItem);

View file

@ -1,89 +0,0 @@
import * as React from 'react';
import {Avatar, Card, Text, withTheme} from 'react-native-paper';
import {View} from "react-native";
import ProxiwashConstants from "../constants/ProxiwashConstants";
function ProxiwashListItem(props) {
const {colors} = props.theme;
let stateColors = {};
stateColors[ProxiwashConstants.machineStates.TERMINE] = colors.proxiwashFinishedColor;
stateColors[ProxiwashConstants.machineStates.DISPONIBLE] = colors.proxiwashReadyColor;
stateColors[ProxiwashConstants.machineStates["EN COURS"]] = colors.proxiwashRunningColor;
stateColors[ProxiwashConstants.machineStates.HS] = colors.proxiwashBrokenColor;
stateColors[ProxiwashConstants.machineStates.ERREUR] = colors.proxiwashErrorColor;
const icon = (
props.isWatched ?
<Avatar.Icon
icon={'bell-ring'}
size={45}
color={colors.primary}
style={{backgroundColor: 'transparent'}}
/> :
<Avatar.Icon
icon={props.isDryer ? 'tumble-dryer' : 'washing-machine'}
color={colors.text}
size={40}
style={{backgroundColor: 'transparent'}}
/>
);
return (
<Card
style={{
margin: 5,
}}
onPress={props.onPress}
>
{ProxiwashConstants.machineStates[props.state] === ProxiwashConstants.machineStates["EN COURS"] ?
<Card style={{
height: '100%',
position: 'absolute',
left: 0,
width: '100%',
backgroundColor: colors.proxiwashRunningBgColor,
elevation: 0
}}/> : null
}
<Card style={{
height: '100%',
position: 'absolute',
left: 0,
width: props.progress,
backgroundColor: stateColors[ProxiwashConstants.machineStates[props.state]],
elevation: 0
}}/>
<Card.Title
title={props.title}
titleStyle={{fontSize: 17}}
subtitle={props.description}
style={{
backgroundColor: 'transparent',
height: 64
}}
left={() => icon}
right={() => (
<View style={{flexDirection: 'row'}}>
<View style={{
justifyContent: 'center',
}}>
<Text style={
ProxiwashConstants.machineStates[props.state] === ProxiwashConstants.machineStates.TERMINE ?
{fontWeight: 'bold',} : {}}
>
{props.statusText}
</Text>
</View>
<Avatar.Icon
icon={props.statusIcon}
color={colors.text}
size={30}
style={{backgroundColor: 'transparent'}}
/>
</View>)}
/>
</Card>
);
}
export default withTheme(ProxiwashListItem);

View file

@ -1,31 +0,0 @@
import * as React from 'react';
import {FlatList} from "react-native";
type Props = {
data: Array<Object>,
keyExtractor: Function,
renderItem: Function,
updateData: number,
}
/**
* This is a pure component, meaning it will only update if a shallow comparison of state and props is different.
* To force the component to update, change the value of updateData.
*/
export default class PureFlatList extends React.PureComponent<Props>{
static defaultProps = {
updateData: null,
};
render() {
return (
<FlatList
data={this.props.data}
keyExtractor={this.props.keyExtractor}
style={{minHeight: 300, width: '100%'}}
renderItem={this.props.renderItem}
/>
);
}
}

View file

@ -1,190 +0,0 @@
// @flow
import * as React from 'react';
import {Dimensions, FlatList, Image, Platform, StyleSheet, View} from 'react-native';
import i18n from "i18n-js";
import * as WebBrowser from 'expo-web-browser';
import SidebarDivider from "./SidebarDivider";
import SidebarItem from "./SidebarItem";
const deviceWidth = Dimensions.get("window").width;
type Props = {
navigation: Object,
state: Object,
};
type State = {
active: string,
};
/**
* Class used to define a navigation drawer
*/
export default class SideBar extends React.PureComponent<Props, State> {
dataSet: Array<Object>;
state = {
active: 'Home',
};
getRenderItem: Function;
/**
* Generate the datasets
*
* @param props
*/
constructor(props: Props) {
super(props);
// Dataset used to render the drawer
this.dataSet = [
{
name: i18n.t('screens.home'),
route: "Main",
icon: "home",
},
{
name: i18n.t('sidenav.divider2'),
route: "Divider2"
},
{
name: i18n.t('screens.menuSelf'),
route: "SelfMenuScreen",
icon: "silverware-fork-knife",
},
{
name: i18n.t('screens.availableRooms'),
route: "AvailableRoomScreen",
icon: "calendar-check",
},
{
name: i18n.t('screens.bib'),
route: "BibScreen",
icon: "book",
},
{
name: i18n.t('screens.bluemind'),
route: "BlueMindScreen",
link: "https://etud-mel.insa-toulouse.fr/webmail/",
icon: "email",
},
{
name: i18n.t('screens.ent'),
route: "EntScreen",
link: "https://ent.insa-toulouse.fr/",
icon: "notebook",
},
{
name: i18n.t('sidenav.divider1'),
route: "Divider1"
},
{
name: "Amicale",
route: "AmicaleScreen",
link: "https://amicale-insat.fr/",
icon: "alpha-a-box",
},
{
name: "Élus Étudiants",
route: "ElusEtudScreen",
link: "https://etud.insa-toulouse.fr/~eeinsat/",
icon: "alpha-e-box",
},
{
name: "Wiketud",
route: "WiketudScreen",
link: "https://wiki.etud.insa-toulouse.fr",
icon: "wikipedia",
},
{
name: "Tutor'INSA",
route: "TutorInsaScreen",
link: "https://www.etud.insa-toulouse.fr/~tutorinsa/",
icon: "school",
},
{
name: i18n.t('sidenav.divider3'),
route: "Divider3"
},
{
name: i18n.t('screens.settings'),
route: "SettingsScreen",
icon: "settings",
},
{
name: i18n.t('screens.about'),
route: "AboutScreen",
icon: "information",
},
];
this.getRenderItem = this.getRenderItem.bind(this);
}
onListItemPress(item: Object) {
if (item.link === undefined)
this.props.navigation.navigate(item.route);
else
WebBrowser.openBrowserAsync(item.link);
}
listKeyExtractor(item: Object) {
return item.route;
}
getRenderItem({item}: Object) {
const onListItemPress = this.onListItemPress.bind(this, item);
if (item.icon !== undefined) {
return (
<SidebarItem
title={item.name}
icon={item.icon}
onPress={onListItemPress}
/>
);
} else {
return (
<SidebarDivider title={item.name}/>
);
}
}
render() {
return (
<View style={{height: '100%'}}>
<Image source={require("../assets/drawer-cover.png")} style={styles.drawerCover}/>
<FlatList
data={this.dataSet}
extraData={this.state}
keyExtractor={this.listKeyExtractor}
renderItem={this.getRenderItem}
/>
</View>
);
}
}
const styles = StyleSheet.create({
drawerCover: {
height: deviceWidth / 3,
width: 2 * deviceWidth / 3,
position: "relative",
marginBottom: 10,
marginTop: 20
},
text: {
fontWeight: Platform.OS === "ios" ? "500" : "400",
fontSize: 16,
marginLeft: 20
},
badgeText: {
fontSize: Platform.OS === "ios" ? 13 : 11,
fontWeight: "400",
textAlign: "center",
marginTop: Platform.OS === "android" ? -3 : undefined
}
});

View file

@ -1,23 +0,0 @@
import * as React from 'react';
import { withTheme } from 'react-native-paper';
import {DrawerItem} from "@react-navigation/drawer";
function SidebarDivider(props) {
const { colors } = props.theme;
return (
<DrawerItem
label={props.title}
focused={false}
onPress={undefined}
style={{
marginLeft: 0,
marginRight: 0,
padding: 0,
borderRadius: 0,
backgroundColor: colors.dividerBackground
}}
/>
);
}
export default withTheme(SidebarDivider);

View file

@ -1,28 +0,0 @@
import * as React from 'react';
import {withTheme} from 'react-native-paper';
import {DrawerItem} from "@react-navigation/drawer";
import {MaterialCommunityIcons} from "@expo/vector-icons";
function SidebarItem(props) {
const {colors} = props.theme;
return (
<DrawerItem
label={props.title}
focused={false}
onPress={props.onPress}
icon={({color, size}) =>
<MaterialCommunityIcons color={color} size={size} name={props.icon}/>}
style={{
marginLeft: 0,
marginRight: 0,
padding: 0,
borderRadius: 0,
}}
labelStyle={{
color: colors.text,
}}
/>
);
}
export default withTheme(SidebarItem);

View file

@ -1,33 +0,0 @@
import * as React from 'react';
import {Badge, IconButton, withTheme} from 'react-native-paper';
import {View} from "react-native";
function SquareDashboardItem(props) {
const {colors} = props.theme;
return (
<View>
<IconButton
icon={props.icon}
color={
props.isAvailable ?
props.color :
colors.textDisabled
}
size={35}
onPress={props.clickAction}
/>
{
props.badgeNumber > 0 ?
<Badge
style={{
position: 'absolute',
top: 5,
right: 5
}}>{props.badgeNumber}</Badge> : null
}
</View>
);
}
export default withTheme(SquareDashboardItem);

View file

@ -1,228 +0,0 @@
// @flow
import * as React from 'react';
import WebDataManager from "../utils/WebDataManager";
import i18n from "i18n-js";
import {Snackbar} from 'react-native-paper';
import {RefreshControl, SectionList, View} from "react-native";
import EmptyWebSectionListItem from "./EmptyWebSectionListItem";
type Props = {
navigation: Object,
fetchUrl: string,
autoRefreshTime: number,
refreshOnFocus: boolean,
renderItem: React.Node,
renderSectionHeader: React.Node,
stickyHeader: boolean,
createDataset: Function,
updateData: number,
}
type State = {
refreshing: boolean,
firstLoading: boolean,
fetchedData: Object,
snackbarVisible: boolean
};
const MIN_REFRESH_TIME = 5 * 1000;
/**
* This is a pure component, meaning it will only update if a shallow comparison of state and props is different.
* To force the component to update, change the value of updateData.
*/
export default class WebSectionList extends React.PureComponent<Props, State> {
static defaultProps = {
renderSectionHeader: null,
stickyHeader: false,
updateData: null,
};
webDataManager: WebDataManager;
refreshInterval: IntervalID;
lastRefresh: Date;
state = {
refreshing: false,
firstLoading: true,
fetchedData: {},
snackbarVisible: false
};
onRefresh: Function;
onFetchSuccess: Function;
onFetchError: Function;
getEmptyRenderItem: Function;
getEmptySectionHeader: Function;
showSnackBar: Function;
hideSnackBar: Function;
constructor() {
super();
// creating references to functions used in render()
this.onRefresh = this.onRefresh.bind(this);
this.onFetchSuccess = this.onFetchSuccess.bind(this);
this.onFetchError = this.onFetchError.bind(this);
this.getEmptyRenderItem = this.getEmptyRenderItem.bind(this);
this.getEmptySectionHeader = this.getEmptySectionHeader.bind(this);
this.showSnackBar = this.showSnackBar.bind(this);
this.hideSnackBar = this.hideSnackBar.bind(this);
}
/**
* Register react navigation events on first screen load.
* Allows to detect when the screen is focused
*/
componentDidMount() {
this.webDataManager = new WebDataManager(this.props.fetchUrl);
const onScreenFocus = this.onScreenFocus.bind(this);
const onScreenBlur = this.onScreenBlur.bind(this);
this.props.navigation.addListener('focus', onScreenFocus);
this.props.navigation.addListener('blur', onScreenBlur);
this.onRefresh();
}
/**
* Refresh data when focusing the screen and setup a refresh interval if asked to
*/
onScreenFocus() {
if (this.props.refreshOnFocus && this.lastRefresh !== undefined)
this.onRefresh();
if (this.props.autoRefreshTime > 0)
this.refreshInterval = setInterval(this.onRefresh, this.props.autoRefreshTime)
}
/**
* Remove any interval on un-focus
*/
onScreenBlur() {
clearInterval(this.refreshInterval);
}
onFetchSuccess(fetchedData: Object) {
this.setState({
fetchedData: fetchedData,
refreshing: false,
firstLoading: false
});
this.lastRefresh = new Date();
}
onFetchError() {
this.setState({
fetchedData: {},
refreshing: false,
firstLoading: false
});
this.showSnackBar();
// this.webDataManager.showUpdateToast(this.props.updateErrorText);
}
/**
* Refresh data and show a toast if any error occurred
* @private
*/
onRefresh() {
let canRefresh;
if (this.lastRefresh !== undefined)
canRefresh = (new Date().getTime() - this.lastRefresh.getTime()) > MIN_REFRESH_TIME;
else
canRefresh = true;
if (canRefresh) {
this.setState({refreshing: true});
this.webDataManager.readData()
.then(this.onFetchSuccess)
.catch(this.onFetchError);
}
}
getEmptySectionHeader({section}: Object) {
return <View/>;
}
getEmptyRenderItem({item}: Object) {
return (
<EmptyWebSectionListItem
text={item.text}
icon={item.icon}
refreshing={this.state.refreshing}
/>
);
}
createEmptyDataset() {
return [
{
title: '',
data: [
{
text: this.state.refreshing ?
i18n.t('general.loading') :
i18n.t('general.networkError'),
isSpinner: this.state.refreshing,
icon: this.state.refreshing ?
'refresh' :
'access-point-network-off'
}
],
keyExtractor: this.datasetKeyExtractor,
}
];
}
datasetKeyExtractor(item: Object) {
return item.text
}
showSnackBar() {
this.setState({snackbarVisible: true})
}
hideSnackBar() {
this.setState({snackbarVisible: false})
}
render() {
let dataset = this.props.createDataset(this.state.fetchedData);
const isEmpty = dataset[0].data.length === 0;
const shouldRenderHeader = !isEmpty && (this.props.renderSectionHeader !== null);
if (isEmpty)
dataset = this.createEmptyDataset();
return (
<View>
<Snackbar
visible={this.state.snackbarVisible}
onDismiss={this.hideSnackBar}
action={{
label: 'OK',
onPress: this.hideSnackBar,
}}
duration={4000}
>
{i18n.t("homeScreen.listUpdateFail")}
</Snackbar>
<SectionList
sections={dataset}
refreshControl={
<RefreshControl
refreshing={this.state.refreshing}
onRefresh={this.onRefresh}
/>
}
renderSectionHeader={shouldRenderHeader ? this.props.renderSectionHeader : this.getEmptySectionHeader}
renderItem={isEmpty ? this.getEmptyRenderItem : this.props.renderItem}
style={{minHeight: 300, width: '100%'}}
stickySectionHeadersEnabled={this.props.stickyHeader}
contentContainerStyle={
isEmpty ?
{flexGrow: 1, justifyContent: 'center', alignItems: 'center'} : {}
}
/>
</View>
);
}
}

View file

@ -1,136 +0,0 @@
// @flow
import * as React from 'react';
import {View} from 'react-native';
import WebView from "react-native-webview";
import {ActivityIndicator, withTheme} from 'react-native-paper';
import HeaderButton from "./HeaderButton";
type Props = {
navigation: Object,
data: Array<{
url: string,
icon: string,
name: string,
customJS: string
}>,
headerTitle: string,
hasHeaderBackButton: boolean,
hasSideMenu: boolean,
hasFooter: boolean,
}
/**
* Class defining a webview screen.
*/
class WebViewScreen extends React.PureComponent<Props> {
static defaultProps = {
hasBackButton: false,
hasSideMenu: true,
hasFooter: true,
};
webviewRef: Object;
onRefreshClicked: Function;
onWebviewRef: Function;
onGoBackWebview: Function;
onGoForwardWebview: Function;
getRenderLoading: Function;
colors: Object;
constructor(props) {
super(props);
this.onRefreshClicked = this.onRefreshClicked.bind(this);
this.onWebviewRef = this.onWebviewRef.bind(this);
this.onGoBackWebview = this.onGoBackWebview.bind(this);
this.onGoForwardWebview = this.onGoForwardWebview.bind(this);
this.getRenderLoading = this.getRenderLoading.bind(this);
this.colors = props.theme.colors;
}
componentDidMount() {
const rightButton = this.getRefreshButton.bind(this);
this.props.navigation.setOptions({
headerRight: rightButton,
});
}
getHeaderButton(clickAction: Function, icon: string) {
return (
<HeaderButton icon={icon} onPress={clickAction}/>
);
}
getRefreshButton() {
return (
<View style={{
flexDirection: 'row',
marginRight: 10
}}>
{this.getHeaderButton(this.onRefreshClicked, 'refresh')}
</View>
);
};
onRefreshClicked() {
if (this.webviewRef !== null)
this.webviewRef.reload();
}
onGoBackWebview() {
if (this.webviewRef !== null)
this.webviewRef.goBack();
}
onGoForwardWebview() {
if (this.webviewRef !== null)
this.webviewRef.goForward();
}
onWebviewRef(ref: Object) {
this.webviewRef = ref
}
getRenderLoading() {
return (
<View style={{
backgroundColor: this.colors.background,
position: 'absolute',
top: 0,
right: 0,
width: '100%',
height: '100%',
flex: 1,
alignItems: 'center',
justifyContent: 'center'
}}>
<ActivityIndicator
animating={true}
size={'large'}
color={this.colors.primary}/>
</View>
);
}
render() {
// console.log("rendering WebViewScreen");
return (
<WebView
ref={this.onWebviewRef}
source={{uri: this.props.data[0]['url']}}
style={{
width: '100%',
height: '100%',
}}
startInLoadingState={true}
injectedJavaScript={this.props.data[0]['customJS']}
javaScriptEnabled={true}
renderLoading={this.getRenderLoading}
/>
);
}
}
export default withTheme(WebViewScreen);

View file

@ -1,10 +0,0 @@
export default {
machineStates: {
"TERMINE": "0",
"DISPONIBLE": "1",
"EN COURS": "2",
"HS": "3",
"ERREUR": "4"
},
};

View file

@ -1,25 +0,0 @@
import i18n from "i18n-js";
export default class Update {
static number = 5;
static icon = 'surround-sound-2-0';
static instance: Update | null = null;
constructor() {
this.title = i18n.t('intro.updateSlide.title');
this.description = i18n.t('intro.updateSlide.text');
}
/**
* Get this class instance or create one if none is found
* @returns {Update}
*/
static getInstance(): Update {
return Update.instance === null ?
Update.instance = new Update() :
Update.instance;
}
};

37
eject.txt Normal file
View file

@ -0,0 +1,37 @@
Your git working tree is clean
To revert the changes after this command completes, you can run the following:
git clean --force && git reset --hard
✔ App configuration (app.json) updated.
✔ Created native project directories (./ios and ./android) and updated .gitignore.
✔ Updated package.json and added index.js entry point for iOS and Android.
✔ Installed JavaScript dependencies.
⚠️ iOS configuration applied with warnings that should be fixed:
- icon: This is the image that your app uses on your home screen, you will need to configure it manually.
- splash: This is the image that your app uses on the loading screen, we recommend installing and using expo-splash-screen. Details. (https://github.com/expo/expo/blob/master/packages/expo-splash-screen/README.md)
⚠️ Android configuration applied with warnings that should be fixed:
- splash: This is the image that your app uses on the loading screen, we recommend installing and using expo-splash-screen. Details. (https://github.com/expo/expo/blob/master/packages/expo-splash-screen/README.md)
- icon: This is the image that your app uses on your home screen, you will need to configure it manually.
- android.adaptiveIcon: This is the image that your app uses on your home screen, you will need to configure it manually.
✔ Skipped installing CocoaPods because operating system is not on macOS.
⚠️ Your app includes 3 packages that require additional setup in order to run:
- expo-camera: https://github.com/expo/expo/tree/master/packages/expo-camera
- react-native-appearance: https://github.com/expo/react-native-appearance
- react-native-webview: https://github.com/react-native-community/react-native-webview
➡️ Next steps
- 👆 Review the logs above and look for any warnings (⚠️ ) that might need follow-up.
- 💡 You may want to run npx @react-native-community/cli doctor to help install any tools that your app may need to run your native projects.
- 🍫 When CocoaPods is installed, initialize the project workspace: cd ios && pod install
- 🔑 Download your Android keystore (if you're not sure if you need to, just run the command and see): expo fetch:android:keystore
- 🚀 expo-updates (https://github.com/expo/expo/blob/master/packages/expo-updates/README.md) has been configured in your project. Before you do a release build, make sure you run expo publish. Learn more. (https://expo.fyi/release-builds-with-expo-updates)
☑️ When you are ready to run your project
To compile and run your project in development, execute one of the following commands:
- npm run ios
- npm run android
- npm run web

4
index.js Normal file
View file

@ -0,0 +1,4 @@
import {AppRegistry} from 'react-native';
import App from './App';
AppRegistry.registerComponent('main', () => App);

View file

@ -0,0 +1,498 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
074F4BDC2432833400BDB9FE /* app.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 07C2E6E4243282B30028AF0A /* app.bundle */; };
074F4BDD2432833400BDB9FE /* app.manifest in Resources */ = {isa = PBXBuildFile; fileRef = 07C2E6E3243282B30028AF0A /* app.manifest */; };
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
3DE4DAD41476765101945408 /* libPods-Campus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D43FF9D506E70904424FA7E9 /* libPods-Campus.a */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
07C2E6E3243282B30028AF0A /* app.manifest */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = app.manifest; path = Campus/Supporting/app.manifest; sourceTree = "<group>"; };
07C2E6E4243282B30028AF0A /* app.bundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = app.bundle; path = Campus/Supporting/app.bundle; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* application.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = application.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Campus/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Campus/AppDelegate.m; sourceTree = "<group>"; };
13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Campus/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Campus/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Campus/main.m; sourceTree = "<group>"; };
2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };
3B47C5AFCB8BDE514B7D1AC6 /* Pods-Campus.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Campus.debug.xcconfig"; path = "Target Support Files/Pods-Campus/Pods-Campus.debug.xcconfig"; sourceTree = "<group>"; };
8AC623DBF3A3E2CB072F81F2 /* Pods-Campus.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Campus.release.xcconfig"; path = "Target Support Files/Pods-Campus/Pods-Campus.release.xcconfig"; sourceTree = "<group>"; };
D43FF9D506E70904424FA7E9 /* libPods-Campus.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Campus.a"; sourceTree = BUILT_PRODUCTS_DIR; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3DE4DAD41476765101945408 /* libPods-Campus.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
13B07FAE1A68108700A75B9A /* Campus */ = {
isa = PBXGroup;
children = (
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.m */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
13B07FB61A68108700A75B9A /* Info.plist */,
13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
13B07FB71A68108700A75B9A /* main.m */,
07C2E6E4243282B30028AF0A /* app.bundle */,
07C2E6E3243282B30028AF0A /* app.manifest */,
);
name = Campus;
sourceTree = "<group>";
};
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
2D16E6891FA4F8E400B85C8A /* libReact.a */,
D43FF9D506E70904424FA7E9 /* libPods-Campus.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
72E5486571395D51695C2A02 /* Pods */ = {
isa = PBXGroup;
children = (
3B47C5AFCB8BDE514B7D1AC6 /* Pods-Campus.debug.xcconfig */,
8AC623DBF3A3E2CB072F81F2 /* Pods-Campus.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
);
name = Libraries;
sourceTree = "<group>";
};
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
13B07FAE1A68108700A75B9A /* Campus */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
72E5486571395D51695C2A02 /* Pods */,
);
indentWidth = 2;
sourceTree = "<group>";
tabWidth = 2;
usesTabs = 0;
};
83CBBA001A601CBA00E9B192 /* Products */ = {
isa = PBXGroup;
children = (
13B07F961A680F5B00A75B9A /* application.app */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
13B07F861A680F5B00A75B9A /* Campus */ = {
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Campus" */;
buildPhases = (
F8BC737F2AD7A05944D9E2A1 /* [CP] Check Pods Manifest.lock */,
FD4C38642228810C00325AF5 /* Start Packager */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle Expo Assets */,
58CDB7AB66969EE82AA3E3B0 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = Campus;
productName = "Hello World";
productReference = 13B07F961A680F5B00A75B9A /* application.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
83CBB9F71A601CBA00E9B192 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 940;
ORGANIZATIONNAME = Facebook;
TargetAttributes = {
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = 6JA7CLNUV6;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Campus" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
mainGroup = 83CBB9F61A601CBA00E9B192;
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
13B07F861A680F5B00A75B9A /* Campus */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
13B07F8E1A680F5B00A75B9A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
074F4BDC2432833400BDB9FE /* app.bundle in Resources */,
074F4BDD2432833400BDB9FE /* app.manifest in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
00DD1BFF1BD5951E006B06BC /* Bundle Expo Assets */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Bundle Expo Assets";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "../node_modules/react-native/scripts/react-native-xcode.sh\n";
};
58CDB7AB66969EE82AA3E3B0 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Campus/Pods-Campus-resources.sh",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Feather.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Foundation.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Octicons.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Zocial.ttf",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EvilIcons.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Feather.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Brands.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Regular.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Solid.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Fontisto.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Foundation.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Ionicons.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialCommunityIcons.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialIcons.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Octicons.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SimpleLineIcons.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Zocial.ttf",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Campus/Pods-Campus-resources.sh\"\n";
showEnvVarsInLog = 0;
};
F8BC737F2AD7A05944D9E2A1 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Campus-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
FD4C38642228810C00325AF5 /* Start Packager */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Start Packager";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ \"$CONFIGURATION\" == \"Release\" ]; then\n exit 0;\nfi\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
13B07F871A680F5B00A75B9A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
13B07FB21A68108700A75B9A /* Base */,
);
name = LaunchScreen.xib;
path = Campus;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3B47C5AFCB8BDE514B7D1AC6 /* Pods-Campus.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Campus/application.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 6JA7CLNUV6;
INFOPLIST_FILE = Campus/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.0.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = fr.amicaleinsat.application;
PRODUCT_NAME = application;
PROVISIONING_PROFILE_SPECIFIER = "";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 8AC623DBF3A3E2CB072F81F2 /* Pods-Campus.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Campus/application.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = 6JA7CLNUV6;
INFOPLIST_FILE = Campus/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.0.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = fr.amicaleinsat.application;
PRODUCT_NAME = application;
PROVISIONING_PROFILE_SPECIFIER = "";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
83CBBA201A601CBA00E9B192 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = Campus/application.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = fr.amicaleinsat.application;
PRODUCT_NAME = application;
SDKROOT = iphoneos;
};
name = Debug;
};
83CBBA211A601CBA00E9B192 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = Campus/application.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = fr.amicaleinsat.application;
PRODUCT_NAME = application;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Campus" */ = {
isa = XCConfigurationList;
buildConfigurations = (
13B07F941A680F5B00A75B9A /* Debug */,
13B07F951A680F5B00A75B9A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Campus" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83CBBA201A601CBA00E9B192 /* Debug */,
83CBBA211A601CBA00E9B192 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
}

View file

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0940"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
BuildableName = "libReact.a"
BlueprintName = "React"
ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "application.app"
BlueprintName = "Campus"
ReferencedContainer = "container:Campus.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "CampusTests.xctest"
BlueprintName = "CampusTests"
ReferencedContainer = "container:Campus.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "application.app"
BlueprintName = "Campus"
ReferencedContainer = "container:Campus.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "CampusTests.xctest"
BlueprintName = "CampusTests"
ReferencedContainer = "container:Campus.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "application.app"
BlueprintName = "Campus"
ReferencedContainer = "container:Campus.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "application.app"
BlueprintName = "Campus"
ReferencedContainer = "container:Campus.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

16
ios/Campus/AppDelegate.h Normal file
View file

@ -0,0 +1,16 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
#import <React/RCTBridgeDelegate.h>
#import <UserNotifications/UNUserNotificationCenter.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, UNUserNotificationCenterDelegate>
@property (nonatomic, strong) UIWindow *window;
@end

89
ios/Campus/AppDelegate.m Normal file
View file

@ -0,0 +1,89 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTLinkingManager.h>
#import "RNSplashScreen.h"
#import <RNCPushNotificationIOS.h>
#import <UserNotifications/UserNotifications.h>
@implementation AppDelegate
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [RCTLinkingManager application:application openURL:url options:options];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"main" initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
// Define UNUserNotificationCenter
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
[RNSplashScreen show];
return YES;
}
//Called when a notification is delivered to a foreground app.
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
}
// Required to register for notifications
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
[RNCPushNotificationIOS didRegisterUserNotificationSettings:notificationSettings];
}
// Required for the register event.
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
[RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
// Required for the notification event. You must call the completion handler after handling the remote notification.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
[RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
// Required for the registrationError event.
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
[RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
}
// Required for the localNotification event.
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
[RNCPushNotificationIOS didReceiveLocalNotification:notification];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
#ifdef DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
@end

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina3_5" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="320" height="460"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchScreen" translatesAutoresizingMaskIntoConstraints="NO" id="MEu-9j-Yk9">
<rect key="frame" x="0.0" y="0.0" width="320" height="440"/>
</imageView>
</subviews>
<color key="backgroundColor" red="0.74509803921568629" green="0.082352941176470587" blue="0.13333333333333333" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="MEu-9j-Yk9" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="topMargin" id="JBv-Ns-A6x"/>
<constraint firstItem="MEu-9j-Yk9" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="JNO-FD-uRI"/>
<constraint firstItem="MEu-9j-Yk9" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="KdP-HF-t4U"/>
<constraint firstItem="MEu-9j-Yk9" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="LNb-Oe-Px1"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<modalPageSheetSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="546.37681159420299" y="453.26086956521743"/>
</view>
</objects>
<resources>
<image name="LaunchScreen" width="682.66668701171875" height="200"/>
</resources>
</document>

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View file

@ -0,0 +1,62 @@
{
"images" : [
{
"filename" : "40.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "60.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "58.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "87.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "80.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "120-1.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "120.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "180.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "1024.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View file

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "splash.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

79
ios/Campus/Info.plist Normal file
View file

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Campus</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>campus-insat</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>FacebookAdvertiserIDCollectionEnabled</key>
<false/>
<key>FacebookAutoInitEnabled</key>
<false/>
<key>FacebookAutoLogAppEventsEnabled</key>
<false/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSCameraUsageDescription</key>
<string>Allow Campus to use the camera</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UIUserInterfaceStyle</key>
<string>Automatic</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIAppFonts</key>
<array>
<string>MaterialCommunityIcons.ttf</string>
</array>
</dict>
</plist>

View file

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>

16
ios/Campus/main.m Normal file
View file

@ -0,0 +1,16 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

49
ios/Podfile Normal file
View file

@ -0,0 +1,49 @@
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'Campus' do
rnPrefix = "../node_modules/react-native"
# React Native and its dependencies
pod 'FBLazyVector', :path => "#{rnPrefix}/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "#{rnPrefix}/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "#{rnPrefix}/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "#{rnPrefix}/Libraries/TypeSafety"
pod 'React', :path => "#{rnPrefix}/"
pod 'React-Core', :path => "#{rnPrefix}/"
pod 'React-CoreModules', :path => "#{rnPrefix}/React/CoreModules"
pod 'React-RCTActionSheet', :path => "#{rnPrefix}/Libraries/ActionSheetIOS"
pod 'React-RCTAnimation', :path => "#{rnPrefix}/Libraries/NativeAnimation"
pod 'React-RCTBlob', :path => "#{rnPrefix}/Libraries/Blob"
pod 'React-RCTImage', :path => "#{rnPrefix}/Libraries/Image"
pod 'React-RCTLinking', :path => "#{rnPrefix}/Libraries/LinkingIOS"
pod 'React-RCTNetwork', :path => "#{rnPrefix}/Libraries/Network"
pod 'React-RCTSettings', :path => "#{rnPrefix}/Libraries/Settings"
pod 'React-RCTText', :path => "#{rnPrefix}/Libraries/Text"
pod 'React-RCTVibration', :path => "#{rnPrefix}/Libraries/Vibration"
pod 'React-Core/RCTWebSocket', :path => "#{rnPrefix}/"
pod 'React-Core/DevSupport', :path => "#{rnPrefix}/"
pod 'React-cxxreact', :path => "#{rnPrefix}/ReactCommon/cxxreact"
pod 'React-jsi', :path => "#{rnPrefix}/ReactCommon/jsi"
pod 'React-jsiexecutor', :path => "#{rnPrefix}/ReactCommon/jsiexecutor"
pod 'React-jsinspector', :path => "#{rnPrefix}/ReactCommon/jsinspector"
pod 'ReactCommon/jscallinvoker', :path => "#{rnPrefix}/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "#{rnPrefix}/ReactCommon"
pod 'Yoga', :path => "#{rnPrefix}/ReactCommon/yoga"
pod 'DoubleConversion', :podspec => "#{rnPrefix}/third-party-podspecs/DoubleConversion.podspec"
pod 'glog', :podspec => "#{rnPrefix}/third-party-podspecs/glog.podspec"
pod 'Folly', :podspec => "#{rnPrefix}/third-party-podspecs/Folly.podspec"
# Other native modules
# react-native-cli autolinking
use_native_modules!
# Permissions
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications.podspec"
pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
end

17
metro.config.js Normal file
View file

@ -0,0 +1,17 @@
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};

View file

@ -1,207 +0,0 @@
// @flow
import * as React from 'react';
import {createDrawerNavigator} from '@react-navigation/drawer';
import TabNavigator from './MainTabNavigator';
import SettingsScreen from '../screens/SettingsScreen';
import AboutScreen from '../screens/About/AboutScreen';
import AboutDependenciesScreen from '../screens/About/AboutDependenciesScreen';
import SelfMenuScreen from '../screens/SelfMenuScreen';
import AvailableRoomScreen from "../screens/Websites/AvailableRoomScreen";
import BibScreen from "../screens/Websites/BibScreen";
import DebugScreen from '../screens/About/DebugScreen';
import Sidebar from "../components/Sidebar";
import {createStackNavigator, TransitionPresets} from "@react-navigation/stack";
import HeaderButton from "../components/HeaderButton";
import i18n from "i18n-js";
const defaultScreenOptions = {
gestureEnabled: true,
cardOverlayEnabled: true,
...TransitionPresets.SlideFromRightIOS,
};
function getDrawerButton(navigation: Object) {
return (
<HeaderButton icon={'menu'} onPress={navigation.openDrawer}/>
);
}
const AboutStack = createStackNavigator();
function AboutStackComponent() {
return (
<AboutStack.Navigator
initialRouteName="AboutScreen"
headerMode="float"
screenOptions={defaultScreenOptions}
>
<AboutStack.Screen
name="AboutScreen"
component={AboutScreen}
options={({navigation}) => {
const openDrawer = getDrawerButton.bind(this, navigation);
return {
title: i18n.t('screens.about'),
headerLeft: openDrawer
};
}}
/>
<AboutStack.Screen
name="AboutDependenciesScreen"
component={AboutDependenciesScreen}
options={{
title: i18n.t('aboutScreen.libs')
}}
/>
<AboutStack.Screen
name="DebugScreen"
component={DebugScreen}
options={{
title: i18n.t('aboutScreen.debug')
}}
/>
</AboutStack.Navigator>
);
}
const SettingsStack = createStackNavigator();
function SettingsStackComponent() {
return (
<SettingsStack.Navigator
initialRouteName="SettingsScreen"
headerMode="float"
screenOptions={defaultScreenOptions}
>
<SettingsStack.Screen
name="SettingsScreen"
component={SettingsScreen}
options={({navigation}) => {
const openDrawer = getDrawerButton.bind(this, navigation);
return {
title: i18n.t('screens.settings'),
headerLeft: openDrawer
};
}}
/>
</SettingsStack.Navigator>
);
}
const SelfMenuStack = createStackNavigator();
function SelfMenuStackComponent() {
return (
<SelfMenuStack.Navigator
initialRouteName="SelfMenuScreen"
headerMode="float"
screenOptions={defaultScreenOptions}
>
<SelfMenuStack.Screen
name="SelfMenuScreen"
component={SelfMenuScreen}
options={({navigation}) => {
const openDrawer = getDrawerButton.bind(this, navigation);
return {
title: i18n.t('screens.menuSelf'),
headerLeft: openDrawer
};
}}
/>
</SelfMenuStack.Navigator>
);
}
const AvailableRoomStack = createStackNavigator();
function AvailableRoomStackComponent() {
return (
<AvailableRoomStack.Navigator
initialRouteName="AvailableRoomScreen"
headerMode="float"
screenOptions={defaultScreenOptions}
>
<AvailableRoomStack.Screen
name="AvailableRoomScreen"
component={AvailableRoomScreen}
options={({navigation}) => {
const openDrawer = getDrawerButton.bind(this, navigation);
return {
title: i18n.t('screens.availableRooms'),
headerLeft: openDrawer
};
}}
/>
</AvailableRoomStack.Navigator>
);
}
const BibStack = createStackNavigator();
function BibStackComponent() {
return (
<BibStack.Navigator
initialRouteName="BibScreen"
headerMode="float"
screenOptions={defaultScreenOptions}
>
<BibStack.Screen
name="BibScreen"
component={BibScreen}
options={({navigation}) => {
const openDrawer = getDrawerButton.bind(this, navigation);
return {
title: i18n.t('screens.bib'),
headerLeft: openDrawer
};
}}
/>
</BibStack.Navigator>
);
}
const Drawer = createDrawerNavigator();
function getDrawerContent(props) {
return <Sidebar {...props}/>
}
export default function DrawerNavigator() {
return (
<Drawer.Navigator
initialRouteName={'Main'}
headerMode={'float'}
backBehavior={'initialRoute'}
drawerType={'front'}
drawerContent={(props) => getDrawerContent(props)}
screenOptions={defaultScreenOptions}
>
<Drawer.Screen
name="Main"
component={TabNavigator}
>
</Drawer.Screen>
<Drawer.Screen
name="SettingsScreen"
component={SettingsStackComponent}
/>
<Drawer.Screen
name="AboutScreen"
component={AboutStackComponent}
/>
<Drawer.Screen
name="SelfMenuScreen"
component={SelfMenuStackComponent}
/>
<Drawer.Screen
name="AvailableRoomScreen"
component={AvailableRoomStackComponent}
/>
<Drawer.Screen
name="BibScreen"
component={BibStackComponent}
/>
</Drawer.Navigator>
);
}

Some files were not shown because too many files have changed in this diff Show more