-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add Message Screeens #57
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.
Nice!
let slot = this.slotName; | ||
if (slot == "") { | ||
return "default"; | ||
} |
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.
IIUC blank slot names should be caught at check at L40 which also returns "default" so I don't think we need this block.
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.
You could have a subelement with slot="" and therefore match slotName="".
Also just no need to iterate over the children if it is empty, as i want it to use "default" in that case.
src/components/message-screen.js
Outdated
hasSlot(slotName) { | ||
return Array.from(this.children).some((e) => { | ||
e.slot === slotName; | ||
}); | ||
} | ||
getTargetSlot() { | ||
let slot = this.slotName; | ||
if (slot == "") { | ||
return "default"; | ||
} | ||
if (!this.hasSlot(slot)) { | ||
return "default"; | ||
} | ||
return slot; | ||
} |
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.
Do we need hasSlot()
and getTargetSlot()
here too?
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.
hahaha spotted copy pasting
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 really should setup a macro in my editor to create lit components 😅
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.
It can be our first extension devtool! 🛠️
This PR adds a view-router we can use to switch out the browser action main element based on ... things.
Also i add a generic message-screen factory, so we can simply add more with one func call :)
followMessages.mp4