Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit ffbca40

Browse files
committed
fix(client): fix sidebar param
1 parent 74b6326 commit ffbca40

File tree

23 files changed

+67
-102
lines changed

23 files changed

+67
-102
lines changed

CHANGELOG.md

+4-19
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,22 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
55

66
# [2.0.0-alpha.6](https://github.com/hiroppy/fusuma/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2021-01-19)
77

8-
98
### Bug Fixes
109

11-
* **cli:** validate the base path ([4d81a42](https://github.com/hiroppy/fusuma/commit/4d81a42a89f58fe225daebe6be677bcc2be4604f))
12-
13-
14-
15-
10+
- **cli:** validate the base path ([4d81a42](https://github.com/hiroppy/fusuma/commit/4d81a42a89f58fe225daebe6be677bcc2be4604f))
1611

1712
# [2.0.0-alpha.5](https://github.com/hiroppy/fusuma/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2021-01-19)
1813

19-
2014
### Features
2115

22-
* **cli:** add basePath option ([1bbee94](https://github.com/hiroppy/fusuma/commit/1bbee94ab9f014df26cf9f4ae0f7f0130a7a5ce9))
23-
24-
25-
26-
16+
- **cli:** add basePath option ([1bbee94](https://github.com/hiroppy/fusuma/commit/1bbee94ab9f014df26cf9f4ae0f7f0130a7a5ce9))
2717

2818
# [2.0.0-alpha.4](https://github.com/hiroppy/fusuma/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2021-01-19)
2919

30-
3120
### Bug Fixes
3221

33-
* **build:** modify screenshot logic ([735edfb](https://github.com/hiroppy/fusuma/commit/735edfb1bbb13bdbbda4ddab6e798fbc2a917663))
34-
* some bugs ([3191dcc](https://github.com/hiroppy/fusuma/commit/3191dcc2a8e9c8aab360071d0756ce7141163ee4))
35-
36-
37-
38-
22+
- **build:** modify screenshot logic ([735edfb](https://github.com/hiroppy/fusuma/commit/735edfb1bbb13bdbbda4ddab6e798fbc2a917663))
23+
- some bugs ([3191dcc](https://github.com/hiroppy/fusuma/commit/3191dcc2a8e9c8aab360071d0756ce7141163ee4))
3924

4025
# [1.16.0](https://github.com/hiroppy/fusuma/compare/v1.15.2...v1.16.0) (2020-02-17)
4126

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
"version": "1.1.2",
44
"private": true,
55
"description": "easily make slides with markdown",
6-
"workspaces": ["packages/*"],
6+
"workspaces": [
7+
"packages/*"
8+
],
79
"scripts": {
810
"test": "jest",
9-
"fmt": "prettier --write **/*.{js,json,css,md}",
11+
"fmt": "prettier --write packages/**/*.{js,json,css,md}",
1012
"precommit": "pretty-quick --staged",
1113
"build:samples": "node scripts/build-samples.js",
1214
"deploy:samples": "npm run build:samples && node scripts/deploy-samples.js",

packages/client/CHANGELOG.md

-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
77

88
**Note:** Version bump only for package @fusuma/client
99

10-
11-
12-
13-
1410
# [1.16.0](https://github.com/hiroppy/fusuma/compare/v1.15.2...v1.16.0) (2020-02-17)
1511

1612
### Features

packages/client/src/components/AppContainer.js

+13-23
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ export const AppContainer = ({ slides: originalSlides, hash }) => {
2424
AddSidebarComponent(Sidebar);
2525
};
2626

27-
const changeSidebarState = () => {
28-
const isSidebar =
29-
params.get('sidebar') === 'false' || !process.env.SIDEBAR || mode !== 'common' ? false : true;
30-
31-
updateOpenSidebarStatus(false);
32-
updateSidebarStatus(isSidebar);
33-
};
34-
3527
const setContentViewComponent = async () => {
3628
if (mode === 'common') {
3729
AddContentComponent(Base);
@@ -77,17 +69,17 @@ export const AppContainer = ({ slides: originalSlides, hash }) => {
7769
const [mode, updateMode] = useState(initialMode); // common, view, host
7870
const [slides, updateSlides] = useState(createdProps.slides);
7971
const [contentsList, updateContentsList] = useState(createdProps.contentsList);
80-
const [isSidebar, updateSidebarStatus] = useState(true);
8172
const [isOpenSidebar, updateOpenSidebarStatus] = useState(false);
8273
const [currentIndex, updateCurrentIndex] = useState(index);
8374
const [SidebarComponent, AddSidebarComponent] = useState(null); // for lazyload
8475
const [ContentComponent, AddContentComponent] = useState(mode === 'common' ? Base : undefined);
8576
const [CommentsListComponent, AddCommentsListComponents] = useState(null); // for lazyload
8677

8778
useEffect(() => {
88-
changeSidebarState();
79+
const isSidebar =
80+
params.get('sidebar') === 'false' || !process.env.SIDEBAR || mode !== 'common' ? false : true;
8981

90-
if (!SidebarComponent) {
82+
if (isSidebar && !SidebarComponent) {
9183
setSidebarComponent();
9284
}
9385

@@ -117,19 +109,17 @@ export const AppContainer = ({ slides: originalSlides, hash }) => {
117109

118110
return (
119111
<>
120-
{isSidebar && (
112+
{SidebarComponent && (
121113
<>
122-
{SidebarComponent && (
123-
<SidebarComponent
124-
goTo={goTo}
125-
isOpen={isOpenSidebar}
126-
terminate={terminate}
127-
contents={contentsList}
128-
onStateChange={onSetSidebarOpen}
129-
currentIndex={currentIndex}
130-
runPresentationMode={onRunPresentationMode}
131-
/>
132-
)}
114+
<SidebarComponent
115+
goTo={goTo}
116+
isOpen={isOpenSidebar}
117+
terminate={terminate}
118+
contents={contentsList}
119+
onStateChange={onSetSidebarOpen}
120+
currentIndex={currentIndex}
121+
runPresentationMode={onRunPresentationMode}
122+
/>
133123
<MdMenu className="btn-sidebar" onClick={() => onSetSidebarOpen({ isOpen: true })} />
134124
</>
135125
)}

packages/client/src/components/CommentsList.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import '../../assets/style/commentsList.css';
66
const Ul = posed.ul({});
77
const Li = posed.li({
88
enter: { opacity: 1 },
9-
exit: { opacity: 0 }
9+
exit: { opacity: 0 },
1010
});
1111
const rf = new IntlRelativeFormat();
1212
let ws;
@@ -29,7 +29,7 @@ export const CommentsList = memo(() => {
2929
const convertedComments = fetchedComments.reverse().map((c) => {
3030
return {
3131
...c,
32-
createdAt: rf.format(c.createdAt)
32+
createdAt: rf.format(c.createdAt),
3333
};
3434
});
3535

packages/client/src/components/ContentView/Host.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
FaCaretRight,
1212
FaCaretUp,
1313
FaMicrophoneAlt,
14-
FaMicrophoneAltSlash
14+
FaMicrophoneAltSlash,
1515
} from 'react-icons/fa';
1616
import { MdZoomOutMap } from 'react-icons/md';
1717
import { Controller as PresentationController } from '../../presentationMode/Controller'; // common and host
@@ -80,7 +80,7 @@ const Host = memo(({ slides, currentIndex, terminate, onChangeSlideIndex }) => {
8080
title: `Moved to the ${num + 1} slide from the ${num} slide.`,
8181
Slide: slides[num].slide,
8282
color: '#3498db',
83-
Icon: <FaCaretRight size="22" />
83+
Icon: <FaCaretRight size="22" />,
8484
});
8585
}
8686

@@ -103,7 +103,7 @@ const Host = memo(({ slides, currentIndex, terminate, onChangeSlideIndex }) => {
103103
title: `Started from the ${currentIndex + 1} slide.`,
104104
Slide: slides[currentIndex].slide,
105105
color: '#6fba1c',
106-
Icon: <FaCaretDown />
106+
Icon: <FaCaretDown />,
107107
});
108108

109109
if (usedAudio) {
@@ -125,7 +125,7 @@ const Host = memo(({ slides, currentIndex, terminate, onChangeSlideIndex }) => {
125125
event: 'stopped',
126126
title: `Stopped at the ${currentIndex + 1} slide.`,
127127
color: '#e9546b',
128-
Icon: <FaCaretUp />
128+
Icon: <FaCaretUp />,
129129
});
130130

131131
if (usedAudio) {
@@ -234,7 +234,7 @@ const Host = memo(({ slides, currentIndex, terminate, onChangeSlideIndex }) => {
234234
{slides && (
235235
<pre
236236
dangerouslySetInnerHTML={{
237-
__html: slides[currentIndex].fusumaProps.note
237+
__html: slides[currentIndex].fusumaProps.note,
238238
}}
239239
/>
240240
)}

packages/client/src/components/ContentView/View.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ const View = memo(({ slides, hash }) => {
3838

3939
return await webrtc.startCapturing({
4040
video: {
41-
displaySurface: 'monitor'
42-
}
41+
displaySurface: 'monitor',
42+
},
4343
});
4444
} else {
4545
throw new Error('Capturing has already run.');

packages/client/src/components/Sidebar.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import { MdFirstPage, MdLastPage, MdFullscreen, MdAirplay } from 'react-icons/md
77
const styles = {
88
sidebar: {
99
minWidth: 150,
10-
zIndex: 1001
10+
zIndex: 1001,
1111
},
1212
overlay: {
1313
backgroundColor: 'rgba(0, 0, 0, .5)',
14-
zIndex: 1000
15-
}
14+
zIndex: 1000,
15+
},
1616
};
1717

1818
const url = process.env.URL || window.location.href.split('#')[0];

packages/client/src/presentationMode/Controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class Controller {
2929
changePage(pageNum) {
3030
const data = JSON.stringify({
3131
date: Date.now(),
32-
page: pageNum
32+
page: pageNum,
3333
});
3434

3535
if (this.apiType === 'presentation' && this.presentationConnection) {

packages/client/src/setup/Mermaid.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import mermaid from 'mermaid';
33
export class Mermaid {
44
constructor() {
55
mermaid.initialize({
6-
startOnLoad: false
6+
startOnLoad: false,
77
});
88
}
99

@@ -20,7 +20,7 @@ export class Mermaid {
2020
background: `url(${encodedString})`,
2121
backgroundRepeat: 'no-repeat',
2222
backgroundPosition: 'center',
23-
margin: '0 auto'
23+
margin: '0 auto',
2424
});
2525
}
2626

@@ -29,7 +29,7 @@ export class Mermaid {
2929

3030
elms.forEach((elm) => {
3131
Object.assign(elm.style, {
32-
visibility: 'initial'
32+
visibility: 'initial',
3333
});
3434

3535
mermaid.init();
@@ -59,7 +59,7 @@ export class Mermaid {
5959

6060
mermaid.init();
6161
Object.assign(elm.style, {
62-
visibility: 'initial'
62+
visibility: 'initial',
6363
});
6464

6565
// this.encode(elm);

packages/client/src/setup/webSlides.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export function setup({ showIndex = process.env.SHOW_INDEX }) {
44
const ws = new window.WebSlides({
55
loop: process.env.LOOP,
66
showIndex,
7-
navigateOnScroll: false
7+
navigateOnScroll: false,
88
});
99

1010
return ws;

packages/client/src/utils/createSlidesProps.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function createSlidesProps(slides, currentIndex) {
1414
if (sectionTitle) {
1515
acc.push({
1616
title: sectionTitle,
17-
index: i + 1
17+
index: i + 1,
1818
});
1919
}
2020
return acc;
@@ -25,7 +25,7 @@ export function createSlidesProps(slides, currentIndex) {
2525

2626
return {
2727
slide: props.contents ? ToC({ list: res.contentsList }) : slide,
28-
fusumaProps: props
28+
fusumaProps: props,
2929
};
3030
});
3131

packages/client/src/utils/fetchSlides.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function fetchSlides(dir) {
99
slides: context
1010
.keys()
1111
.sort()
12-
.map((e) => context(e))
12+
.map((e) => context(e)),
1313
};
1414
}
1515

packages/client/src/utils/webrtc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class WebRTC {
2828
this.finishedProcess = true;
2929
this.url = URL.createObjectURL(
3030
new Blob(recordedChunks, {
31-
type: 'audio/webm'
31+
type: 'audio/webm',
3232
})
3333
);
3434
});

packages/fusuma/CHANGELOG.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
55

66
# [2.0.0-alpha.6](https://github.com/hiroppy/fusuma/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2021-01-19)
77

8-
98
### Bug Fixes
109

11-
* **cli:** validate the base path ([4d81a42](https://github.com/hiroppy/fusuma/commit/4d81a42a89f58fe225daebe6be677bcc2be4604f))
12-
13-
14-
15-
10+
- **cli:** validate the base path ([4d81a42](https://github.com/hiroppy/fusuma/commit/4d81a42a89f58fe225daebe6be677bcc2be4604f))
1611

1712
# [2.0.0-alpha.5](https://github.com/hiroppy/fusuma/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2021-01-19)
1813

packages/fusuma/src/tasks/build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function createOgImage(outputDirPath) {
2424
height: 630,
2525
});
2626
const app = await fileServer(outputDirPath, port);
27-
await page.goto(`http://localhost:${port}`, {
27+
await page.goto(`http://localhost:${port}?sidebar=false`, {
2828
waitUntil: ['load', 'networkidle2'],
2929
});
3030
await page.screenshot({ path: outputFilePath });

packages/mdx-loader/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function mdxLoader(src) {
1212
? [emoji, require('remark-math'), require('remark-html-katex') /* avoid warnings */, mdxPlugin]
1313
: [emoji, mdxPlugin];
1414
const result = mdx.sync(src, {
15-
remarkPlugins
15+
remarkPlugins,
1616
});
1717

1818
cb(null, result);

0 commit comments

Comments
 (0)