Methods
App() → {JSX.Element}
Root component of the app.
Models and users data is loaded from the database and stored in the Redux store.
Returns:
The app
- Type
- JSX.Element
AppProvider() → {JSX.Element}
The app is wrapped in a Redux Provider so that the Redux store can be accessed by any component.
Returns:
The app wrapped in a Redux Provider
- Type
- JSX.Element
Event(eventData) → {JSX.Element}
Component used to display event information.
Parameters:
| Name | Type | Description |
|---|---|---|
eventData |
Object |
- Source:
Returns:
a component that displays the event information
- Type
- JSX.Element
GetEvents() → {Promise}
Fetches InvolveU API to get all event data.
- Source:
Returns:
response from server
- Type
- Promise
GetItems() → {Promise}
Fetches InvolveU API to get all item data.
- Source:
Returns:
response from server
- Type
- Promise
GetRefreshToken(ref) → {Promise}
Posts refresh token to server to fetch a new access token. Refresh tokens are temporary and used
for the user to stay signed in.
Parameters:
| Name | Type | Description |
|---|---|---|
ref |
JSON | refresh token to be posted to server |
- Source:
Returns:
response from server
- Type
- Promise
GetUsers() → {Promise}
Fetches InvolveU API to get all user data.
- Source:
Returns:
response from server
- Type
- Promise
Prize(navigation) → {JSX.Element}
Component displays the prize store icon. Can be clicked to navigate to the prize store.
Parameters:
| Name | Type | Description |
|---|---|---|
navigation |
Object | the navigation prop passed to the screen |
- Source:
Returns:
the prize component
- Type
- JSX.Element
PrizeItem(itemName, points, image, userPoints) → {JSX.Element}
Component to display a prize item.
Parameters:
| Name | Type | Description |
|---|---|---|
itemName |
String | The name of the prize item |
points |
Number | The cost of the prize item |
image |
String | The image of the prize item |
userPoints |
Number | The user's current points |
- Source:
Returns:
A component containing the prize item
- Type
- JSX.Element
Profile(user) → {JSX.Element}
Displays the user's username and email.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
Object | the user object |
- Source:
Returns:
the profile component
- Type
- JSX.Element
Rank(user, navigation, idx, gradesLength, allGradesLength, allGradesIdx) → {JSX.Element}
Component displays the user's rank among their grade and all users.
Can be clicked to navigate to the leaderboard.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
Object | the user's data |
navigation |
Object | the navigation prop passed to the screen |
idx |
Number | the user's rank among their grade |
gradesLength |
Number | the number of users in the user's grade |
allGradesLength |
Number | the number of users in the school |
allGradesIdx |
Number | the user's rank among all users |
- Source:
Returns:
the rank component
- Type
- JSX.Element
Separator() → {JSX.Element}
Separator component. Simply displays a horizontal line.
- Source:
Returns:
the separator component
- Type
- JSX.Element
Summary(user) → {JSX.Element}
Component displays welcome and user's points.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
Object | the user's data |
- Source:
Returns:
the summary component
- Type
- JSX.Element
TabNav(navigation) → {JSX.Element}
The tab navigator contains the home, events, and settings screens.
Parameters:
| Name | Type | Description |
|---|---|---|
navigation |
Object | the navigation prop passed to the screen |
- Source:
Returns:
the tab navigator
- Type
- JSX.Element
TermsButton(navigation) → {JSX.Element}
Button that navigates to the term screen.
Parameters:
| Name | Type | Description |
|---|---|---|
navigation |
Object | the navigation object |
- Source:
Returns:
the terms button component
- Type
- JSX.Element
ToggleableContent(option, content) → {JSX.Element}
Uses a TouchableOpacity to display toggleable content.
Parameters:
| Name | Type | Description |
|---|---|---|
option |
String | the text to display on the button |
content |
JSX.Element | the content to display when the button is pressed |
- Source:
Returns:
the toggleable content component
- Type
- JSX.Element
YMDToLong(ymd) → {String}
Converts a YMDDate object to a string in the format "Day, Month Day, Year".
Parameters:
| Name | Type | Description |
|---|---|---|
ymd |
YMDDate | YMDDate object |
- Source:
Returns:
string in the format "Day, Month Day, Year"
- Type
- String
dateToYMD() → {YMDDate}
Converts today's date to a YMDDate object.
- Source:
Returns:
converts today's date to a YMDDdate object
- Type
- YMDDate