rgh-netiquette - Support new views - #8141
Conversation
|
I also check the |
|
Unlike React components, any attributes you pass to dom-chef JSX will automatically be added. For classes, they will be appended. So However you most likely just want to change the Wherever possible, when you make changes to components or classes, search the codebase for the keyword and you might be able to fix multiple features at once. e.g. like you did for |
Since the component needs to work in both layouts, then the right class needs to be applied depending on context. export function TimelineItemOld(): JSX.Element {
// Classes copied from #issuecomment-new + mt-3 added
return <div className="ml-0 pl-0 ml-md-6 pl-md-3 mt-3" />;
}
!! adjust/remove all classes as needed
export function TimelineItem(): JSX.Element {
return <div className="ml-0 pl-0 ml-md-0 pl-md-3 mt-3" />;
}And then in the features you can use: const Wrapper = yourLogicToDetectOldView ? TimelineItemOld : TimelineItem;
const banner = (
<Wrapper>{createBanner({etc})}</Wrapper>
)You can alternatively use the const banner = createTimelineItem(
yourLogicToDetectOldView ? 'old' : 'react',
createBanner({etc})
)Up to you |
|
|
||
| // #8141 | ||
| export function TimelineItem(): JSX.Element { | ||
| return <div className="ml-0 pl-0 pl-md-3 mt-3" />; |
There was a problem hiding this comment.
Let's make sure it works correctly on all window widths. These classes were for the old version
|
|
||
| // https://github.com/refined-github/refined-github/pull/8141 | ||
| export function TimelineItem(): JSX.Element { | ||
| return <div className="my-2" />; |
There was a problem hiding this comment.
It seems it only need my-2 in new view. It works on all widths.
Google.Chrome.mp4
|
Wait, to me it looks like it's in the wrong container. The banner should not go under the sidebar for example, it should be part of the main thread column |
fregante
left a comment
There was a problem hiding this comment.
Might be good to follow this with closing-remarks





rgh-*features broken on new beta views #8012Test URLs
download-directory/download-directory.github.io#74
Screenshot