TagSpaces is an offline, open source, document manager with tagging support
added onboarding dialog
Ilian Sapundshievf801761c773d
diff --git a/app/app.global.css b/app/app.global.cssindex 3e50e8a2d..f4f11f5e5 100644--- a/app/app.global.css+++ b/app/app.global.css@@ -5,6 +5,8 @@@import "./assets/minireset.css";@import "./assets/rc-datetime.css";@import "~rc-table/assets/index.css";+@import "~slick-carousel/slick/slick.css";+@import "~slick-carousel/slick/slick-theme.css";/* Needed to disable border on focused HotKey element */diff --git a/app/components/WelcomePanel.js b/app/components/WelcomePanel.jsindex f2040baf2..53c300913 100644--- a/app/components/WelcomePanel.js+++ b/app/components/WelcomePanel.js@@ -36,6 +36,7 @@ import { withStyles } from '@material-ui/core/styles';// import ListItemIcon from '@material-ui/core/ListItemCore';// import ListItemText from '@material-ui/core/ListItemtext';// import ListSubheader from '@material-ui/core/ListSubheader';+import OnboardingDialog from './dialogs/OnboardingDialog'// import i18n from '../services/i18n';import { getLocations, type Location } from '../reducers/locations';@@ -66,20 +67,32 @@ type Props = {};type State = {- currentLocation?: Location+ currentLocation?: Location,+ isOboardingDialogVisible: boolean};class WelcomePanel extends React.Component<Props, State> {state = {currentLocation: null,+ isOboardingDialogVisible: false};+ toggleOnboarding = () => {+ this.setState({+ isOboardingDialogVisible: !this.state.isOboardingDialogVisible+ });+ }+render() {const { classes } = this.props;return (<div className={classes.mainPanel}><div className={classes.slogan}>- <img src={WelcomeLogo} alt="Organize your files" />+ <img src={WelcomeLogo} alt="Organize your files" onClick={this.toggleOnboarding} />+ <OnboardingDialog+ open={this.state.isOboardingDialogVisible}+ onClose={this.toggleOnboarding}+ /></div></div>);diff --git a/app/components/dialogs/OnboardingDialog.js b/app/components/dialogs/OnboardingDialog.jsnew file mode 100644index 000000000..3dfc6b2f4--- /dev/null+++ b/app/components/dialogs/OnboardingDialog.js@@ -0,0 +1,164 @@+/**+ * TagSpaces - universal file and folder organizer+ * Copyright (C) 2017-present TagSpaces UG (haftungsbeschraenkt)+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License (version 3) as+ * published by the Free Software Foundation.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ *+ * @flow+ */++import React from 'react';+import Button from '@material-ui/core/Button';+import DialogActions from '@material-ui/core/DialogActions';+import DialogContent from '@material-ui/core/DialogContent';+import DialogTitle from '@material-ui/core/DialogTitle';+import Paper from '@material-ui/core/Paper';+import Typography from '@material-ui/core/Typography';+import Card from '@material-ui/core/Card';+import CardActions from '@material-ui/core/CardActions';+import CardContent from '@material-ui/core/CardContent';+import Slider from "react-slick";+import withMobileDialog from '@material-ui/core/withMobileDialog';+import GenericDialog, { onEnterKeyHandler } from './GenericDialog';+import i18n from '../../services/i18n';+import { loadFileContentPromise } from '../../services/utils-io';+import { Pro } from '../../pro';++type Props = {+ open: boolean,+ onClose: () => void+};++type State = {+ license?: string+};++class OnboardingDialog extends React.Component<Props, State> {+ state = {+ license: ''+ };++ slideSettings = {+ className: '',+ dots: true,+ infinite: true,+ slidesToShow: 1,+ slidesToScroll: 1,+ adaptiveHeight: true+ };++ slider;++ showNext = () => {+ this.slider.slickNext();+ }++ showPrev = () => {+ this.slider.slickPrev();+ }++ renderTitle = () => <DialogTitle>Welcome to TagSpaces</DialogTitle>;++ renderContent = () => (+ <DialogContent style={{ height: 500, overflowX: 'hidden' }}>+ <Slider ref={slider => (this.slider = slider)} {...this.slideSettings}>+ <div style={{ height: 400, padding: 5 }}>+ <Paper elevation={1}>+ <Typography variant="h5" component="h3">+ This is a sheet of paper.+ </Typography>+ <Typography component="p">+ Paper can be used to build surface or other elements for your application.+ </Typography>+ </Paper>+ </div>+ <div style={{ height: 400 }}>+ <Card>+ <CardContent>+ <Typography color="textSecondary" gutterBottom>+ Word of the Day+ </Typography>+ <Typography variant="h5" component="h2">+ be+ asda+ nev+ aasdasd+ lent+ </Typography>+ <Typography color="textSecondary">+ adjective+ </Typography>+ <Typography component="p">+ well meaning and kindly.+ <br />+ {'"a benevolent smile"'}+ </Typography>+ </CardContent>+ <CardActions>+ <Button size="small">Learn More</Button>+ </CardActions>+ </Card>+ </div>+ <div style={{ height: 400 }}>+ <h3>3</h3>+ <p>See ....</p>+ <p>Height is adaptive</p>+ </div>+ <div style={{ height: 400 }}>+ <h3>4</h3>+ </div>+ </Slider>+ </DialogContent>+ );++ renderActions = () => (+ <DialogActions>+ <Button+ data-tid="confirmLicenseDialog"+ onClick={this.showPrev}+ color="primary"+ >+ Previous+ </Button>+ <Button+ data-tid="confirmLicenseDialog"+ onClick={this.showNext}+ color="primary"+ >+ Next+ </Button>+ <Button+ data-tid="confirmLicenseDialog"+ onClick={this.props.onClose}+ color="primary"+ >+ {i18n.t('core:closeButton')}+ </Button>+ </DialogActions>+ );++ render() {+ return (+ <GenericDialog+ open={this.props.open}+ onClose={this.props.onClose}+ // onEnterKey={(event) => onEnterKeyHandler(event, this.onConfirm)}+ renderTitle={this.renderTitle}+ renderContent={this.renderContent}+ renderActions={this.renderActions}+ />+ );+ }+}++export default withMobileDialog()(OnboardingDialog);diff --git a/package.json b/package.jsonindex 83fa90306..c40fddda6 100644--- a/package.json+++ b/package.json@@ -223,12 +223,14 @@"react-router-dom": "^4.3.1","react-router-redux": "^5.0.0-alpha.6","react-select": "^2.1.1",+ "react-slick": "^0.23.2","react-split-pane": "^0.1.84","redux": "^3.7.2","redux-persist": "^4.8.2","redux-thunk": "^2.2.0","remove-markdown": "^0.2.2","semver": "^5.5.0",+ "slick-carousel": "^1.8.1","source-map-support": "^0.5.6"},"devEngines": {diff --git a/yarn.lock b/yarn.lockindex d819708d9..593b64b70 100644--- a/yarn.lock+++ b/yarn.lock@@ -4504,6 +4504,11 @@ enhanced-resolve@~0.9.0:memory-fs "^0.2.0"tapable "^0.1.8"+enquire.js@^2.1.6:+ version "2.1.6"+ resolved "https://registry.yarnpkg.com/enquire.js/-/enquire.js-2.1.6.tgz#3e8780c9b8b835084c3f60e166dbc3c2a3c89814"+ integrity sha1-PoeAybi4NQhMP2DhZtvDwqPImBQ=+entities@^1.1.1, entities@~1.1.1:version "1.1.2"resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"@@ -7493,6 +7498,13 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1:resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=+json2mq@^0.2.0:+ version "0.2.0"+ resolved "https://registry.yarnpkg.com/json2mq/-/json2mq-0.2.0.tgz#b637bd3ba9eabe122c83e9720483aeb10d2c904a"+ integrity sha1-tje9O6nqvhIsg+lyBIOusQ0skEo=+ dependencies:+ string-convert "^0.2.0"+json3@^3.3.2:version "3.3.2"resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1"@@ -9995,6 +10007,11 @@ preserve@^0.2.0:resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=+prettier@^1.14.3:+ version "1.15.2"+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.15.2.tgz#d31abe22afa4351efa14c7f8b94b58bb7452205e"+ integrity sha512-YgPLFFA0CdKL4Eg2IHtUSjzj/BWgszDHiNQAe0VAIBse34148whfdzLagRL+QiKS+YfK5ftB6X4v/MBw8yCoug==+pretty-bytes@^1.0.2:version "1.0.4"resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84"@@ -10594,6 +10611,18 @@ react-select@^2.1.1:react-input-autosize "^2.2.1"react-transition-group "^2.2.1"+react-slick@^0.23.2:+ version "0.23.2"+ resolved "https://registry.yarnpkg.com/react-slick/-/react-slick-0.23.2.tgz#8d8bdbc77a6678e8ad36f50c32578c7c0f1c54f6"+ integrity sha512-fM6DXX7+22eOcYE9cgaXUfioZL/Zw6fwS6aPMDBt0kLHl4H4fFNEbp4JsJQdEWMLUNFtUytNcvd9KRml22Tp5w==+ dependencies:+ classnames "^2.2.5"+ enquire.js "^2.1.6"+ json2mq "^0.2.0"+ lodash.debounce "^4.0.8"+ prettier "^1.14.3"+ resize-observer-polyfill "^1.5.0"+react-split-pane@^0.1.84:version "0.1.84"resolved "https://registry.yarnpkg.com/react-split-pane/-/react-split-pane-0.1.84.tgz#b9c1499cbc40b09cf29953ee6f5ff1039d31906e"@@ -11232,6 +11261,11 @@ reselect@^3.0.1:resolved "https://registry.yarnpkg.com/reselect/-/reselect-3.0.1.tgz#efdaa98ea7451324d092b2b2163a6a1d7a9a2147"integrity sha1-79qpjqdFEyTQkrKyFjpqHXqaIUc=+resize-observer-polyfill@^1.5.0:+ version "1.5.0"+ resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.0.tgz#660ff1d9712a2382baa2cad450a4716209f9ca69"+ integrity sha512-M2AelyJDVR/oLnToJLtuDJRBBWUGUvvGigj1411hXhAdyFWqMaqHp7TixW3FpiLuVaikIcR1QL+zqoJoZlOgpg==+resolve-cwd@^2.0.0:version "2.0.0"resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"@@ -11712,6 +11746,11 @@ [email protected]:dependencies:is-fullwidth-code-point "^2.0.0"+slick-carousel@^1.8.1:+ version "1.8.1"+ resolved "https://registry.yarnpkg.com/slick-carousel/-/slick-carousel-1.8.1.tgz#a4bfb29014887bb66ce528b90bd0cda262cc8f8d"+ integrity sha512-XB9Ftrf2EEKfzoQXt3Nitrt/IPbT+f1fgqBdoxO3W/+JYvtEOW6EgxnWfr9GH6nmULv7Y2tPmEX3koxThVmebA==+slide@~1.1.3:version "1.1.6"resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707"@@ -12088,6 +12127,11 @@ strict-uri-encode@^1.0.0:resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=+string-convert@^0.2.0:+ version "0.2.1"+ resolved "https://registry.yarnpkg.com/string-convert/-/string-convert-0.2.1.tgz#6982cc3049fbb4cd85f8b24568b9d9bf39eeff97"+ integrity sha1-aYLMMEn7tM2F+LJFaLnZvznu/5c=+string-length@^2.0.0:version "2.0.0"resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed"