I hereby claim:
- I am ksaldana1 on github.
- I am ksaldana (https://keybase.io/ksaldana) on keybase.
- I have a public key ASBUNkRku9I4HSFgickNwlwMqY1Pr3Qo8ZQa-klYe3bumAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
type Query { | |
messages: [Message!]! | |
} | |
type Message { | |
id: ID! | |
text: String! | |
author: MessageAuthor! | |
} |
module Styles = { | |
open Css; | |
let app = | |
style([ | |
display(`flex), | |
justifyContent(`center), | |
alignItems(`center), | |
flexDirection(`column), | |
minHeight(`vh(100.0)), |
module Styles = { | |
open Css; | |
let app = | |
style([ | |
display(`flex), | |
justifyContent(`center), | |
alignItems(`center), | |
flexDirection(`column), | |
minHeight(`vh(100.0)), |
module Styles = { | |
open Css; | |
let app = | |
style([ | |
display(`flex), | |
justifyContent(`center), | |
alignItems(`center), | |
flexDirection(`column), | |
minHeight(`vh(100.0)), |
[@react.component] | |
let make = () => { | |
let query = Query.use(~variables=(), ()); | |
<div className=Styles.app> | |
{Belt.Array.map(query.messages, message => { | |
switch (message.author) { | |
| `User(user) => | |
<div> {React.string(user.name ++ ": " ++ message.text)} </div> | |
| `Guest(guest) => | |
<div> |
module Styles = { | |
open Css; | |
let app = | |
style([ | |
display(`flex), | |
justifyContent(`center), | |
alignItems(`center), | |
flexDirection(`column), | |
minHeight(`vh(100.0)), |
module Query = [%relay.query | |
{| | |
query AppQuery { | |
messages { | |
id | |
text | |
author { | |
__typename | |
...on User { | |
id |
module Query = [%relay.query | |
{| | |
query AppQuery { | |
messages { | |
id | |
text | |
author { | |
__typename | |
...on User { | |
id |
function premiumColor(role: USER_ROLE) { | |
switch (role) { | |
case "PREMIUM": { | |
return "red"; | |
} | |
case "WHALE": { | |
return "blue"; | |
} | |
case "FREE": { | |
return "black"; |