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 Collapse #27

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

Add Collapse #27

wants to merge 2 commits into from

Conversation

Shoaibv2
Copy link
Member

Fixes #8

@Shoaibv2 Shoaibv2 requested a review from ranajahanzaib April 14, 2022 09:34
@ranajahanzaib
Copy link
Contributor

@aftabrehan please review.

Copy link
Member

@aftabrehan aftabrehan left a comment

Choose a reason for hiding this comment

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

Just a minor fixes. Nice work. 👍

Comment on lines 5 to 12
<>
<Collapse
variant="primary"
lablecontent="Some placeholder content for the collapse component. This panel is hidden by default but revealed when the user activates the relevant trigger.
"
lable="toggle"
/>
</>
Copy link
Member

@aftabrehan aftabrehan Apr 14, 2022

Choose a reason for hiding this comment

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

Empty Fragments <></> are necessary when there are multiple tags to return, as their is only one tag/component to return.

So it's unnecessary to use Empty Fragments <></> in this case.

Suggested change
<>
<Collapse
variant="primary"
lablecontent="Some placeholder content for the collapse component. This panel is hidden by default but revealed when the user activates the relevant trigger.
"
lable="toggle"
/>
</>
<Collapse
variant="primary"
lablecontent="Some placeholder content for the collapse component. This panel is hidden by default but revealed when the user activates the relevant trigger."
lable="toggle"
/>

@@ -0,0 +1,16 @@
import { Collapse } from "kbs-core";

function Collap() {
Copy link
Member

Choose a reason for hiding this comment

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

Can't figure out, why this named collap

Comment on lines 16 to 19
<br />
<Button>Hello</Button>
<br />
<Link href="/Collapse">Collapse</Link>
Copy link
Member

Choose a reason for hiding this comment

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

It's a best practice sort your component link alphabatically.

So in future it'll save a lot of time.

Suggested change
<br />
<Button>Hello</Button>
<br />
<Link href="/Collapse">Collapse</Link>
<br />
<Link href="/Collapse">Collapse</Link>
<br />
<Button>Hello</Button>

);
}

export default Collap;
Copy link
Member

Choose a reason for hiding this comment

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

Use capital letter only for the compnent name. Not for the usage file name.

</button>

<div className="collapse" id="collapseExample">
<div className="card card-body">{props.labelcontent}</div>
Copy link
Member

Choose a reason for hiding this comment

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

Always use camelCase notation for this type of cases.

Suggested change
<div className="card card-body">{props.labelcontent}</div>
<div className="card card-body">{props.labelContent}</div>

Copy link
Member

Choose a reason for hiding this comment

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

It can be renamed as content 👍

Suggested change
<div className="card card-body">{props.labelcontent}</div>
<div className="card card-body">{props.content}</div>

Comment on lines 15 to 17
<div className="collapse" id="collapseExample">
<div className="card card-body">{props.labelcontent}</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.

Is that another div important?
Or We use just one div.
as:

Suggested change
<div className="collapse" id="collapseExample">
<div className="card card-body">{props.labelcontent}</div>
</div>
<div className="card card-body collapse" id="collapseExample">
{props.labelcontent}
</div>

What you think about it?
Any suggestion?

@@ -1,2 +1,4 @@
import * as React from "react";
import Collapse from "./components/Collapse";
Copy link
Member

Choose a reason for hiding this comment

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

It's a good practice to have an empty line between imports & exports. 👍

Suggested change
import Collapse from "./components/Collapse";
import Collapse from "./components/Collapse";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Collapse Component
3 participants