Skip to content

Conversation

@dominik-petrik
Copy link
Contributor

What: Closes #7711

@patternfly-build
Copy link
Collaborator

patternfly-build commented Jul 25, 2022

Copy link
Contributor

@tompsota tompsota left a comment

Choose a reason for hiding this comment

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

Hello @dominik-petrik, great job with the conversion! 🎉

I have just a couple of minor comments.

);
}
}
```ts file="./VerticalNav.tsx"
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually the file names are prefixed with the component name, in this case Page. Could you update this (and do the same with all other files as well)?

Suggested change
```ts file="./VerticalNav.tsx"
```ts file="./PageVerticalNav.tsx"


### Vertical nav using PageHeader component

This example is provided becuase PageHeader and PageHeaderTools are still in use; however, going forward Masthead and Toolbar should be used to make headers rather than PageHeader and PageHeaderTools.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please fix also this typo?

becuase -> because

} from '@patternfly/react-core';
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';

export const VerticalPage: React.FunctionComponent = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Component name should correspond with the file name. Also please check other files.

Suggested change
export const VerticalPage: React.FunctionComponent = () => {
export const PageMainSectionPadding: React.FunctionComponent = () => {

</Toolbar>
);

const Header = (
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that the convention is to use camelCase, is that correct @nicolethoen?

Suggested change
const Header = (
const header = (

Copy link
Contributor

Choose a reason for hiding this comment

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

That's correct - we generally use camelCase for our variable names and PascalCase for component names. Then any text, whether prop description or example titles are all Sentence case.

<MastheadContent>{headerToolbar}</MastheadContent>
</Masthead>
);
const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="main-padding-sidebar" />;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add newlines around const declarations (where missing) to make the code easier to read. However I don't have strict opinion on this, what do you think @nicolethoen?

Suggested change
const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="main-padding-sidebar" />;
const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="main-padding-sidebar" />;

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have a particularly strong opinion here. I think there are definitely times that using line breaks to clearly group related concepts or separate distinct concepts/steps can help with readability. I think in this case, @dominik-petrik can make a judgement call if he thinks adding the space is an improvement.

);
const Sidebar = <PageSidebar nav="Navigation" isNavOpen={isNavOpen} id="main-padding-sidebar" />;
return (
<Page header={Header} sidebar={Sidebar}>
Copy link
Contributor

Choose a reason for hiding this comment

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

The original example actually didn't have a sidebar passed in. Maybe we should keep it that way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We discussed this via slack and we agreed on maybe it being an oversight so I added the sidebar. But no problem for me to fix it. 😊

Copy link
Contributor

Choose a reason for hiding this comment

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

nah - sounds good for me! :)

@dominik-petrik
Copy link
Contributor Author

I have hopefully resolved all required changes. Let me know if I missed something or if there is anything else that needs to be done.

@nicolethoen
Copy link
Contributor

@dominik-petrik it looks good, it just needs a rebase! :)

@nicolethoen nicolethoen merged commit 23de54b into patternfly:main Jul 28, 2022
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.

Page: convert examples to TypeScript

5 participants