summaryrefslogtreecommitdiff
path: root/frontend/app/views/tile/handles/tile.link.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/views/tile/handles/tile.link.js')
-rw-r--r--frontend/app/views/tile/handles/tile.link.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/frontend/app/views/tile/handles/tile.link.js b/frontend/app/views/tile/handles/tile.link.js
new file mode 100644
index 0000000..4dd4fd4
--- /dev/null
+++ b/frontend/app/views/tile/handles/tile.link.js
@@ -0,0 +1,33 @@
+import React from 'react'
+import { generateTransform, unitsDimension } from 'app/views/tile/tile.utils'
+
+export default function TileScript({ tile, box, bounds, videoBounds, viewing, onMouseDown, onDoubleClick }) {
+ // console.log(tile)
+ const style = {
+ transform: generateTransform(tile, box, bounds, videoBounds),
+ opacity: tile.settings.opacity,
+ }
+ // console.log(generateTransform(tile))
+ let className = ['tile', tile.type].join(' ')
+ if (tile.target_page_id || (viewing && tile.href)) {
+ if (viewing || tile.settings.cursor !== 'unclickable') {
+ className += ' ' + (tile.settings.cursor || 'hand_up')
+ }
+ }
+
+ let content = ""
+ className += ' ' + tile.settings.align
+ style.width = unitsDimension(tile, 'width', bounds, videoBounds)
+ style.height = unitsDimension(tile, 'height', bounds, videoBounds)
+
+ return (
+ <div
+ className={className}
+ onMouseDown={onMouseDown}
+ onDoubleClick={onDoubleClick}
+ style={style}
+ >
+ {content}
+ </div>
+ )
+}