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 11import type { ButtonContent } from '../button/button.js' ;
22import type { IconButtonContent } from '../icon-button/icon-button.js' ;
3+ import type { ContextSignal } from '@gecut/signal' ;
34
45export type EndIconType = ( IconButtonContent & { element : 'icon-button' } ) | ( ButtonContent & { element : 'button' } ) ;
56
67export interface TopBarContent {
7- title : string ;
8+ title : string | ContextSignal < string > ;
89
910 startIcon ?: IconButtonContent ;
1011 endIconList ?: EndIconType [ ] ;
Original file line number Diff line number Diff line change 1+ import { gecutContext } from '@gecut/lit-helper/directives/context.js' ;
12import { html , nothing } from 'lit/html.js' ;
23
34import { endIconListTemplate } from './_end-icon-list.js' ;
@@ -11,7 +12,7 @@ export const gecutCenterTopBar = (content: TopBarContent) => html`
1112 < div > ${ content . startIcon ? gecutIconButton ( content . startIcon ) : nothing } </ div >
1213
1314 < div class ="gecut-top-bar-title ">
14- < h1 > ${ content . title } </ h1 >
15+ < h1 > ${ typeof content . title === 'string' ? content . title : gecutContext ( content . title ) } </ h1 >
1516 </ div >
1617
1718 < 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`
1111 < div > ${ content . startIcon ? gecutIconButton ( content . startIcon ) : nothing } </ div >
1212
1313 < div class ="gecut-top-bar-title ">
14- < h1 > ${ content . title } </ h1 >
14+ < h1 > ${ typeof content . title === 'string' ? content . title : gecutContext ( content . title ) } </ h1 >
1515 </ div >
1616
1717 < div > ${ endIconListTemplate ( content . endIconList ) } </ div >
You can’t perform that action at this time.
0 commit comments