summaryrefslogtreecommitdiff
path: root/frontend/views
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-07-11 00:50:00 +0200
committerJules Laplace <julescarbon@gmail.com>2020-07-11 00:50:00 +0200
commit91e8fdb99e321496c54288fe5a3db6397c768c10 (patch)
tree2bb82323466c7895eb705138e561278b02ce8ca2 /frontend/views
parent2001ddd7e2a8926ec97fdd4d5c73b2d4e5b293de (diff)
building basic site. need to include cursors, etc
Diffstat (limited to 'frontend/views')
-rw-r--r--frontend/views/page/components/tile.handle.js37
1 files changed, 26 insertions, 11 deletions
diff --git a/frontend/views/page/components/tile.handle.js b/frontend/views/page/components/tile.handle.js
index dd89282..f3a700b 100644
--- a/frontend/views/page/components/tile.handle.js
+++ b/frontend/views/page/components/tile.handle.js
@@ -1,6 +1,7 @@
import React, { Component } from 'react'
+import { Link } from 'react-router-dom'
-const TileHandle = ({ tile, bounds, box, onMouseDown, onDoubleClick }) => {
+const TileHandle = ({ tile, bounds, box, viewing, onMouseDown, onDoubleClick }) => {
// console.log(tile)
const { width, height } = tile.settings
const style = {
@@ -66,16 +67,30 @@ const TileHandle = ({ tile, bounds, box, onMouseDown, onDoubleClick }) => {
style.height = tile.settings.height ? tile.settings.height + 'px' : 'auto'
break
}
- return (
- <div
- className={className}
- onMouseDown={onMouseDown}
- onDoubleClick={onDoubleClick}
- style={style}
- >
- {content}
- </div>
- )
+ if (viewing && tile.href) {
+ return (
+ <Link to={tile.href}>
+ <div
+ className={className}
+ onMouseDown={onMouseDown}
+ style={style}
+ >
+ {content}
+ </div>
+ </Link>
+ )
+ } else {
+ return (
+ <div
+ className={className}
+ onMouseDown={onMouseDown}
+ onDoubleClick={onDoubleClick}
+ style={style}
+ >
+ {content}
+ </div>
+ )
+ }
}
const generateTransform = (tile, box) => {