2020-07-16 04:36:29 +03:00
import * as React from "react" ;
2020-08-12 11:34:17 +03:00
import * as Constants from "~/common/constants" ;
2020-07-16 04:36:29 +03:00
import * as System from "~/components/system" ;
import { css } from "@emotion/react" ;
import ScenePage from "~/components/core/ScenePage" ;
2020-07-27 11:33:39 +03:00
import Section from "~/components/core/Section" ;
2020-07-16 04:36:29 +03:00
2020-08-12 11:34:17 +03:00
const STYLES _NUMBER = css `
font - family : $ { Constants . font . semiBold } ;
font - weight : 400 ;
` ;
2020-07-27 06:20:34 +03:00
// TODO(jim): Slates design.
2020-07-16 04:36:29 +03:00
export default class SceneSlates extends React . Component {
render ( ) {
2020-07-27 11:33:39 +03:00
// TODO(jim): Refactor later.
const slates = {
columns : [
2020-07-27 12:50:25 +03:00
{
key : "slatename" ,
name : "Slate Name" ,
2020-08-12 11:34:17 +03:00
width : "100%" ,
2020-07-27 12:50:25 +03:00
type : "SLATE_LINK" ,
} ,
{ key : "url" , name : "URL" , width : "268px" , type : "NEW_WINDOW" } ,
2020-08-12 11:34:17 +03:00
{ key : "id" , id : "id" , name : "Slate ID" , width : "296px" } ,
{
key : "objects" ,
name : "Objects" ,
} ,
2020-07-27 11:33:39 +03:00
{
key : "public" ,
name : "Public" ,
type : "SLATE_PUBLIC_TEXT_TAG" ,
width : "188px" ,
} ,
] ,
rows : this . props . viewer . slates . map ( ( each ) => {
return {
... each ,
2020-08-12 11:34:17 +03:00
url : ` https://slate.host/ ${ this . props . viewer . username } / ${ each . slatename } ` ,
2020-07-27 12:10:12 +03:00
public : each . data . public ,
2020-08-12 11:34:17 +03:00
objects : < span css = { STYLES _NUMBER } > { each . data . objects . length } < / s p a n > ,
2020-07-27 11:33:39 +03:00
} ;
} ) ,
} ;
// TODO(jim): Refactor later.
2020-08-12 11:34:17 +03:00
const slateButtons = [ { name : "Create slate" , type : "SIDEBAR" , value : "SIDEBAR_CREATE_SLATE" } ] ;
2020-07-27 11:33:39 +03:00
return (
< ScenePage >
2020-08-02 09:41:18 +03:00
< System . DescriptionGroup
label = "Will the Slates page look like this in the final product?"
description = "No! Consider this page just a functionality test. Slates will be collaborative mood boards and will have a much more intuitive experience than this."
/ >
< System . H1 style = { { marginTop : 48 } } > Slates < / S y s t e m . H 1 >
2020-08-12 11:34:17 +03:00
< Section title = "Slates" buttons = { slateButtons } onAction = { this . props . onAction } >
2020-07-27 11:33:39 +03:00
< System . Table
data = { slates }
name = "slate"
onAction = { this . props . onAction }
onNavigateTo = { this . props . onNavigateTo }
/ >
< / S e c t i o n >
< / S c e n e P a g e >
) ;
2020-07-16 04:36:29 +03:00
}
}