File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
packages/components/src/top-bar Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
import type { ButtonContent } from '../button/button.js' ;
2
2
import type { IconButtonContent } from '../icon-button/icon-button.js' ;
3
+ import type { ContextSignal } from '@gecut/signal' ;
3
4
4
5
export type EndIconType = ( IconButtonContent & { element : 'icon-button' } ) | ( ButtonContent & { element : 'button' } ) ;
5
6
6
7
export interface TopBarContent {
7
- title : string ;
8
+ title : string | ContextSignal < string > ;
8
9
9
10
startIcon ?: IconButtonContent ;
10
11
endIconList ?: EndIconType [ ] ;
Original file line number Diff line number Diff line change
1
+ import { gecutContext } from '@gecut/lit-helper/directives/context.js' ;
1
2
import { html , nothing } from 'lit/html.js' ;
2
3
3
4
import { endIconListTemplate } from './_end-icon-list.js' ;
@@ -11,7 +12,7 @@ export const gecutCenterTopBar = (content: TopBarContent) => html`
11
12
< div > ${ content . startIcon ? gecutIconButton ( content . startIcon ) : nothing } </ div >
12
13
13
14
< div class ="gecut-top-bar-title ">
14
- < h1 > ${ content . title } </ h1 >
15
+ < h1 > ${ typeof content . title === 'string' ? content . title : gecutContext ( content . title ) } </ h1 >
15
16
</ div >
16
17
17
18
< div > ${ endIconListTemplate ( content . endIconList ) } </ div >
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export const gecutSmallTopBar = (content: TopBarContent) => html`
11
11
< div > ${ content . startIcon ? gecutIconButton ( content . startIcon ) : nothing } </ div >
12
12
13
13
< div class ="gecut-top-bar-title ">
14
- < h1 > ${ content . title } </ h1 >
14
+ < h1 > ${ typeof content . title === 'string' ? content . title : gecutContext ( content . title ) } </ h1 >
15
15
</ div >
16
16
17
17
< div > ${ endIconListTemplate ( content . endIconList ) } </ div >
You can’t perform that action at this time.
0 commit comments