React router #343

Merged
bones7242 merged 96 commits from react-router into master 2018-02-15 08:02:17 +01:00
2 changed files with 17 additions and 5 deletions
Showing only changes of commit a5f383aff8 - Show all commits

View file

@ -1,7 +1,9 @@
neb-b commented 2018-02-05 20:38:50 +01:00 (Migrated from github.com)
Review

Any reason these aren't just css?

Any reason these aren't just css?
bones7242 commented 2018-02-07 07:28:57 +01:00 (Migrated from github.com)
Review

oops

oops
neb-b commented 2018-02-05 20:38:50 +01:00 (Migrated from github.com)
Review

Any reason these aren't just css?

Any reason these aren't just css?
bones7242 commented 2018-02-07 07:28:57 +01:00 (Migrated from github.com)
Review

oops

oops
import React from 'react';
import { Link } from 'react-router-dom';
neb-b commented 2018-02-05 20:38:50 +01:00 (Migrated from github.com)
Review

Any reason these aren't just css?

Any reason these aren't just css?
bones7242 commented 2018-02-07 07:28:57 +01:00 (Migrated from github.com)
Review

oops

oops
const AssetPreview = ({ name, claimId, fileExt, contentType }) => {
const directSourceLink = `${claimId}/${name}.${fileExt}`;
const showUrlLink = `${claimId}/${name}`;
neb-b commented 2018-02-05 20:38:50 +01:00 (Migrated from github.com)
Review

Any reason these aren't just css?

Any reason these aren't just css?
bones7242 commented 2018-02-07 07:28:57 +01:00 (Migrated from github.com)
Review

oops

oops
const previewHolderStyle = {
clear: 'both',
display: 'inline-block',
@ -21,7 +23,9 @@ const AssetPreview = ({ name, claimId, fileExt, contentType }) => {
neb-b commented 2018-02-05 20:38:50 +01:00 (Migrated from github.com)
Review

Any reason these aren't just css?

Any reason these aren't just css?
bones7242 commented 2018-02-07 07:28:57 +01:00 (Migrated from github.com)
Review

oops

oops
neb-b commented 2018-02-05 20:38:50 +01:00 (Migrated from github.com)
Review

Any reason these aren't just css?

Any reason these aren't just css?
bones7242 commented 2018-02-07 07:28:57 +01:00 (Migrated from github.com)
Review

oops

oops
case 'image/png':
return (
<div style={previewHolderStyle}>
<img style={assetStyle} className={'asset-preview--image'} src={directSourceLink} alt={name} />
neb-b commented 2018-02-05 20:38:50 +01:00 (Migrated from github.com)
Review

Any reason these aren't just css?

Any reason these aren't just css?
bones7242 commented 2018-02-07 07:28:57 +01:00 (Migrated from github.com)
Review

oops

oops
<Link to={showUrlLink} >
neb-b commented 2018-02-05 20:38:50 +01:00 (Migrated from github.com)
Review

Any reason these aren't just css?

Any reason these aren't just css?
bones7242 commented 2018-02-07 07:28:57 +01:00 (Migrated from github.com)
Review

oops

oops
<img style={assetStyle} className={'asset-preview--image'} src={directSourceLink} alt={name} />
neb-b commented 2018-02-05 20:38:50 +01:00 (Migrated from github.com)
Review

Any reason these aren't just css?

Any reason these aren't just css?
bones7242 commented 2018-02-07 07:28:57 +01:00 (Migrated from github.com)
Review

oops

oops
</Link>
neb-b commented 2018-02-05 20:38:50 +01:00 (Migrated from github.com)
Review

Any reason these aren't just css?

Any reason these aren't just css?
bones7242 commented 2018-02-07 07:28:57 +01:00 (Migrated from github.com)
Review

oops

oops
</div>
);
case 'image/gif':

neb-b commented 2018-02-05 20:38:50 +01:00 (Migrated from github.com)
Review

Any reason these aren't just css?

Any reason these aren't just css?
bones7242 commented 2018-02-07 07:28:57 +01:00 (Migrated from github.com)
Review

oops

oops
neb-b commented 2018-02-05 20:38:50 +01:00 (Migrated from github.com)
Review

Any reason these aren't just css?

Any reason these aren't just css?
bones7242 commented 2018-02-07 07:28:57 +01:00 (Migrated from github.com)
Review

oops

oops

View file

@ -20,17 +20,25 @@ class ShowPage extends React.Component {
}
componentDidMount () {
console.log('ShowPage did mount');
this.parseUrlAndUpdateState();
}
parseUrlAndUpdateState () {
const identifier = this.props.match.params.identifier;
const claim = this.props.match.params.claim;
this.parseUrlAndUpdateState(identifier, claim);
}
componentWillReceiveProps (nextProps) {
if (this.props.match.params !== nextProps.match.params) {
console.log('received new params props');
const identifier = nextProps.match.params.identifier;
const claim = nextProps.match.params.claim;
this.parseUrlAndUpdateState(identifier, claim);
}
}
parseUrlAndUpdateState (identifier, claim) {
if (identifier) {
return this.parseAndUpdateIdentifierAndClaim(identifier, claim);
}
this.parseAndUpdateClaimOnly(claim);
}
parseAndUpdateIdentifierAndClaim(identifier, claim) {
parseAndUpdateIdentifierAndClaim (identifier, claim) {
// handle case of identifier and claim
// this is a request for an asset
// claim will be an asset claim