Resolve "Banner: Reposition"
Closes #933 (closed)
Many changes to RccFullPage(Base) Component are just removing outdated code.
In order to see a banner you will have to add ExampleBannerModule
to features.ts. The Banner should appear after 1 second at the home page.
Step 1
Added new banner inputs to RccFullPageComponent for the Banner.
Reasoning: The Banner needs theme specific styling. The Homepage though is not a theme component, but makes use of RccFullPageComponent. So RccFullPageComponent seems to be a good place to add banner functionality and the styles.
Alternatives would have been:
- add content projection to RccFullPageComponent (content projection encapsulates the content making styling way too difficult)
- styling HomePageComponent (not in theme)
- adding a separate component to themes handling the banner ( would still need styles in HomePageComponent or RccFullPageComponent to fit in with the rest of the page; also it's hard to see where else such a separate banner component could be used besides RccFullPageComponent)
Step2
Adjusted MarkowndComponent and MarkdownPipe:
- used parseInline to avoid wrapping with
<p>
elements - replaced 'translations' input with 'content' input (passing a translations record was a bad idea of mine, if something needs translation it should be translated before being passed into the markdown component, this way MarkdownComponent is decoupled from translation infrastructure)
Step 3
Switched banners from components to configs (instead of an arbitrary component, RccBannerService now holds a BannerConfig with raw data).
Reasoning: If RccBannerService holds anything with styling (such as a prestyled component) then styling happens outside of themes, which is awkward, because it's there but cannot be changed by the theme. If RccBannerService instead holds just a structural component (e.g. rendered markdown) that still needs styling, we cannot apply it from the outside, because ngComponentOutlet encapsulates the rendered content. ANd markdown content will needs styling in any case, at least for the font-face.