Skip to content
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

Closed
wants to merge 17 commits into from
Closed

Conversation

datner
Copy link
Contributor

@datner datner commented Feb 4, 2021

theres a lot going on, so take your time

package.json Outdated Show resolved Hide resolved
Comment on lines +41 to +44
@media screen and (max-width: 1023px) {
--text-scale-ratio: 0.85;
}
@media screen and (max-width: 768px) {
@media screen and (max-width: 767px) {
Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for what?

Copy link
Contributor

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

Copy link
Contributor Author

@datner datner Feb 5, 2021

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

Copy link
Contributor

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 😬

Copy link
Contributor Author

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 😅 😆

Copy link
Contributor Author

@datner datner Feb 5, 2021

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

Copy link
Contributor

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

Copy link
Contributor Author

@datner datner Feb 7, 2021

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

Copy link
Contributor

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?

@JacobMGEvans JacobMGEvans added Status: In Progress 🚧 Currently taking out the trash mobs or cleaning up the dungeon Type: Feature New Feature and/or functionality - significant code rewrite or additions labels Feb 4, 2021
@JacobMGEvans JacobMGEvans linked an issue Feb 4, 2021 that may be closed by this pull request
@@ -1,52 +1,48 @@
import { useState, useEffect } from 'react'
import firestore from '#utils/useFirestore'
import firestore from '#utils/firestore'
Copy link
Member

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?

Copy link
Contributor Author

@datner datner Feb 5, 2021

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Contributor

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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,7 +1,7 @@
import firebase from 'firebase/app'
import 'firebase/firestore'

const firebaseConfig = {
export const firebaseConfig = {
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Contributor Author

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!

Copy link
Contributor

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

Suggested change
export const firebaseConfig = {
const firebaseConfig = {

src/utils/useCollection/index.ts Show resolved Hide resolved
Yuval Datner added 4 commits February 5, 2021 11:32
also remove .DS_Store stuff
it's mostly for personal ref stuff
note, it's hidden for mobile because theres no design
@datner datner marked this pull request as ready for review February 5, 2021 10:00
@@ -1,4 +1,6 @@
.snowpack
.vscode/
Copy link
Contributor

@nobrayner nobrayner Feb 5, 2021

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

Copy link
Contributor Author

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

Comment on lines +44 to 48
<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>
)
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor

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? 😅

Copy link
Contributor Author

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

Comment on lines +41 to +44
@media screen and (max-width: 1023px) {
--text-scale-ratio: 0.85;
}
@media screen and (max-width: 768px) {
@media screen and (max-width: 767px) {
Copy link
Contributor

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 😬

src/styles/globalStyles.ts Show resolved Hide resolved
@@ -7,7 +7,7 @@ interface UserStats {
commits: number
}

interface ViewRaidData {
interface RaidStats {
Copy link
Contributor

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 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Abandoned Status: In Progress 🚧 Currently taking out the trash mobs or cleaning up the dungeon Status: Pending ⏳ Type: Feature New Feature and/or functionality - significant code rewrite or additions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All Raids Screen
4 participants