-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Refactored the ContributeGuide.tsx file #906
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.
This file is still fairly bulky, but I dont think there is much way around that
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 personally do not like what it is in its current form. It seems to achieve the goal of reducing the original file's line count, but it introduces unnecessary complexity and makes the code even harder to maintain.
import Link from '@docusaurus/Link'; | ||
|
||
export const contributeData: NodeData = { | ||
links: [ |
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'm sorry, but I really don't think a huge Nodedata
object is more maintainable and easier to work with than JSX. This will cause extra pain if we ever want to change this page.
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 disagree to be honest, it means if we want to change any of the stucture of a "node" we can do so very easily in the Node.tsx file, I also dont see how this is harder to edit than the previous one.
Doing it this way also means that we can unit test this alot easier than before.
node: NodeData; | ||
} | ||
|
||
export default function Node({ data }: { data: NodeData }) { |
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.
This is a terrible name for this "component" and I think it is meaningless to have a component like this because the idea passing "node data" is just terrible. If you really want a re-usable component, made a "Tabs" component which switch between displaying multiple panels of content and use saner syntax like:
<Tabs id="TabsExample" onChange={this.handleTabChange} selectedTabId="code">
<Tab id="code" title="Code" panel={<CodePanel />} />
<Tab id="translations" title="Translations" panel={<TranslationsPanel />} />
<Tab id="other" title="Other" panel={<OtherPanel />} />
</Tabs>
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 made a new pr here: #907
See if this option looks better
This file is moved in the developers branch, unless actual content changes are made i don't see the point of making changes to it as it only complicates rebasing the dev branch. |
I dont believe it has moved in the developer branch? still appears to be there? |
No description provided.