File tree Expand file tree Collapse file tree 5 files changed +148
-0
lines changed Expand file tree Collapse file tree 5 files changed +148
-0
lines changed Original file line number Diff line number Diff line change 1+ import "./main.css" ;
2+ import React from "react" ;
3+
4+ export default function BrowserWindow ( props ) {
5+ // Straight out of w3schools: https://www.w3schools.com/howto/howto_css_browser_window.asp
6+
7+ const url = props . url || "http://localhost:3000" ;
8+
9+ return (
10+ < div className = "browser container" >
11+ < div className = "row" >
12+ < div className = "column left" >
13+ < span className = "dot" style = { { background : "#ED594A" } } > </ span >
14+ < span className = "dot" style = { { background : "#FDD800" } } > </ span >
15+ < span className = "dot" style = { { background : "#5AC05A" } } > </ span >
16+ </ div >
17+ < div className = "column middle" >
18+ < input type = "text" value = { url } />
19+ </ div >
20+ < div className = "column right" >
21+ < div style = { { float : "right" } } >
22+ < span className = "bar" > </ span >
23+ < span className = "bar" > </ span >
24+ < span className = "bar" > </ span >
25+ </ div >
26+ </ div >
27+ </ div >
28+
29+ < div className = "content" >
30+ { props . children }
31+ </ div >
32+ </ div >
33+ )
34+ }
Original file line number Diff line number Diff line change 1+ * {
2+ box-sizing : border-box;
3+ }
4+
5+ /* The browser window */
6+ .browser .container {
7+ border : 3px solid # f1f1f1 ;
8+ border-top-left-radius : 4px ;
9+ border-top-right-radius : 4px ;
10+ margin-bottom : 10px ;
11+ cursor : not-allowed;
12+ }
13+
14+ /* Container for columns and the top "toolbar" */
15+ .browser .row {
16+ padding : 10px ;
17+ background : # f1f1f1 ;
18+ border-top-left-radius : 4px ;
19+ border-top-right-radius : 4px ;
20+ }
21+
22+ /* Create three unequal columns that floats next to each other */
23+ .browser .column {
24+ float : left;
25+ }
26+
27+ .browser .left {
28+ width : 15% ;
29+ }
30+
31+ .browser .right {
32+ width : 10% ;
33+ }
34+
35+ .browser .middle {
36+ width : 75% ;
37+ }
38+
39+ /* Clear floats after the columns */
40+ .browser .row : after {
41+ content : "" ;
42+ display : table;
43+ clear : both;
44+ }
45+
46+ /* Three dots */
47+ .browser .dot {
48+ margin-top : 4px ;
49+ height : 12px ;
50+ width : 12px ;
51+ background-color : # bbb ;
52+ border-radius : 50% ;
53+ display : inline-block;
54+ }
55+
56+ /* Style the input field */
57+ .browser input [type = text ] {
58+ width : 100% ;
59+ border-radius : 3px ;
60+ border : none;
61+ background-color : white;
62+ margin-top : -8px ;
63+ height : 25px ;
64+ color : # 666 ;
65+ padding : 5px ;
66+ }
67+
68+ /* Three bars (hamburger menu) */
69+ .browser .bar {
70+ width : 17px ;
71+ height : 3px ;
72+ background-color : # aaa ;
73+ margin : 3px 0 ;
74+ display : block;
75+ }
76+
77+ /* Page content */
78+ .browser .content {
79+ padding : 10px ;
80+ text-align : center;
81+ }
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import Link from '@docusaurus/Link' ;
3+ import useDocusaurusContext from '@docusaurus/useDocusaurusContext' ;
4+
5+ export default function UTMLink ( props ) {
6+ const context = useDocusaurusContext ( ) ;
7+ const utmParams = context ?. siteConfig ?. customFields ?. utmParams || '' ;
8+ const to = `${ props . to } ?${ utmParams } ` ;
9+ return < Link { ...props } to = { to } /> ;
10+ }
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import BrowserWindow from "@site/src/components/BrowserWindow" ;
3+ import useBaseUrl from '@docusaurus/useBaseUrl' ;
4+
5+ export default function Screenshot ( props ) {
6+ return (
7+ < BrowserWindow { ...props } >
8+ < img src = { useBaseUrl ( props . src ) } alt = { props . alt } />
9+ </ BrowserWindow >
10+ )
11+ } ;
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ // Import the original mapper
3+ import MDXComponents from '@theme-original/MDXComponents' ;
4+ import Link from "@site/src/components/Link" ;
5+ import Screenshot from "@site/src/components/Screenshot" ;
6+
7+ export default {
8+ // Re-use the default mapping
9+ ...MDXComponents ,
10+ Link,
11+ Screenshot
12+ } ;
You can’t perform that action at this time.
0 commit comments