introduce the getEmojiKeyboardPosition function to reaction-message-utils
getEmojiKeyboardPosition will try to find the best position to place the emoji keyboard. Here is how I ranked the positions of the emoji keyboard:
- The best position is to place the emoji keyboard to the right/left of the tooltip where it doesn't cover the message being reacted to. (The first two conditional statements handle this case)
- The next best position is to place the emoji keyboard at the top of the tooltip. I ranked the top position over the bottom position purely out of personal preference, but if we want to switch, we can do that. (The third conditional statement handles this case)
- The next best position is to place the emoji keyboard at the bottom of the tooltip (The fourth conditional statement handles this case)
- If all fails, we can resort to placing the emoji keyboard to the left/right of the tooltip, where it does cover the message being reacted to. This is not ideal, so is ranked last, but is better than having the emoji keyboard overflow off of the screen.