Skip to content

Commit

Permalink
refactor(presenterModes): adjust fonts and spacing to screen (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
KatvonRivia authored Oct 26, 2020
1 parent 3d02e7c commit fed374b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import cx from 'classnames';
import {getStoryAssetUrl} from '../../../libs/get-story-asset-urls';

import {Slide} from '../../../types/story';
import {StoryMode} from '../../../types/story-mode';

import styles from './splash-screen.styl';
import {StoryMode} from '../../../types/story-mode';

interface Props {
storyId: string;
Expand Down
11 changes: 7 additions & 4 deletions src/scripts/components/stories/story-content/story-content.styl
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@

.shortTextContent
overflow-y: hidden
padding-top: emCalc(30px)
font-size: emCalc(24px)
padding: emCalc(40px)
font-size: 2.3vh

p
margin: emCalc(10px) 0
h2
margin-top: 0

p
margin: emCalc(10px) 0

@media screen and (max-width: 480px)
.content
Expand Down
4 changes: 4 additions & 0 deletions src/scripts/components/stories/story-list/story-list.styl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
grid-gap: 16px

.present
padding-top: emCalc(20px)
grid-template-columns: repeat(auto-fill, minmax(400px, 1fr))

.showcase
padding-top: emCalc(20px)

@media screen and (max-width: 480px)
.storyListGrid
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr))
3 changes: 2 additions & 1 deletion src/scripts/components/stories/story-list/story-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const StoryList: FunctionComponent<Props> = ({

const classes = cx(
styles.storyListGrid,
mode === StoryMode.Present && styles.present
mode === StoryMode.Present && styles.present,
mode === StoryMode.Showcase && styles.showcase
);

return (
Expand Down
5 changes: 4 additions & 1 deletion src/scripts/components/stories/story-video/story-video.styl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@require '../../../../variables.styl'

.storyVideo
padding: emCalc(80px) emCalc(56px)
padding: emCalc(50px) emCalc(56px)
background-color: $plainBlack

.presentationVideo
padding-bottom: 15vh
12 changes: 10 additions & 2 deletions src/scripts/components/stories/story-video/story-video.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
import React, {FunctionComponent} from 'react';
import {useSelector} from 'react-redux';
import cx from 'classnames';

import {languageSelector} from '../../../selectors/language';

import {StoryMode} from '../../../types/story-mode';

import styles from './story-video.styl';

interface Props {
videoId: string;
mode: StoryMode | null;
}

const StoryVideo: FunctionComponent<Props> = ({videoId}) => {
const StoryVideo: FunctionComponent<Props> = ({mode, videoId}) => {
const language = useSelector(languageSelector);
const classes = cx(
styles.storyVideo,
mode !== StoryMode.Stories && styles.presentationVideo
);

return (
<div className={styles.storyVideo}>
<div className={classes}>
<iframe
width="100%"
height="100%"
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/components/stories/story/story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const Story: FunctionComponent = () => {
/>
);
} else if (slide.type === SlideType.Video && slide.videoId) {
return <StoryVideo videoId={slide.videoId} />;
return <StoryVideo mode={mode} videoId={slide.videoId} />;
}

return (
Expand Down

0 comments on commit fed374b

Please sign in to comment.