Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | // Copyright 2020 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | import {LitElement, html, css} from 'lit-element'; |
| 6 | import 'elements/framework/mr-tabs/mr-tabs.js'; |
| 7 | |
| 8 | /** @type {readonly MenuItem[]} */ |
| 9 | const _MENU_ITEMS = Object.freeze([ |
| 10 | { |
| 11 | icon: 'list', |
| 12 | text: 'Issues', |
| 13 | url: 'issues', |
| 14 | }, |
| 15 | { |
| 16 | icon: 'people', |
| 17 | text: 'People', |
| 18 | url: 'people', |
| 19 | }, |
| 20 | { |
| 21 | icon: 'settings', |
| 22 | text: 'Settings', |
| 23 | url: 'settings', |
| 24 | }, |
| 25 | ]); |
| 26 | |
| 27 | // TODO(dtu): Put this inside <mr-header>. Currently, we can't do this because |
| 28 | // the sticky table headers rely on having a fixed header height. We need to |
| 29 | // add a scrolling context to the page in order to have a dynamic-height |
| 30 | // sticky, and to do that the footer needs to be in the scrolling context. So, |
| 31 | // the footer needs to be SPA-ified. |
| 32 | /** Hotlist Issues page */ |
| 33 | export class MrHotlistHeader extends LitElement { |
| 34 | /** @override */ |
| 35 | static get styles() { |
| 36 | return css` |
| 37 | h1 { |
| 38 | font-size: 20px; |
| 39 | font-weight: normal; |
| 40 | margin: 16px 24px; |
| 41 | } |
| 42 | nav { |
| 43 | border-bottom: solid #ddd 1px; |
| 44 | } |
| 45 | `; |
| 46 | } |
| 47 | |
| 48 | /** @override */ |
| 49 | render() { |
| 50 | return html` |
| 51 | <nav> |
| 52 | <mr-tabs .items=${_MENU_ITEMS} .selected=${this.selected}></mr-tabs> |
| 53 | </nav> |
| 54 | `; |
| 55 | } |
| 56 | |
| 57 | /** @override */ |
| 58 | static get properties() { |
| 59 | return { |
| 60 | selected: {type: Number}, |
| 61 | }; |
| 62 | }; |
| 63 | |
| 64 | /** @override */ |
| 65 | constructor() { |
| 66 | super(); |
| 67 | /** @type {number} */ |
| 68 | this.selected = 0; |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | customElements.define('mr-hotlist-header', MrHotlistHeader); |