File tree Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change 1
1
import React from ' react' ;
2
2
import TileGrid from ' @site/src/components/TileGrid' ;
3
+ import SlideDeck from ' @site/src/components/SlideDeck' ;
3
4
import {useOS } from ' @site/src/context/OSContext' ;
4
5
5
6
export const Tiles = () => {
@@ -41,15 +42,8 @@ Tools that Deploy App offers right now. More to come.
41
42
## Basic Deploy App flow
42
43
Not willing to go through all the docs? This is how it works.
43
44
44
- <div className = " reveal-wrapper" style = { {height:' 600px' }} >
45
- <iframe
46
- src = " /decks/en/intro/"
47
- title = " Deploy App Slides"
48
- allow = " fullscreen; autoplay; clipboard-write"
49
- width = " 100%"
50
- height = " 100%"
51
- style = { {border:0 }}
52
- />
45
+ <div className = " reveal-wrapper" style = { { height: ' 600px' }} >
46
+ <SlideDeck deckPath = " intro" height = { 600 } />
53
47
</div >
54
48
55
49
### In a nutshell
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem' ;
3
+ import useBaseUrl from '@docusaurus/useBaseUrl' ;
3
4
import { useOS } from '@site/src/context/OSContext' ;
4
5
import { useHistory , useLocation } from '@docusaurus/router' ;
5
6
@@ -28,20 +29,17 @@ function useChangeOS() {
28
29
29
30
const { pathname} = location ;
30
31
31
- // ➜ 1. Stay put on the landing page
32
32
if ( pathname === '/' ) return ;
33
-
34
- // ➜ 2. Do not redirect anything under /docs/dev
35
33
if ( pathname . startsWith ( '/docs/dev' ) ) return ;
36
34
37
- // ➜ 3. Replace existing platform segment if present
38
35
const match = pathname . match ( / ^ \/ d o c s \/ ( a n d r o i d | i o s | w i n d o w s ) ( \/ .* ) ? $ / ) ;
39
36
if ( match ) {
40
37
const [ , , rest = '' ] = match ;
41
- history . replace ( `/docs/${ nextOS } ${ rest } ` ) ;
38
+ const newUrl = useBaseUrl ( `/docs/${ nextOS } ${ rest } ` ) ;
39
+ history . replace ( newUrl ) ;
42
40
} else {
43
- // otherwise send them to the Deploy App entry page
44
- history . replace ( `/docs/ ${ nextOS } /deployapp/home` ) ;
41
+ const fallbackUrl = useBaseUrl ( `/docs/ ${ nextOS } /deployapp/home` ) ;
42
+ history . replace ( fallbackUrl ) ;
45
43
}
46
44
} ;
47
45
}
You can’t perform that action at this time.
0 commit comments