Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#624 welcome tutorial #404

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/gdl-frontend/components/GlobalMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import OnlineStatusContext from '../OnlineStatusContext';
import SelectBookLanguage from './SelectBookLanguage';
import CategoriesMenu from './CategoriesMenu';
import offlineLibrary from '../../lib/offlineLibrary';
import WelcomeTutorial from '../WelcomeTutorial/WelcomeTutorial';

type Props = {|
onClose(): void,
Expand Down Expand Up @@ -71,7 +72,7 @@ class GlobalMenu extends React.Component<Props, State> {
onOpen={() => {}}
PaperProps={{
style: {
// By setting variant="temporary" a borde right is applied. Which is why it setting it to "inherit" removes it
// By setting variant="temporary" a border right is applied. Which is why it setting it to "inherit" removes it
borderRight: 'inherit'
}
}}
Expand Down Expand Up @@ -163,6 +164,13 @@ class GlobalMenu extends React.Component<Props, State> {
</ListItem>
</RouteLink>
)}
<div onClick={this.disableSwipe}>
<WelcomeTutorial
shouldOpen={false}
listButton={true}
swipeable={this.enableSwipe}
/>
</div>
{online && (
<>
<RouteLink passHref route="translations">
Expand All @@ -182,6 +190,7 @@ class GlobalMenu extends React.Component<Props, State> {
</ListItemText>
</ListItem>
</RouteLink>

<QueryIsAdmin skip={!this.props.isOpen}>
{({ isAdmin }) =>
isAdmin && (
Expand Down
82 changes: 82 additions & 0 deletions packages/gdl-frontend/components/WelcomeTutorial/DialogContent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
//@flow
import React from 'react';
import DialogContent from '@material-ui/core/DialogContent';
import { Card, CardContent } from '@material-ui/core';

type Props = {
screenshotUrlM: string,
screenshotUrl: string,
graceImgUrl: string,
message: string,
fullscreen: boolean
};

class GetDialogContent extends React.Component<Props> {
render() {
return (
<DialogContent
style={{
display: 'flex',
flexDirection: 'column',
justifyContent: 'space-around',
height: '100%'
}}
>
<div
style={
this.props.fullscreen ? { display: 'flex' } : { height: '270px' }
}
>
<img
src={
this.props.fullscreen
? this.props.screenshotUrlM
: this.props.screenshotUrl
}
alt="screenshot from the page"
style={{ width: '100%' }}
/>
</div>
<div style={{ display: 'flex', flexDirection: 'row', marginTop: 10 }}>
<img
style={{ maxHeight: 170 }}
src={this.props.graceImgUrl}
alt="Grace"
/>
<Card style={{ marginLeft: '15px', width: '100%' }}>
<CardContent
style={{
display: 'table',
height: '100%',
width: '100%',
padding: 0
}}
>
<p
style={
this.props.fullscreen
camilve marked this conversation as resolved.
Show resolved Hide resolved
? {
fontSize: '14px',
textAlign: 'center',
verticalAlign: 'middle',
display: 'table-cell'
}
: {
fontSize: '16px',
textAlign: 'center',
verticalAlign: 'middle',
display: 'table-cell'
}
}
>
{this.props.message}
</p>
</CardContent>
</Card>
</div>
</DialogContent>
);
}
}

export default GetDialogContent;
Loading