-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththoughts_while_coding.txt
47 lines (36 loc) · 3.09 KB
/
thoughts_while_coding.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Just a file for me to save any thoughts that pop up that I might want to reference later.
======================
-------*
5/13/21
- Maybe I can check for a 401 status code and redirect user to login page after every request
- I don't need to authenticate users when they enter a page. Just authenticate them on the server. So in admin, no need to auto-login to check anything. If they send a request, auth them. If they aren't admin, reject request.
- Could theoretically create a set of status code handler methods that always jump the user back to login if they ever receive 401
-------*
5/12/21
- Need to implement a logout fetch request that deletes the user's token from the server when they log out.
-------*
5/11/21
* If a user visits the robots page without being logged in, clicking the vote button should trigger a modal that asks them to please log in.
* When you vote, it should save information saying that you've already voted, so you can't vote multiple times for the same robot. That data should persist. Probably save it in context.
* Get rid of the RobotGridItem component. It's excessive.
- I want to create a PseudoElement component that also exports a generatePseudoElement() method. It should take two numbers as args. Numbers will indicate the number to divide by and the number of elements being shown.
- Some refactoring thoughts to consider:
* Change all components from function component() to const component = ()=>{}
* Get rid of all those temporary style props on the components. Turn them into classes.
* Consider storing your object containing your classes in a separate js file. The makestyles hook
still needs to be called within the component using the classes, but it can be passed an object
imported from an external js module
* Delete all semicolons
* Clean up the imports
-------*
5/9/21
- I can reduce repetitive styling code by wrapping my the child style object in a function that takes the parent style object as a parameter.
* Maybe make an object within the styles file, and a switch statement. Export a function that takes a parameter that decides what contents of that object. Use that object's properties to redefine the styles.
-------*
5/8/2021
- Might be able to add a dark theme if there's time.
- I didn't realize elements of hte figma design were done with what appears to be the assumption that Material UI Textfields would be used. I could be wrong, but it does seem like if I hadn't used material, I would have had a harder time replicating the input with the label breaking the border in the top left.
- Not sure if pixel-perfect recreation is necessary, but I'm trying my hardest to do it.
- Overriding certain Material styles might be very finicky, so I'll save them for later to keep up momentum.
- I'd like to explore making multiple themes to reduce repeated styling code, but on a limited time constraint I'll have to put that at the back of the queue.
- I may not need to calculate percentages too much. It's possible the hard numbers provided in the figma design are good enough. But I'll try to make percentages work for maximum responsiveness.