Skip to content

Commit 171ae4b

Browse files
committed
Return to previous page on TomogramView
1 parent dbe3d54 commit 171ae4b

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

app.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ var Matomo = MatomoReactRouter({
3232

3333
class App extends Component {
3434
render(){
35+
var matHistory = Matomo.connectToHistory(history);
3536
return(
36-
<Router history={Matomo.connectToHistory(history)}>
37-
<AppRoutes Core={Core} />
37+
<Router history={matHistory}>
38+
<AppRoutes Core={Core} history={matHistory} />
3839
</Router>
3940
)
4041
}

src/assets/css/jensen.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ div#return1 {
809809
margin-top: 20px;
810810
}
811811

812-
a.topretur {
812+
.topretur {
813813
color: #000;
814814
text-align: right;
815815
float: right;

src/components/appRoutes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AppRoutes extends Component {
2626
<Route path="/featured" exact render={props => <Featured Core={this.props.Core} {...props} />} />
2727
<Route path="/challenges" render={props => <Challenges Core={this.props.Core} {...props} />} />
2828
<Route path="/browse" render={props => <Browse Core={this.props.Core} {...props} />} />
29-
<Route path="/tomogram/:id" render={props => <TomogramView Core={this.props.Core} {...props} />} />
29+
<Route path="/tomogram/:id" render={props => <TomogramView Core={this.props.Core} history={this.props.history} {...props} />} />
3030
<Route path="/featured/:id" render={props => <FeaturedCollection Core={this.props.Core} {...props} />} />
3131
<Route path="/terms" render={props => <TermsAndConditions Core={this.props.Core} {...props} />} />
3232

src/components/tomogramView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class TomogramView extends Component {
155155
<div id="reddiv"> </div>
156156
</div>
157157
<div className="col-sm-6">
158-
<div id="return1"> <a className="topretur" href="/browse"><i class="fas fa-arrow-left"></i> Return to database</a></div>
158+
<div id="return1"> <button className="topretur" onClick={() => this.props.history.goBack()}><i class="fas fa-arrow-left"></i> Return to database</button></div>
159159
<div id="share">
160160
<p>
161161
<b>Share:</b>

0 commit comments

Comments
 (0)