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

conditional disable button #132

Merged
merged 3 commits into from
Dec 9, 2021

Conversation

phoenixthefirebird
Copy link
Contributor

Description

conditionally disable cursor for live portal

Other considerations

@panjenny0

@github-actions
Copy link

github-actions bot commented Nov 16, 2021

Visit the preview URL for this PR (updated for commit bc911e6):

https://nwplus-io--pr132-phoenix-live-portal-beb8lkcd.web.app

(expires Mon, 29 Nov 2021 01:20:15 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Comment on lines 155 to 159
${(p) =>
p.disabled &&
`&:hover {
cursor: not-allowed;
}
}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

I took a look at the preview link and the button is still disabled. A few suggestions:

  • there could be a race condition between when the isLive flag is set and when the LivePortalButton is rendered. I suggest setting isLive to null by default in the useState, then only rendering the LivePortalButton when isLive has been set (i.e. {isLive !== null && <LivePortalButton ... />})
  • a side note: livePortalLink is undefined when I run your branch locally - where is this collection being stored? might want to check if this is a field or a collection and if we're fetching from the right place.
  • minor UX enhancement: move the conditional p.disabled inside the hover pseudo class. For disabled=true, set cursor = not-allowed, otherwise set it to pointer
    • (i.e. p.disabled ? 'not-allowed' : 'pointer'

Copy link
Contributor

Choose a reason for hiding this comment

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

Lmk if you need any clarification. Also feel free to ping me if you want to pair on this!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • live portal button is now only rendered when isLive is pulled from firebase
  • livePortalLink no longer exists and I'll address this in another CMS ticket CMS: Add field to modify live portal link #133
  • conditionally change the pointer style done

Copy link
Contributor

@kevin-zou kevin-zou left a comment

Choose a reason for hiding this comment

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

Lgtm! Thanks for setting this up!

@phoenixthefirebird phoenixthefirebird merged commit 3b9a150 into main Dec 9, 2021
@phoenixthefirebird phoenixthefirebird deleted the phoenix/live-portal-button-style branch December 9, 2021 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants