-
Notifications
You must be signed in to change notification settings - Fork 123
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
feat: create a reuseable dialog component #181
Merged
mrcoded
merged 14 commits into
hngprojects:dev
from
Adelosoye-dev:feat/49-create-dialog-box-component
Jul 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0a0c964
feat: create a reuseable dialog component
Adelosoye-dev 342b096
feat: create a reuseable dialog component
Adelosoye-dev 6768330
Merge remote-tracking branch 'upstream/dev' into feat/49-create-dialo…
Adelosoye-dev 9579263
Merge branch 'feat/49-create-dialog-box-component' of https://github.…
Adelosoye-dev a17fdf0
fix: resolve merge conflict and lint errors.
Adelosoye-dev f26c40c
Merge branch 'hngprojects:dev' into feat/49-create-dialog-box-component
Adelosoye-dev ee6c96d
Merge branch 'hngprojects:dev' into feat/49-create-dialog-box-component
Adelosoye-dev 856d45e
Merge branch 'hngprojects:dev' into feat/49-create-dialog-box-component
Adelosoye-dev f7571cf
Merge branch 'hngprojects:dev' into feat/49-create-dialog-box-component
Adelosoye-dev de78dab
Merge branch 'hngprojects:dev' into feat/49-create-dialog-box-component
Adelosoye-dev b0e0fe0
feat: create reusable dialog component
Adelosoye-dev e212e57
Merge branch 'hngprojects:dev' into feat/49-create-dialog-box-component
Adelosoye-dev e05a462
Merge branch 'hngprojects:dev' into feat/49-create-dialog-box-component
Adelosoye-dev 4bfd463
chore
Adelosoye-dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { cn } from "../../lib/utils/cn"; | ||
|
||
type DialogProperties = { | ||
headerText: string; | ||
description?: string; | ||
footer: React.ReactNode[]; | ||
}; | ||
const Dialog = ({ headerText, description, footer }: DialogProperties) => { | ||
return ( | ||
<div className="flex flex-col p-6 gap-4 bg-white rounded-[6px] max-w-[512px] w-auto"> | ||
<header className="flex flex-col gap-2"> | ||
<h2 className="text-lg font-semibold text-primary">{headerText}</h2> | ||
{description && ( | ||
<p className="font-normal text-sm leading-[1.05rem] text-muted-foreground text-pretty"> | ||
{description} | ||
</p> | ||
)} | ||
</header> | ||
<footer className=" flex flex-row w-full justify-end gap-2"> | ||
{footer.map((item, index) => ( | ||
<div key={index} className={cn("font-normal text-sm text-[#0F172A]")}> | ||
{item} | ||
</div> | ||
))} | ||
</footer> | ||
</div> | ||
); | ||
}; | ||
export default Dialog; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 are you creating your own dialog? Weren't you told to use ShadCN dialog component?
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.
In the issue requirements, I wasn't asked to use Shadcn-UI.
The Shadcn-UI Dialog component requires a close icon to close the dialog and a trigger button to display it, but these were not mentioned in the requirements and also not in the figma file.
I have attached the figma link for the component in the PR description for your reference.
Should I still go ahead and implement them anyway?
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.
Meet @SirhmVFX on slack to install it. he's @fullstackmechanic on slack