summaryrefslogtreecommitdiff
path: root/frontend/views/page
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/views/page')
-rw-r--r--frontend/views/page/components/page.editor.js7
-rw-r--r--frontend/views/page/components/tile.form.js2
-rw-r--r--frontend/views/page/page.css5
-rw-r--r--frontend/views/page/page.reducer.js14
4 files changed, 23 insertions, 5 deletions
diff --git a/frontend/views/page/components/page.editor.js b/frontend/views/page/components/page.editor.js
index 297f7e7..3878208 100644
--- a/frontend/views/page/components/page.editor.js
+++ b/frontend/views/page/components/page.editor.js
@@ -158,7 +158,7 @@ class PageEditor extends Component {
}
render(){
- if (!this.state.bounds) {
+ if (!this.state.bounds || !this.props.page.show.res) {
return (
<div className='page' ref={this.pageRef} />
)
@@ -167,8 +167,9 @@ class PageEditor extends Component {
const currentTile = this.state.tile
const currentBox = this.state.box
const { res } = this.props.page.show
- return (
- <div className='page' ref={this.pageRef}>
+ const pageStyle = { backgroundColor: res.settings.background_color || '#000000' }
+ return (
+ <div className='page' ref={this.pageRef} style={pageStyle}>
{res.tiles.map(tile => {
if (temporaryTile && temporaryTile.id === tile.id) {
tile = temporaryTile
diff --git a/frontend/views/page/components/tile.form.js b/frontend/views/page/components/tile.form.js
index d570019..bfc5c0b 100644
--- a/frontend/views/page/components/tile.form.js
+++ b/frontend/views/page/components/tile.form.js
@@ -71,7 +71,7 @@ const newImage = (data) => ({
const newText = (data) => ({
settings: {
...newPosition(),
- content: "What is up... I have no idea actually",
+ content: "",
font_family: 'sans-serif',
font_size: 16,
font_style: 'normal',
diff --git a/frontend/views/page/page.css b/frontend/views/page/page.css
index 7747ddf..0005031 100644
--- a/frontend/views/page/page.css
+++ b/frontend/views/page/page.css
@@ -2,6 +2,11 @@
padding: 1rem;
}
+.page {
+ width: 100%;
+ height: 100%;
+}
+
.tile {
position: absolute;
diff --git a/frontend/views/page/page.reducer.js b/frontend/views/page/page.reducer.js
index 7bffe8e..2d80551 100644
--- a/frontend/views/page/page.reducer.js
+++ b/frontend/views/page/page.reducer.js
@@ -34,13 +34,25 @@ export default function pageReducer(state = initialState, action) {
}
case types.page.update:
+ console.log(action.data.res, state.show.res)
+ if (state.show.res && state.show.res.id === action.data.res.id) {
+ return {
+ ...state,
+ show: {
+ ...state.show,
+ res: {
+ ...action.data.res,
+ tiles: state.show.res.tiles,
+ }
+ }
+ }
+ }
return {
...state,
show: {
...state.show,
res: {
...action.data.res,
- tiles: state.show.res.tiles,
}
}
}