Global

Members

(constant) app

Initialize Firebase
Source:

(constant) auth

Firebase Auth Instance
Source:

(constant) db

Firebase Firestore instance
Source:

(constant) defaultAvailability

Define out here because we don't need to re-define on re-render.
Source:

(constant) estimateSalary

Source:

(constant) fetchRecommendation

Source:

(constant) lightTheme

========= THEME FOR THE APP =========
Source:

(constant) provider

Only want to define once, we don't need to re-define on re-render
Source:

Methods

GlobalSnackbar()

The global snack bar for success, error states
Source:

TradeCard(param0)

Parameters:
Name Type Description
param0 Object
Source:

capitalize(str) → {string}

Parameters:
Name Type Description
str string
Source:
Returns:
Type
string

createNewChat(user1, user2)

Parameters:
Name Type Description
user1
user2
Source:

createNewMessage()

Source:

createUserIfMissing(firebaseUser) → {Promise.<void>}

Creates a default user document in Firestore if it doesn't already exist.
Parameters:
Name Type Description
firebaseUser
Source:
Returns:
Type
Promise.<void>

postTrade(tradeData)

Parameters:
Name Type Description
tradeData
Source:

updateMessage(newMessage)

Parameters:
Name Type Description
newMessage string
Source:

updateTrade(trade, user) → {boolean}

Parameters:
Name Type Description
trade
user
Source:
Returns:
Type
boolean

Type Definitions

AvailabilityObject

Type:
  • object
Properties:
Name Type Description
active boolean
day string
from string
do string
Source:

ChatObject

Type:
  • Object
Properties:
Name Type Description
id string Generated by Firebase.
participant1 ChatParticipant
participant2 ChatParticipant
messages Array.<MessageObject>
status 'active' | 'closed'
Source:

ChatParticipant

Type:
  • Object
Properties:
Name Type Description
displayName string
id string
avatar string
Source:

FirestoreRawData

Type:
  • Object
Properties:
Name Type Description
success boolean Success state of the operation.
data T | null The actual data returned, or null if not available.
error string | null The error itself (non-readable version), if any.
message string Response message intended for the user.
Source:

MessageObject

Type:
  • Object
Properties:
Name Type Description
id string
author ChatParticipant
chatId string
content string
Source:

ProfileObject

Type:
  • object
Properties:
Name Type Description
availability Array.<AvailabilityObject>
phoneNumber string
tradingSkill string
Source:

TradeObject

Type:
  • Object
Properties:
Name Type Description
id String
offererId String
receiverId String
offeredSkill String
requestedSkill String
tradeStatus TradeStatus
message String
Source:

TradeStatus

Type:
  • 'pending' | 'accepted' | 'declined' | 'completed' | 'canceled'
Source:

UserObject

Type:
  • Object
Properties:
Name Type Description
uid string The user's UID
bio string The user's bio?
location string The user's current location
skillsOffered Array.<String> The skills the user is offering
skillsWanted Array.<String> The skills the user is looking for
profile Profile The profile data of the user
rating Number The user's rating
availability Object The availability of the user
profile object
Source: