diff --git a/client/src/Trade.css b/client/src/Trade.css index e969076..e71d59d 100644 --- a/client/src/Trade.css +++ b/client/src/Trade.css @@ -120,15 +120,55 @@ display: flex; flex-direction: row; justify-items: flex-start; + margin: 0.25rem 0; } .Trade .Transfers .GiveGet { display: flex; + position: relative; flex-direction: column; justify-content: space-around; align-items: center; font-weight: bold; - font-size: 1.5rem; + font-size: 1.25rem; + margin: 0 0.5rem; + min-width: 3rem; +} + + +.Trade .Transfers .GiveGet div:nth-child(1) { + position: absolute; + top: 0; + border: 1px solid white; + background-color: rgb(36, 148, 46); + color: white; + border-radius: 0.25rem; + min-width: 2.5rem; + text-align: center; + padding: 0.25rem; +} + +.Trade .Transfers .GiveGet div:nth-child(2) { + position: absolute; + top: 7.5rem; + border: 1px solid white; + background-color: rgb(36, 148, 46); + color: white; + border-radius: 0.25rem; + min-width: 2.5rem; + text-align: center; + padding: 0.25rem; +} + +.Trade .Transfers .GiveGet div:last-child { + position: absolute; + border: 1px solid #f0f0f0; + background-color: #444; + color: white; + font-size: 1rem; + border-radius: 0.25rem; + padding: 0.25rem; + bottom: 0.125rem; } .Trade .TradeLine { diff --git a/client/src/Trade.js b/client/src/Trade.js index 1563133..d9f5b2b 100644 --- a/client/src/Trade.js +++ b/client/src/Trade.js @@ -338,14 +338,18 @@ const Trade = ({table}) => { } else { source = item; } - const _gets = source.gets.length ? source.gets.map((get, index) => <> - { get.type === 'bank' && 4 of any resource } - { get.type !== 'bank' && } - ) : 'nothing', - _gives = source.gives.length ? source.gives.map((give, index) => <> - { give.type === '*' && 1 of any resource } - { give.type !== '*' && } - ) : 'nothing'; + const _gets = source.gets.length ? source.gets.map((get, index) => { + if (get.type === 'bank') { + return 4 of any resource ; + } + return ; + }) : 'nothing'; + const _gives = source.gives.length ? source.gives.map((give, index) => { + if (give.type === '*') { + return 1 of any resource ; + } + return ; + }) : 'nothing'; return (
@@ -441,7 +445,7 @@ const Trade = ({table}) => { { player.haveResources &&
-
Give
Get
+
Give
Get
Have
{ transfers }
}