-
Notifications
You must be signed in to change notification settings - Fork 64
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
[MM-54367] Apply scope to the menu class #213
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
.status-dropdown-menu { | ||
> .Menu { | ||
> .TodoMenu { | ||
position: inherit; | ||
} | ||
} | ||
|
||
.Menu { | ||
.TodoMenu { | ||
display: flex; | ||
flex-direction: column; | ||
position: absolute; | ||
|
@@ -125,8 +125,8 @@ | |
} | ||
} | ||
|
||
.Menu, | ||
.SubMenuOption .SubMenu { | ||
.TodoMenu, | ||
.SubTodoMenuOption .SubTodoMenu { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see changes in the code for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's not needed now. I added it for the future use-case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there is no class name being used in the components There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mickmister I removed the unused classnames. |
||
@media screen and (max-width: 430px) { | ||
position: fixed; | ||
top: 0; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.MenuWrapper { | ||
.TodoMenuWrapper { | ||
position: relative; | ||
|
||
&.disabled { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ const MenuWrapper = React.memo((props: Props) => { | |
const [open, setOpen] = useState(Boolean(props.isOpen)); | ||
|
||
if (!Array.isArray(props.children) || props.children.length !== 2) { | ||
throw new Error('MenuWrapper needs exactly 2 children'); | ||
throw new Error('TodoMenuWrapper needs exactly 2 children'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The component should probably be renamed to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I reverted it back to |
||
} | ||
|
||
const close = (): void => { | ||
|
@@ -76,7 +76,7 @@ const MenuWrapper = React.memo((props: Props) => { | |
}, []); | ||
|
||
const {children} = props; | ||
let className = 'MenuWrapper'; | ||
let className = 'TodoMenuWrapper'; | ||
if (props.disabled) { | ||
className += ' disabled'; | ||
} | ||
|
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.
Unrelated to this PR, but it seems wrong to assume that the plugin's
TodoMenu
component will always be a next-level descendant of the element that hasstatus-dropdown-menu
class nameThere 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 thought it would be okay because
position
is applied separately to the TodoMenu classname.https://github.com/mattermost/mattermost-plugin-todo/blob/a309a7ab63f0ea0ec7b91e7f46b22045e84ee08e/webapp/src/widget/menu.scss#L7-L10
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.
Right, but
.status-dropdown-menu
is managed by the core webapp. At any point, the webapp could restructure itsrlf and do one of:.status-dropdown-menu
and the plugin's componentBoth of these would make it so our plugin styles don't get used. The alternative is to not have the
>
in the selector