Pages - Makleido/ChatTestingApp GitHub Wiki

Pages you can find


Page Purpose
Index I didn't make a new page for registration, becouse this is just a testing project for a chat, so the default page also the registration and the Login page
Chats Shows what account you are logged into, shows all users you can chat with, there is a chat window to the right, whenever you choose one of the users in he list the chat will normally appear, and you can start chatting, has a 3 sec timer to send request if there is a new message, can be scrolled, with the logout button you can log out of the account
NotFound Default 404 - Page not found

Chats Page

Methods/Variables Type Purpose
messages IMessageDto[] Messages list to show in chat
messageToSend string Message that is being sent for database
users ICreateUser[] Users list to show
loginName string Logged in user name
openedName string User to chat with
openedChat boolean Represents if a chat is opened to start requests
token string JWT token from localStorage
update method Update textarea value on change
sendMessage method Sends request to server with message for database
showMessage method Shows message boxes in the opened chat
getContacts method Gets all users you can chat with
loadMessages (its in UtilFunctions functional class now) method Generic used to load all messages that is for a chat in a list for showing them
getMessages method Sends request for server for all messages related to the opened chat
getUnreadedOnUpdate method Checks if there is unreaded message from somebody
getLoggedInName method Gets logged in user name
chooseChat method Choose which user you want to chat with
showUsers method Shows users in the list
updateView method Sets scroll to the current bottom in chat
logout method Logs out from account
onEnterPress method Sends message on pressing ENTER from textarea

Index Page

Methods/Variables Type Purpose
registerUser ICreateUser User data for registration
loginUser ICreateUser User data for logging in
message string Message which shows if there is something wrong with credentials for registering
email string Its for message regex check
password string Its for message regex check
emailRegex string/regex Regex
passwRegex string/regex Regex
update method Sets attributes for registerUser and loginUser
checkIfEligible method Regex check
register method Its for registration of a user, takes in name, email, password from useState variables
login method Its for logging in, takes name and password from useState variables
loginMessage string Its for alerting user if something went wrong on login process

Back Home
Home