Skip to content

Add Collapse - #27

Open
Shoaibv2 wants to merge 2 commits into
mainfrom
feature/8-add-Collapse
Open

Add Collapse#27
Shoaibv2 wants to merge 2 commits into
mainfrom
feature/8-add-Collapse

Conversation

@Shoaibv2

Copy link
Copy Markdown
Member

Fixes #8

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

Copy link
Copy Markdown
Contributor

@aftabrehan please review.

@aftabrehan aftabrehan left a comment

Copy link
Copy Markdown
Member

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 thread apps/views/pages/Collapse.jsx Outdated
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"
/>
</>

@aftabrehan aftabrehan Apr 14, 2022

Copy link
Copy Markdown
Member

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"
/>

Comment thread apps/views/pages/Collapse.jsx Outdated
@@ -0,0 +1,16 @@
import { Collapse } from "kbs-core";

function Collap() {

Copy link
Copy Markdown
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 thread apps/views/pages/index.jsx Outdated
Comment on lines +16 to +19
<br />
<Button>Hello</Button>
<br />
<Link href="/Collapse">Collapse</Link>

Copy link
Copy Markdown
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>

Comment thread apps/views/pages/Collapse.jsx Outdated
);
}

export default Collap;

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?

Comment thread packages/kbs-core/src/index.tsx Outdated
@@ -1,2 +1,4 @@
import * as React from "react";
import Collapse from "./components/Collapse";

Copy link
Copy Markdown
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