Skip to content

Conversation

@wackerow
Copy link
Member

@wackerow wackerow commented Sep 18, 2022

Description

  • Update FeedbackWidget and FeedbackCard using Chakra-UI instead of emotion
  • Patches FeedbackWidget button colors
  • Patches FeedbackWidget to reinitialize component state when changing URL paths
  • Patches FeedbackWidget to default keyboard focus to close button instead of "Yes" answer on widget open
  • Update Nav icons to use IconButton

Related Issue

#6374

@gatsby-cloud
Copy link

gatsby-cloud bot commented Sep 18, 2022

✅ ethereum-org-website-dev deploy preview ready

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

Nicely done @wackerow left a few comments

import React from "react"
import { Button, ButtonProps } from "@chakra-ui/react"

const NakedButton: React.FC<ButtonProps> = ({ children, ...props }) => (
Copy link
Member

Choose a reason for hiding this comment

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

Have you check the ghost variant? https://chakra-ui.com/docs/components/button/usage#button-variants

I think we should remove this component and start using <Button variant="ghost">. Any specific style we want to do on top of the default variant styles, we could add them on the Chakra theme definition as we did with the other variants.

Check the variants key in here.

export interface IProps {
className?: string
}
const FixedDot: React.FC<FixedDotProps> = ({
Copy link
Member

Choose a reason for hiding this comment

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

Just want to mention that there is a Chakra component called IconButton https://chakra-ui.com/docs/components/icon-button that perhaps could be a replacement for this. Not saying that this is in the scope of this PR but perhaps it is a better solution in the long term.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes this component has more changes to come in a separate PR, thanks for noting!

<Footer />
</VisuallyHidden>
<FeedbackWidget />
<FeedbackWidget location={path} />
Copy link
Member

Choose a reason for hiding this comment

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

One common practice to deal with this is to do

<FeedbackWidget key={path} />

that way, the component is going to remount everytime the path change and you will not have to do any manual reset in the inner component logic.

Co-Authored-By: Pablo Pettinari <[email protected]>
@wackerow wackerow marked this pull request as draft September 26, 2022 17:25
@github-actions github-actions bot added the content 🖋️ This involves copy additions or edits label Sep 27, 2022
@wackerow wackerow marked this pull request as ready for review September 28, 2022 14:45
Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

Nice! I think we can still remove some styles from our custom icon variant and fix the markdown semantics on the Languages button.

className={className}
<Flex
id="modal"
ref={containerRef}
Copy link
Member

Choose a reason for hiding this comment

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

I think we should aim to use the Chakra Popover in this component. https://chakra-ui.com/docs/components/popover we will have better a11y and will abstract us for a bunch of things we are doing here (close icon, modal styles, focus trap, etc).

Not saying this should be in the scope of this PR but I'll create a new issue to tackle that after we merge this.

@github-actions github-actions bot added the translation 🌍 This is related to our Translation Program label Nov 10, 2022
Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

Awesome! 🚀

I've just merged dev to fix merge conflicts 👍🏼

@pettinarip pettinarip merged commit 8791994 into dev Nov 15, 2022
@pettinarip pettinarip deleted the feedback-v2 branch November 15, 2022 22:44
@pettinarip pettinarip mentioned this pull request Nov 15, 2022
80 tasks
@minimalsm minimalsm mentioned this pull request Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

archived: chakra-migration content 🖋️ This involves copy additions or edits translation 🌍 This is related to our Translation Program

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants