-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(AllRaids): Add new AllRaids page #78
Conversation
this is to simplify working with firebase
it's still a work in progress, there is no aside and it's unrefactored yet
@media screen and (max-width: 1023px) { | ||
--text-scale-ratio: 0.85; | ||
} | ||
@media screen and (max-width: 768px) { | ||
@media screen and (max-width: 767px) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when using max-width, -1px is required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it should be the other way around.
max-width for tablet size should be 1024 (or 64r/em), min-width would be +1px
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
min width = "as long as the width is higher, these apply" or, px > min-width
max width = "as long as the width is lower than or equal to this number, these apply, or, px =< max-height
therefore, we need to remove an extra-pixel. But don't take my word for it, use chrome devtools and play around with the tablet sizes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd agree with Cody here - a difference of one pixel really won't make a difference... So please use a round number 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what, this is not a matter of opinion lmao, it's the standard viewport of devices, it either works or doesn't, it didn't so I fixed it 😅 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either that, or switch to min-width, like I do in my own components btw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well aware of what max and min width are, and tablet sizes. If I want to change styles for tablet size and down it would be max-width: 1024px
because that is the viewport width of the tablet. If the max width is set to 1023 the styles won't be applied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this is the desired bahavior?
.box {
color: red;
}
@media (max-width: 1024px) {
.box {
color: blue;
}
}
so this is the desired result?
- phone: blue
- tablets: blue
- tablets + 1px: red
- large tablets: red
- laptop: red
- PC: red
I'd think that the result would be:
- phone: blue
- tablets: red
- tablets + 1px: red
- large tablets: red
- laptop: red
- PC: red
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole conversation is a bit pointless now, IMO.
They are just arbitrary numbers... Can we stop bikeshedding now? Thanks 😅 💯
If you look at just Apple tablets, then there isn't even a clear consensus... https://yesviz.com/tablets.php So can we please just pick 1024
to appease my round (rem) number needs?
@@ -1,52 +1,48 @@ | |||
import { useState, useEffect } from 'react' | |||
import firestore from '#utils/useFirestore' | |||
import firestore from '#utils/firestore' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was the naming convention changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not a hook, so the convention did not change, it was fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets make it one then
https://usehooks.com/useFirestoreQuery/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wont block anything from being merged, but can be a TODO for sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this hook is essentially what is implemented in useCollection
logic-wise, I found that there is no use for a generic access to firestore............ for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useCollection is specific, I would rather there is a useFirebase
and is composed in more specific Custom Hooks like useCollection
, useCharacters
, useWhateverFirebaseData
, or whatever. Likely the general Firebase logic was put into useCollection
due to when it was written it being the only Firebase Query
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two query style hooks so far - useDocument
and useCollection
- useCollection can probably be turned into a useFirestoreQuery
hook keeping all the same logic.
useDocument
could then be re-written to utilize useFirestoreQuery
under-the-hood, but I think it will still be a useful abstraction for just grabbing one document by it's id - though I can understand not wanting it at all 😛
@@ -1,5 +1,5 @@ | |||
import { useState, useEffect } from 'react' | |||
import firestore from '#utils/useFirestore' | |||
import firestore from '#utils/firestore' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
https://usehooks.com/useFirestoreQuery/
@@ -1,7 +1,7 @@ | |||
import firebase from 'firebase/app' | |||
import 'firebase/firestore' | |||
|
|||
const firebaseConfig = { | |||
export const firebaseConfig = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't need to be exported... It's intentionally only exposing firestore
- you shouldn't be using the config anywhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
artefacts from when I tried to work with reactfire
, the config shouldn't be committed in the first place if you want to actually discuss this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Firebase documentation the frontend config can be exposed, if you actually want to discuss this. https://firebase.google.com/docs/web/setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: The Firebase config object contains unique, but non-secret identifiers for your Firebase project.
Visit Understand Firebase Projects to learn more about this config object.
I stand corrected!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remove the export, and this would be A-OK for me
export const firebaseConfig = { | |
const firebaseConfig = { |
also remove .DS_Store stuff it's mostly for personal ref stuff
note, it's hidden for mobile because theres no design
@@ -1,4 +1,6 @@ | |||
.snowpack | |||
.vscode/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may not use VS Code, but the majority does
This folder, and the settings file inside, help to provide prompts to VS Code so that we can get consistent behaviour across people using it.
This should NOT be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually changed to vscode to be inline with how you guys work, and some of my extensions there started editing files in .vscode, I can can exclude the specific file that was edited by my instance instead of the entire folder, on it
<p> | ||
{`Strange... I could've sworn the Manticore was here a second ago! Seems | ||
there aren't any Raids right now. Try again later!`} | ||
</p> | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I was referring to by the not found/no items and error state no longer being distinguished.
This is NOT a good error message - this is why it never was one, and was used when the state was 'not-found'. Please add some no items checks, and actually display the error here instead so we maintain + improve functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not-found does not return an error though, it returns an empty array from my tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add a !data.length
check if that is what you mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not-found does not return an error though
Correct. The way you have it currently though, is that when there is an error, you are showing what I had previously as the "data.length === 0" case. Which means the actual error is being suppressed.
If you could add !data.length
checks, and also a short message about there being no data, that would be perfect; combined with rendering the error message in the error state.
I hope I explained better that time? 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, support an empty/not found case aswell
@media screen and (max-width: 1023px) { | ||
--text-scale-ratio: 0.85; | ||
} | ||
@media screen and (max-width: 768px) { | ||
@media screen and (max-width: 767px) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd agree with Cody here - a difference of one pixel really won't make a difference... So please use a round number 😬
@@ -7,7 +7,7 @@ interface UserStats { | |||
commits: number | |||
} | |||
|
|||
interface ViewRaidData { | |||
interface RaidStats { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably rename the file to raidStats.d.ts
while we are at it 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on it
theres a lot going on, so take your time