Using css-in-js and trying to fix server to set cookies.

This commit is contained in:
2020-08-28 16:04:36 -07:00
parent 3a97c128b6
commit 191a6081b7
5 changed files with 237 additions and 58 deletions

View File

@@ -29,6 +29,8 @@ import VolcanoImg from './../../../assets/img/volcano2.gif'
import React, { Fragment, useState } from 'react'
import ReactDOM from 'react-dom'
/** @jsx jsx */
import { jsx } from '@emotion/core'
import { connect } from 'react-redux'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faUser, faUsers, faTractor, faWindowRestore,
@@ -391,29 +393,29 @@ function makeRidgeLookup(player, otherPlayers) {
return ridges;
}
class FarmsContainer extends React.Component {
render() {
let ridges = makeRidgeLookup(this.props.player, this.props.otherPlayers);
return (
<GroupBox title='Farms'>
<b>Ridges</b>:
{ridgeNames.map((ridge, idx) => (
<div key={idx} className={"farms-ridge player-" + ridges['ridge' + (idx + 1)]}>
<span>{ridge}</span>
<span className='num-cows'>{'(' + ((idx + 2) * 10) + ' cows)'}</span>
</div>
))}
<br />
{this.props.otherPlayers
.map(p => (
<div key={p.player.name}>
<PlayerColorIcon color={p.player.color} />{'\u00A0'}
<b>{p.player.name}</b> <PlayerResources player={p.player} />
<br /> <br />
</div>))}
</GroupBox>
);
}
const FarmsContainer = ({ player, otherPlayers }) => {
let ridges = makeRidgeLookup(player, otherPlayers);
return (
<GroupBox title='Farms'>
<b>Ridges</b>:
{ridgeNames.map((ridge, idx) => (
<div key={idx} className={"farms-ridge"}
css={{ borderTop: '0.3rem solid ' + ridges['ridge' + (idx + 1)],
borderBottom: '0.3rem solid ' + ridges['ridge' + (idx + 1)]}} >
<span>{ridge}</span>
<span className='num-cows'>{'(' + ((idx + 2) * 10) + ' cows)'}</span>
</div>
))}
<br />
{otherPlayers
.map(p => (
<div key={p.player.name}>
<PlayerColorIcon color={p.player.color} />{'\u00A0'}
<b>{p.player.name}</b> <PlayerResources player={p.player} />
<br /> <br />
</div>))}
</GroupBox>
);
}
class TradeCard extends React.Component {

View File

@@ -577,7 +577,7 @@
)
(define (start-game)
(send-static-file "start.html")
(send-static-file "index.html")
""
;; (with-output-to-string
;; (lambda ()