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

Make qoute approving intuitive #5163

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jennymul
Copy link
Contributor

@jennymul jennymul commented Nov 6, 2024

Description

Remove "Fjern godkjenning" as an option when a qoute is approved. When trying to delete a qoute, remove "Godkjenn" when "Er du sikker?" comes up.

image

  • Changes look good on both light and dark theme.

  • Changes look good with different viewports (mobile, tablet, etc.).

  • Changes look good with slower Internet connections.

  • I have thoroughly tested my changes.

Copy link

vercel bot commented Nov 6, 2024

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
lego-bricks-storybook ⬜️ Ignored (Inspect) Visit Preview Nov 6, 2024 6:53pm

@jennymul jennymul self-assigned this Nov 6, 2024
@github-actions github-actions bot added the review-needed Pull requests that need review label Nov 6, 2024
Copy link
Member

@norbye norbye left a comment

Choose a reason for hiding this comment

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

The deleting variable seems to have about the same behaviour as the new thingy you added - is there any reason you did not use that one instead?

@@ -30,6 +30,7 @@ const Quote = ({
const fetchingEmojis = useAppSelector((state) => state.emojis.fetching);

const [deleting, setDeleting] = useState(false);
const [pippi, setPippi] = useState(true);
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

@ivarnakken ivarnakken left a comment

Choose a reason for hiding this comment

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

Some refactoring needed, but I agree that this can be more intuitive!

{!quote.approved && pippi ? (
<Dropdown.ListItem>
<button onClick={() => dispatch(approve(quote.id))}>
{'Godkjenn'}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{'Godkjenn'}
Godkjenn

{quote.approved ? 'Fjern godkjenning' : 'Godkjenn'}
</button>
</Dropdown.ListItem>
{!quote.approved && pippi ? (
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{!quote.approved && pippi ? (
{!quote.approved ? (

?

</button>
</Dropdown.ListItem>
) : (
<div></div>
Copy link
Member

Choose a reason for hiding this comment

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

Instead of using a ternary, just use && so that we don't need empty divs like this in the dom

Copy link
Member

Choose a reason for hiding this comment

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

not related to this PR

Copy link
Member

Choose a reason for hiding this comment

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

Again, not relevant to this PR hehe

@ivarnakken ivarnakken added enhancement Pull requests that make enhancements, instead of just purely new features changes-requested Pull requests with requested changes labels Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes-requested Pull requests with requested changes enhancement Pull requests that make enhancements, instead of just purely new features review-needed Pull requests that need review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants