From 799998c5bfb3be76efc7d4101ff61e38a3ecd85c Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Wed, 29 May 2019 08:47:20 +1000 Subject: [PATCH] Added table collapsing --- public/styles/shared.css | 12 ++++++++ src/components/panels/paged_combat_log.jsx | 34 +++++++++++----------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/public/styles/shared.css b/public/styles/shared.css index af759b9..d419505 100644 --- a/public/styles/shared.css +++ b/public/styles/shared.css @@ -232,6 +232,14 @@ footer { .row { flex: 1; display: flex; + flex-direction: row; + justify-content: flex-start; +} + +@media screen and (max-width: 480px) { + .row { + flex-direction: column; + } } .col { @@ -250,4 +258,8 @@ footer { background-color: lightblue; margin-top: 1em; margin-bottom: 2em; +} + +.minWidth { /* hacky */ + min-width: 80px; } \ No newline at end of file diff --git a/src/components/panels/paged_combat_log.jsx b/src/components/panels/paged_combat_log.jsx index 4734793..9ce22b6 100644 --- a/src/components/panels/paged_combat_log.jsx +++ b/src/components/panels/paged_combat_log.jsx @@ -20,24 +20,24 @@ class PagedCombatLog extends React.Component { return (
-

When

-

Attacker

-

Attacking Force

-

Defending Force

-

Undefended?

-

Victor

-

Gold Lost

-

Victor Casualties

+

When

+

Attacker

+

Attacking Force

+

Defending Force

+

Undefended?

+

Victor

+

Gold Lost

+

Victor Casualties

- {Object.keys(this.state.data).map((key) =>
-

{ this.parseDate(this.state.data[key].eventTime) }

-

{this.state.data[key].attackerUsername}

-

{this.state.data[key].attackingUnits}

-

{this.state.data[key].defendingUnits}

-

{this.state.data[key].undefended ? 'yes' : 'no'}

-

{this.state.data[key].victor}

-

{this.state.data[key].spoilsGold}

-

{this.state.data[key].casualtiesVictor}

+ {Object.keys(this.state.data).map((key) =>
+

{ this.parseDate(this.state.data[key].eventTime) }

+

{this.state.data[key].attackerUsername}

+

{this.state.data[key].attackingUnits}

+

{this.state.data[key].defendingUnits}

+

{this.state.data[key].undefended ? 'yes' : 'no'}

+

{this.state.data[key].victor}

+

{this.state.data[key].spoilsGold}

+

{this.state.data[key].casualtiesVictor}

)}
);