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

Add Speech Bubble and Placeholder Component #287

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

leonie2003
Copy link
Contributor

Description

This PR adds the placeholder component and speech bubble component.

image image

Resolved Issues

resolves #249

@leonie2003 leonie2003 self-assigned this Apr 24, 2024
@leonie2003 leonie2003 added enhancement New feature or request Frontend Issues related to the Frontend labels Apr 24, 2024
@leonie2003 leonie2003 requested a review from Julian702 April 24, 2024 07:20
@Julian702 Julian702 changed the title Speech Bubble and Placeholder Component Add Speech Bubble and Placeholder Component Apr 24, 2024
@Julian702 Julian702 requested a review from TomRomeo April 24, 2024 07:25
Copy link
Member

@Julian702 Julian702 left a comment

Choose a reason for hiding this comment

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

I really like how the placeholder and tutorials look and feel like :) Great job!

I have some first comments for further improvements:

  • I would like to rename Speech Bubble to Popover
  • Placeholder instead of GenericPlaceholder would be fine
  • Pass the placeholder component to the Deck- and GroupList as placeholder prop instead of children and move check inside the list component

*/
align: "left" | "center" | "right" | string;
/**
* Show
Copy link
Member

Choose a reason for hiding this comment

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

Could be more descriptive :)

*/
children: ReactNode;
/**
*
Copy link
Member

Choose a reason for hiding this comment

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

Missing doumentation

Comment on lines +54 to +55
console.log("SpeechBubble");
console.log(child);
Copy link
Member

Choose a reason for hiding this comment

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

Remove console.log statements

Comment on lines +14 to +16
/**
* UI component for displaying a DangerAction
*/
Copy link
Member

Choose a reason for hiding this comment

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

?

Comment on lines +23 to +28
<>
{Children.map(children, (child) => {
if (!isValidElement(child)) return null;
return child;
})}
</>
Copy link
Member

Choose a reason for hiding this comment

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

Why do we have to check for a valid element and not just return the child?

Comment on lines +80 to +85
className={`w-sm${
writePermission
? "cursor-pointer text-kiokuDarkBlue hover:scale-110"
: "text-gray-400 hover:cursor-not-allowed"
} ${showTutorial ? "animate-bounce" : ""} flex-none
transition
Copy link
Member

Choose a reason for hiding this comment

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

I know it's not part of your PR but could you change this snippet to use clsx instead?

Comment on lines +39 to +58
const parent = Children.map(children, (child) => {
if (
isValidElement(child) &&
typeof child.type !== "string" &&
child.type.name == "SpeechBubbleParent"
) {
return child;
}
});
const content = Children.map(children, (child) => {
if (
isValidElement(child) &&
typeof child.type !== "string" &&
child.type.name == "SpeechBubbleContent"
) {
console.log("SpeechBubble");
console.log(child);
return child;
}
});
Copy link
Member

Choose a reason for hiding this comment

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

Please change this to a single Children.forEach() call and set both variables according to the if statements.

setShowTutorial(false);
}}
showTutorial={showTutorial}
tutorialText="Click here to create a new group!"
Copy link
Member

Choose a reason for hiding this comment

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

Use lingui functions here

Comment on lines +34 to +36
/**
* UI component for displaying a DangerAction
*/
Copy link
Member

Choose a reason for hiding this comment

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

?

Comment on lines +47 to +51
<div {...props} className={className}>
<div
className="flex min-h-[6.5rem] w-full flex-row gap-x-4 rounded-md border-2 border-dashed border-neutral-300 bg-gradient-to-l to-60% p-3 hover:from-neutral-50 sm:min-h-28 md:min-h-32 lg:min-h-32
"
>
Copy link
Member

Choose a reason for hiding this comment

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

Can these two divs be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Frontend Issues related to the Frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create placeholder component
2 participants