Scss #471

Merged
bones7242 merged 25 commits from scss into master 2018-06-12 01:00:38 +02:00
27 changed files with 160 additions and 163 deletions
Showing only changes of commit 857ae03b32 - Show all commits

View file

@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var AboutSpeechTwo = function AboutSpeechTwo() {
return _react.default.createElement("div", null, _react.default.createElement("p", null, "Spee.ch is a media-hosting site that reads from and publishes content to the ", _react.default.createElement("a", {
className: "link--primary",
href: "https://lbry.io"
}, "LBRY"), " blockchain."), _react.default.createElement("p", null, "Spee.ch is a hosting service, but with the added benefit that it stores your content on a decentralized network of computers -- the ", _react.default.createElement("a", {
className: "link--primary",
href: "https://lbry.io/get"
}, "LBRY"), " network. This means that your images are stored in multiple locations without a single point of failure."), _react.default.createElement("h3", null, "Contribute"), _react.default.createElement("p", null, "If you have an idea for your own spee.ch-like site on top of LBRY, fork our ", _react.default.createElement("a", {
className: "link--primary",
href: "https://github.com/lbryio/spee.ch"
}, "github repo"), " and go to town!"), _react.default.createElement("p", null, "If you want to improve spee.ch, join our ", _react.default.createElement("a", {
className: "link--primary",
href: "https://chat.lbry.io"
}, "discord channel"), " or solve one of our ", _react.default.createElement("a", {
className: "link--primary",
href: "https://github.com/lbryio/spee.ch/issues"
}, "github issues"), "."));
};
var _default = AboutSpeechTwo;
exports.default = _default;

View file

@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var AboutSpeechOne = function AboutSpeechOne() {
return _react.default.createElement("div", null, _react.default.createElement("p", {
className: "pull-quote"
}, "Spee.ch is an open-source project. Please contribute to the existing site, or fork it and make your own."), _react.default.createElement("p", null, _react.default.createElement("a", {
className: "link--primary",
target: "_blank",
href: "https://twitter.com/spee_ch"
}, "TWITTER")), _react.default.createElement("p", null, _react.default.createElement("a", {
className: "link--primary",
target: "_blank",
href: "https://github.com/lbryio/spee.ch"
}, "GITHUB")), _react.default.createElement("p", null, _react.default.createElement("a", {
className: "link--primary",
target: "_blank",
href: "https://discord.gg/YjYbwhS"
}, "DISCORD CHANNEL")), _react.default.createElement("p", null, _react.default.createElement("a", {
className: "link--primary",
target: "_blank",
href: "https://github.com/lbryio/spee.ch/blob/master/README.md"
}, "DOCUMENTATION")));
};
var _default = AboutSpeechOne;
exports.default = _default;

View file

@ -5,19 +5,50 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.default = void 0; exports.default = void 0;
var _reactRedux = require("react-redux"); var _react = _interopRequireDefault(require("react"));
var _view = _interopRequireDefault(require("./view")); var _reactRouterDom = require("react-router-dom");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mapStateToProps = function mapStateToProps(_ref) { var AssetPreview = function AssetPreview(_ref) {
var defaultThumbnail = _ref.site.defaultThumbnail; var defaultThumbnail = _ref.defaultThumbnail,
return { _ref$claimData = _ref.claimData,
defaultThumbnail: defaultThumbnail name = _ref$claimData.name,
}; claimId = _ref$claimData.claimId,
fileExt = _ref$claimData.fileExt,
contentType = _ref$claimData.contentType,
thumbnail = _ref$claimData.thumbnail;
var directSourceLink = "".concat(claimId, "/").concat(name, ".").concat(fileExt);
var showUrlLink = "/".concat(claimId, "/").concat(name);
return _react.default.createElement("div", {
className: "asset-preview-holder"
}, _react.default.createElement(_reactRouterDom.Link, {
to: showUrlLink
}, function () {
switch (contentType) {
case 'image/jpeg':
case 'image/jpg':
case 'image/png':
case 'image/gif':
return _react.default.createElement("img", {
className: 'asset-preview-image',
src: directSourceLink,
alt: name
});
case 'video/mp4':
return _react.default.createElement("img", {
className: 'asset-preview-video',
src: thumbnail || defaultThumbnail,
alt: name
});
default:
return _react.default.createElement("p", null, "unsupported file type");
}
}()));
}; };
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default); var _default = AssetPreview;
exports.default = _default; exports.default = _default;

View file

@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.default = void 0; exports.default = void 0;
var style = { var style = {
margin: '1em', margin: '2em',
backgroundColor: 'red' backgroundColor: 'red'
}; };
var _default = style; var _default = style;

View file

@ -60,9 +60,7 @@ function (_React$Component) {
contentType = _this$props$asset$cla2.contentType, contentType = _this$props$asset$cla2.contentType,
fileExt = _this$props$asset$cla2.fileExt, fileExt = _this$props$asset$cla2.fileExt,
thumbnail = _this$props$asset$cla2.thumbnail; thumbnail = _this$props$asset$cla2.thumbnail;
return _react.default.createElement("div", { return _react.default.createElement("div", null, status === _asset_display_states.LOCAL_CHECK && _react.default.createElement("div", null, _react.default.createElement("p", null, "Checking to see if Spee.ch has your asset locally...")), status === _asset_display_states.UNAVAILABLE && _react.default.createElement("div", null, _react.default.createElement("p", null, "Sit tight, we're searching the LBRY blockchain for your asset!"), _react.default.createElement(_ProgressBar.default, {
id: "asset-display-component"
}, status === _asset_display_states.LOCAL_CHECK && _react.default.createElement("div", null, _react.default.createElement("p", null, "Checking to see if Spee.ch has your asset locally...")), status === _asset_display_states.UNAVAILABLE && _react.default.createElement("div", null, _react.default.createElement("p", null, "Sit tight, we're searching the LBRY blockchain for your asset!"), _react.default.createElement(_ProgressBar.default, {
size: 12 size: 12
}), _react.default.createElement("p", null, "Curious what magic is happening here? ", _react.default.createElement("a", { }), _react.default.createElement("p", null, "Curious what magic is happening here? ", _react.default.createElement("a", {
className: "link--primary", className: "link--primary",
@ -79,22 +77,16 @@ function (_React$Component) {
case 'image/jpeg': case 'image/jpeg':
case 'image/jpg': case 'image/jpg':
case 'image/png': case 'image/png':
return _react.default.createElement("img", {
className: "asset",
src: "/".concat(claimId, "/").concat(name, ".").concat(fileExt),
alt: name
});
case 'image/gif': case 'image/gif':
return _react.default.createElement("img", { return _react.default.createElement("img", {
className: "asset", className: "asset-image",
src: "/".concat(claimId, "/").concat(name, ".").concat(fileExt), src: "/".concat(claimId, "/").concat(name, ".").concat(fileExt),
alt: name alt: name
}); });
case 'video/mp4': case 'video/mp4':
return _react.default.createElement("video", { return _react.default.createElement("video", {
className: "asset video", className: "asset-video",
controls: true, controls: true,
poster: thumbnail poster: thumbnail
}, _react.default.createElement("source", { }, _react.default.createElement("source", {

View file

@ -1,23 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _reactRedux = require("react-redux");
var _view = _interopRequireDefault(require("./view"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mapStateToProps = function mapStateToProps(_ref) {
var defaultThumbnail = _ref.site.defaultThumbnail;
return {
defaultThumbnail: defaultThumbnail
};
};
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default);
exports.default = _default;

View file

@ -1,54 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactRouterDom = require("react-router-dom");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var AssetPreview = function AssetPreview(_ref) {
var defaultThumbnail = _ref.defaultThumbnail,
_ref$claimData = _ref.claimData,
name = _ref$claimData.name,
claimId = _ref$claimData.claimId,
fileExt = _ref$claimData.fileExt,
contentType = _ref$claimData.contentType,
thumbnail = _ref$claimData.thumbnail;
var directSourceLink = "".concat(claimId, "/").concat(name, ".").concat(fileExt);
var showUrlLink = "/".concat(claimId, "/").concat(name);
return _react.default.createElement("div", {
className: "asset-preview-holder"
}, _react.default.createElement(_reactRouterDom.Link, {
to: showUrlLink
}, function () {
switch (contentType) {
case 'image/jpeg':
case 'image/jpg':
case 'image/png':
case 'image/gif':
return _react.default.createElement("img", {
className: 'asset-preview-image',
src: directSourceLink,
alt: name
});
case 'video/mp4':
return _react.default.createElement("img", {
className: 'asset-preview-video',
src: thumbnail || defaultThumbnail,
alt: name
});
default:
return _react.default.createElement("p", null, "unsupported file type");
}
}()));
};
var _default = AssetPreview;
exports.default = _default;

View file

@ -14,7 +14,8 @@ var _view = _interopRequireDefault(require("./view"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mapStateToProps = function mapStateToProps(_ref) { var mapStateToProps = function mapStateToProps(_ref) {
var show = _ref.show; var show = _ref.show,
defaultThumbnail = _ref.site.defaultThumbnail;
// select channel key // select channel key
var request = show.requestList[show.request.id]; var request = show.requestList[show.request.id];
var channelKey = request.key; // select channel claims var channelKey = request.key; // select channel claims
@ -23,7 +24,8 @@ var mapStateToProps = function mapStateToProps(_ref) {
return { return {
channelKey: channelKey, channelKey: channelKey,
channel: channel channel: channel,
defaultThumbnail: defaultThumbnail
}; };
}; };

View file

@ -70,14 +70,17 @@ function (_React$Component) {
}, { }, {
key: "render", key: "render",
value: function render() { value: function render() {
var _this$props$channel$c = this.props.channel.claimsData, var _this$props2 = this.props,
claims = _this$props$channel$c.claims, _this$props2$channel$ = _this$props2.channel.claimsData,
currentPage = _this$props$channel$c.currentPage, claims = _this$props2$channel$.claims,
totalPages = _this$props$channel$c.totalPages; currentPage = _this$props2$channel$.currentPage,
totalPages = _this$props2$channel$.totalPages,
defaultThumbnail = _this$props2.defaultThumbnail;
return _react.default.createElement("div", { return _react.default.createElement("div", {
className: "row row--tall" className: "row row--tall"
}, claims.length > 0 ? _react.default.createElement("div", null, claims.map(function (claim, index) { }, claims.length > 0 ? _react.default.createElement("div", null, claims.map(function (claim, index) {
return _react.default.createElement(_AssetPreview.default, { return _react.default.createElement(_AssetPreview.default, {
defaultThumbnail: defaultThumbnail,
claimData: claim, claimData: claim,
key: "".concat(claim.name, "-").concat(index) key: "".concat(claim.name, "-").concat(index)
}); });

View file

@ -11,9 +11,9 @@ var _PageLayout = _interopRequireDefault(require("@components/PageLayout"));
var _HorizontalSplit = _interopRequireDefault(require("@components/HorizontalSplit")); var _HorizontalSplit = _interopRequireDefault(require("@components/HorizontalSplit"));
var _AboutSpeechOne = _interopRequireDefault(require("@components/AboutSpeechOne")); var _AboutSpeechOverview = _interopRequireDefault(require("@components/AboutSpeechOverview"));
var _AboutSpeechTwo = _interopRequireDefault(require("@components/AboutSpeechTwo")); var _AboutSpeechDetails = _interopRequireDefault(require("@components/AboutSpeechDetails"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@ -51,8 +51,8 @@ function (_React$Component) {
pageTitle: 'About', pageTitle: 'About',
pageUri: 'about' pageUri: 'about'
}, _react.default.createElement(_HorizontalSplit.default, { }, _react.default.createElement(_HorizontalSplit.default, {
leftSide: _react.default.createElement(_AboutSpeechOne.default, null), leftSide: _react.default.createElement(_AboutSpeechOverview.default, null),
rightSide: _react.default.createElement(_AboutSpeechTwo.default, null) rightSide: _react.default.createElement(_AboutSpeechDetails.default, null)
})); }));
} }
}]); }]);

12
client/scss/_asset.scss Normal file
View file

@ -0,0 +1,12 @@
.asset-image, .asset-video {
width: 100%;
margin : 0px
}
.show-lite-container {
.asset-image, .asset-video {
max-height: calc(100vh - 3em);
max-width: 100vw;
}
}

View file

@ -13,12 +13,12 @@
@import '_button'; @import '_button';
@import '_span'; @import '_span';
@import '_video'; @import '_video';
@import 'containers/_nav-bar.scss'; @import 'asset';
@import 'containers/_dropzone.scss'; @import 'asset-preview';
@import 'containers/_asset-preview.scss'; @import 'dropzone';
@import 'containers/_show-asset-lite.scss'; @import 'nav-bar';
@import 'components/_progress-bar'; @import 'progress-bar';
@import 'components/_publish-preview'; @import 'publish-preview';
@import 'media-queries'; @import 'media-queries';

View file

@ -1,20 +0,0 @@
.show-lite-container {
text-align: center;
}
.show-lite-container #asset-display-component {
max-height: calc(100vh - 3em);
}
.show-details-container #asset-display-component .asset {
width: 100%
}
.show-lite-container #asset-display-component .asset {
max-height: calc(100vh - 3em);
max-width: 100vw;
}
#asset-boilerplate {
max-height: 3em;
}

View file

@ -1,5 +1,5 @@
const style = { const style = {
margin : '1em', margin : '2em',
backgroundColor: 'red', backgroundColor: 'red',
}; };

View file

@ -10,7 +10,7 @@ class AssetDisplay extends React.Component {
render () { render () {
const { status, error, asset: { claimData: { name, claimId, contentType, fileExt, thumbnail } } } = this.props; const { status, error, asset: { claimData: { name, claimId, contentType, fileExt, thumbnail } } } = this.props;
return ( return (
<div id='asset-display-component'> <div>
{(status === LOCAL_CHECK) && {(status === LOCAL_CHECK) &&
<div> <div>
<p>Checking to see if Spee.ch has your asset locally...</p> <p>Checking to see if Spee.ch has your asset locally...</p>
@ -35,26 +35,21 @@ class AssetDisplay extends React.Component {
case 'image/jpeg': case 'image/jpeg':
case 'image/jpg': case 'image/jpg':
case 'image/png': case 'image/png':
return (
<img
className='asset'
src={`/${claimId}/${name}.${fileExt}`}
alt={name} />
);
case 'image/gif': case 'image/gif':
return ( return (
<img <img
className='asset' className='asset-image'
src={`/${claimId}/${name}.${fileExt}`} src={`/${claimId}/${name}.${fileExt}`}
alt={name} alt={name}
/> />
); );
case 'video/mp4': case 'video/mp4':
return ( return (
<video className='asset video' controls poster={thumbnail}> <video
<source className='asset-video'
src={`/${claimId}/${name}.${fileExt}`} controls poster={thumbnail}
/> >
<source src={`/${claimId}/${name}.${fileExt}`} />
<p>Your browser does not support the <code>video</code> element.</p> <p>Your browser does not support the <code>video</code> element.</p>
</video> </video>
); );

View file

@ -1,10 +0,0 @@
import { connect } from 'react-redux';
import View from './view';
const mapStateToProps = ({site: { defaultThumbnail }}) => {
return {
defaultThumbnail,
};
};
export default connect(mapStateToProps, null)(View);

View file

@ -2,7 +2,7 @@ import { connect } from 'react-redux';
import { onUpdateChannelClaims } from '../../actions/show'; import { onUpdateChannelClaims } from '../../actions/show';
import View from './view'; import View from './view';
const mapStateToProps = ({ show }) => { const mapStateToProps = ({ show, site: { defaultThumbnail } }) => {
// select channel key // select channel key
const request = show.requestList[show.request.id]; const request = show.requestList[show.request.id];
const channelKey = request.key; const channelKey = request.key;
@ -12,6 +12,7 @@ const mapStateToProps = ({ show }) => {
return { return {
channelKey, channelKey,
channel, channel,
defaultThumbnail,
}; };
}; };

View file

@ -22,12 +22,13 @@ class ChannelClaimsDisplay extends React.Component {
this.props.onUpdateChannelClaims(channelKey, name, longId, page); this.props.onUpdateChannelClaims(channelKey, name, longId, page);
} }
render () { render () {
const { channel: { claimsData: { claims, currentPage, totalPages } } } = this.props; const { channel: { claimsData: { claims, currentPage, totalPages } }, defaultThumbnail } = this.props;
return ( return (
<div className='row row--tall'> <div className='row row--tall'>
{(claims.length > 0) ? ( {(claims.length > 0) ? (
<div> <div>
{claims.map((claim, index) => <AssetPreview {claims.map((claim, index) => <AssetPreview
defaultThumbnail={defaultThumbnail}
claimData={claim} claimData={claim}
key={`${claim.name}-${index}`} key={`${claim.name}-${index}`}
/>)} />)}

View file

@ -1,16 +1,16 @@
import React from 'react'; import React from 'react';
import PageLayout from '@components/PageLayout'; import PageLayout from '@components/PageLayout';
import HorizontalSplit from '@components/HorizontalSplit'; import HorizontalSplit from '@components/HorizontalSplit';
import AboutSpeechOne from '@components/AboutSpeechOne'; import AboutSpeechOverview from '@components/AboutSpeechOverview';
import AboutSpeechTwo from '@components/AboutSpeechTwo'; import AboutSpeechDetails from '@components/AboutSpeechDetails';
class AboutPage extends React.Component { class AboutPage extends React.Component {
render () { render () {
return ( return (
<PageLayout pageTitle={'About'} pageUri={'about'} > <PageLayout pageTitle={'About'} pageUri={'about'} >
<HorizontalSplit <HorizontalSplit
leftSide={<AboutSpeechOne />} leftSide={<AboutSpeechOverview />}
rightSide={<AboutSpeechTwo />} rightSide={<AboutSpeechDetails />}
/> />
</PageLayout> </PageLayout>
); );