Skip to content

Commit 023bfd3

Browse files
committed
fix: refactor to adhere baseUrl
1 parent bd44d12 commit 023bfd3

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

src/pages/index.mdx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import TileGrid from '@site/src/components/TileGrid';
3+
import SlideDeck from '@site/src/components/SlideDeck';
34
import {useOS} from '@site/src/context/OSContext';
45

56
export const Tiles = () => {
@@ -41,15 +42,8 @@ Tools that Deploy App offers right now. More to come.
4142
## Basic Deploy App flow
4243
Not willing to go through all the docs? This is how it works.
4344

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} />
5347
</div>
5448

5549
### In a nutshell

src/theme/NavbarItem/CustomPlatformChooser.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem';
3+
import useBaseUrl from '@docusaurus/useBaseUrl';
34
import {useOS} from '@site/src/context/OSContext';
45
import {useHistory, useLocation} from '@docusaurus/router';
56

@@ -28,20 +29,17 @@ function useChangeOS() {
2829

2930
const {pathname} = location;
3031

31-
// ➜ 1. Stay put on the landing page
3232
if (pathname === '/') return;
33-
34-
// ➜ 2. Do not redirect anything under /docs/dev
3533
if (pathname.startsWith('/docs/dev')) return;
3634

37-
// ➜ 3. Replace existing platform segment if present
3835
const match = pathname.match(/^\/docs\/(android|ios|windows)(\/.*)?$/);
3936
if (match) {
4037
const [, , rest = ''] = match;
41-
history.replace(`/docs/${nextOS}${rest}`);
38+
const newUrl = useBaseUrl(`/docs/${nextOS}${rest}`);
39+
history.replace(newUrl);
4240
} 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);
4543
}
4644
};
4745
}

0 commit comments

Comments
 (0)