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

Toolbar is hidden while publishing an article #682

Merged

Conversation

danboyce92
Copy link
Contributor

@danboyce92 danboyce92 commented Jan 2, 2024

✨ Codu Pull Request 💻

Codu Logo

Pull Request details:

This PR is in response to issue #505

In this PR I added a piece of state 'toolbarVis' in the useCreatePage hook. From there I had it imported into the alpha/new client.tsx where it was passed down as props into the editor component and from there it was passed into the Toolbar component. It is used in the Toolbar component to swap the css class whenever the 'open' state is changed.

There is an additional class added to the bottom of the Toolbar.module.css called .hide
which changes the visibility to hidden;

The 'open' state is monitored in the alpha/new client.tsx with an additional useEffect which changes the state of toolbarVis depending on if the publish button has been clicked or not.

Any Breaking changes:

None as far as I'm aware everything seems to be working fine.
I'm aware it's probably not ideal passing state through multiple components before it gets to where it's needed as it can get messy fast. Usually I would use a redux store. If there is a simpler solution please let me know and I'll get to work.

Associated Screenshots:

pr1
pr2

Copy link

vercel bot commented Jan 2, 2024

@danboyce92 is attempting to deploy a commit to the Codú Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

github-actions bot commented Jan 2, 2024

Hello @danboyce92, thanks for opening your first Pull Request. The maintainers will review this Pull Request and provide feedback as soon as possible. Keep up the great work!

Copy link

vercel bot commented Jan 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
codu ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 9:23am

Copy link
Contributor

@NiallJoeMaher NiallJoeMaher left a comment

Choose a reason for hiding this comment

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

This works great but there could be an easier solution if you don't mind the change request? If you don't have time let me know and I'll merge it and open up an issue with this comment.

If you make the toolbar have a lower z-index we might avoid all the logic. I'm not sure how we do that off the top of my head. Here are the results by just toggling z-index:

Screenshot 2024-01-02 at 21 59 44
Screenshot 2024-01-02 at 21 59 51

If this proves too difficult here's a nuclear option:
I'm also open to removing the fixed property as this toolbar is temporary until we have the new toolbar which will open when you highlight text like this:
Showing a toolbar on hover
I'm playing with designs here https://www.figma.com/file/yKc7ind3lHUTpqkjTePy1N/codu.co?type=design&node-id=0%3A1&mode=design&t=ZrC8BZjxWoPsnPAn-1

@danboyce92
Copy link
Contributor Author

Yeah that z-index approach is way simpler, with less mess! Made the change there in the second commit. Good stuff!

Copy link
Contributor

@NiallJoeMaher NiallJoeMaher left a comment

Choose a reason for hiding this comment

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

LGTM! 🌮

@NiallJoeMaher NiallJoeMaher merged commit c813672 into codu-code:develop Jan 3, 2024
3 checks passed
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.

2 participants