File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 1
- import { html } from "lit" ;
1
+ import { html , nothing } from "lit" ;
2
2
3
3
import { ArticleFooter } from "../article-footer/server.js" ;
4
4
import { BaselineIndicator } from "../baseline-indicator/server.js" ;
5
5
import { ContentSection } from "../content-section/server.js" ;
6
+ import { WRITER_MODE } from "../env/index.js" ;
6
7
import { LeftSidebar } from "../left-sidebar/server.js" ;
7
8
import { ReferenceToc } from "../reference-toc/server.js" ;
8
9
import { ServerComponent } from "../server/index.js" ;
9
10
import { TranslationBanner } from "../translation-banner/server.js" ;
11
+ import { WriterToolbar } from "../writer-toolbar/server.js" ;
10
12
11
13
export class ReferenceLayout extends ServerComponent {
12
14
/**
@@ -22,6 +24,7 @@ export class ReferenceLayout extends ServerComponent {
22
24
< div class ="reference-layout ">
23
25
< main id ="content " class ="reference-layout__content ">
24
26
< div class ="reference-layout__header ">
27
+ ${ WRITER_MODE ? WriterToolbar . render ( context ) : nothing }
25
28
${ TranslationBanner . render ( context ) }
26
29
< h1 > ${ doc . title } </ h1 >
27
30
${ BaselineIndicator . render ( context ) } ${ description }
Original file line number Diff line number Diff line change
1
+ .writer-toolbar {
2
+ margin-top : 1.5rem ;
3
+
4
+ background : var (--color-background-primary );
5
+ border : 1px solid var (--color-border-primary );
6
+ border-radius : 0.25rem ;
7
+ }
Original file line number Diff line number Diff line change
1
+ import { html } from "lit" ;
2
+
3
+ import { Button } from "../button/server.js" ;
4
+ import { ServerComponent } from "../server/index.js" ;
5
+
6
+ export class WriterToolbar extends ServerComponent {
7
+ /**
8
+ * @param {import("@fred").Context<import("@rari").DocPage> } context
9
+ */
10
+ render ( context ) {
11
+ const prodUrl = new URL ( context . url , "https://developer.mozilla.org" ) ;
12
+
13
+ return html `< div class ="writer-toolbar ">
14
+ ${ Button . render ( context , {
15
+ label : context . l10n `View on MDN` ,
16
+ href : prodUrl . toString ( ) ,
17
+ variant : "plain" ,
18
+ } ) }
19
+ </ div > ` ;
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments