-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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; | ||
/** | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing doumentation
console.log("SpeechBubble"); | ||
console.log(child); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove console.log statements
/** | ||
* UI component for displaying a DangerAction | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
<> | ||
{Children.map(children, (child) => { | ||
if (!isValidElement(child)) return null; | ||
return child; | ||
})} | ||
</> |
There was a problem hiding this comment.
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?
className={`w-sm${ | ||
writePermission | ||
? "cursor-pointer text-kiokuDarkBlue hover:scale-110" | ||
: "text-gray-400 hover:cursor-not-allowed" | ||
} ${showTutorial ? "animate-bounce" : ""} flex-none | ||
transition |
There was a problem hiding this comment.
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?
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; | ||
} | ||
}); |
There was a problem hiding this comment.
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!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use lingui functions here
/** | ||
* UI component for displaying a DangerAction | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
<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 | ||
" | ||
> |
There was a problem hiding this comment.
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?
Description
This PR adds the placeholder component and speech bubble component.
Resolved Issues
resolves #249