Skip to content

Commit a62e82a

Browse files
mixmixtooomm
andauthored
little style changes to lobby (#1433)
* little style changes to lobby * fix branding Co-authored-by: tooomm <[email protected]>
1 parent 8793772 commit a62e82a

File tree

5 files changed

+92
-21
lines changed

5 files changed

+92
-21
lines changed

frontend/src/config.js

+17-8
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,23 @@ export const STRINGS = {
1212
MOTD: null, // TODO: handle overwrite of this message of the day; can be a React element
1313

1414
FOOTER:
15-
<div>
16-
<strong>dr4ft</strong> is a fork of
17-
the <code>drafts.ninja</code> arxanas fork of
18-
the <code >draft</code> project by aeosynth.
19-
Contributions welcome! &nbsp;
20-
<a href='https://github.com/dr4fters/dr4ft'>
21-
<img src='https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg' alt='GitHub' title='GitHub Repository' align='top' height='18' />
22-
dr4fters/dr4ft</a>
15+
<div style={{ padding: 10 }}>
16+
<div style={{ marginBottom: 5 }}>
17+
<strong>dr4ft</strong> is a fork of
18+
the <code>drafts.ninja</code> arxanas fork of
19+
the <code>draft</code> project by aeosynth.
20+
</div>
21+
<div>
22+
Contributions welcome! &nbsp;
23+
<a href='https://github.com/dr4fters/dr4ft'>
24+
<img
25+
src='https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg'
26+
alt='GitHub' title='GitHub Repository' align='top' height='18'
27+
style={{ marginRight: 5}}
28+
/>
29+
dr4fters/dr4ft
30+
</a>
31+
</div>
2332
</div>
2433
}
2534
};

frontend/src/lobby/Version.jsx

+24-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*global BUILD_DATE*/
22
import React from "react";
33
import PropTypes from "prop-types";
4+
import "./Version.scss"
45

56
const getLink = (version) => (
67
(/^v\d+\.\d+\.\d+$/.test(version)) ?
@@ -10,17 +11,29 @@ const getLink = (version) => (
1011

1112
const Version = ({version, MTGJSONVersion, boosterRulesVersion}) => {
1213
return (
13-
<p>Running Version: {" "}
14-
<a href={`https://github.com/dr4fters/dr4ft/${getLink(version)}`}>
15-
{version}
16-
</a> (build {BUILD_DATE}) - Using <a href="https://www.mtgjson.com">MTGJSON</a> {" "}
17-
card data {" "}
18-
<a href={`https://mtgjson.com/changelog/version-5/#_${MTGJSONVersion.version.replace(/\./g, "-")}`}>
19-
v{MTGJSONVersion.version}
20-
</a> ({MTGJSONVersion.date}) and <a href={"https://github.com/taw/magic-sealed-data"}>Magic Sealed Data</a> {" "}
21-
booster rules{" "}
22-
commit <a href={`https://github.com/taw/magic-sealed-data/commit/${boosterRulesVersion}`}>{boosterRulesVersion.substring(0,7)}</a>
23-
</p>
14+
<div className="Version">
15+
<div>
16+
dr4ft version: {" "}
17+
<a href={`https://github.com/dr4fters/dr4ft/${getLink(version)}`} className='code'>
18+
<code>{version}</code>
19+
</a> <span className='date'>({BUILD_DATE})</span>
20+
</div>
21+
22+
<div>
23+
Card data: <a href="https://www.mtgjson.com">MTGJSON</a> {" "}
24+
<a href={`https://mtgjson.com/changelog/version-5/#_${MTGJSONVersion.version.replace(/\./g, "-")}`} className='code'>
25+
<code>v{MTGJSONVersion.version}</code>
26+
</a> <span className='date'>({MTGJSONVersion.date})</span>
27+
</div>
28+
29+
<div>
30+
Booster rules: {" "}
31+
<a href={"https://github.com/taw/magic-sealed-data"}>Magic Sealed Data</a> {" "}
32+
<a href={`https://github.com/taw/magic-sealed-data/commit/${boosterRulesVersion}`} className='code'>
33+
<code>{boosterRulesVersion.substring(0, 7)}</code>
34+
</a>
35+
</div>
36+
</div>
2437
);
2538
};
2639

frontend/src/lobby/Version.scss

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.Version {
2+
flex-grow: 1;
3+
color: #333;
4+
5+
display: grid;
6+
grid-auto-flow: column;
7+
grid-gap: 20px;
8+
align-content: end;
9+
10+
a {
11+
color: #333;
12+
13+
&.code {
14+
text-decoration: none;
15+
}
16+
}
17+
18+
code {
19+
font-size: 14px;
20+
padding: 2px 4px;
21+
border: 1px solid gainsboro;
22+
23+
&:hover {
24+
color: #fff;
25+
background: #089dff;
26+
border: 1px solid #089dff;
27+
}
28+
}
29+
30+
span.date {
31+
font-size: 14px;
32+
color: #555;
33+
}
34+
}

frontend/src/router.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ export default function router(_App) {
1212
window.addEventListener("hashchange", route);
1313
}
1414

15+
const Loading = () => {
16+
// return null
17+
return (
18+
<div style={{ padding: 30 }}>
19+
Loading...
20+
</div>
21+
)
22+
}
1523
function route() {
1624
let path = location.hash.slice(1);
1725
let [route, id] = path.split("/");
@@ -25,14 +33,14 @@ function route() {
2533
App.send("join", id);
2634
App.once("gameInfos", App.updateGameInfos);
2735
component = (
28-
<Suspense fallback={<div>Loading...</div>}>
36+
<Suspense fallback={Loading()}>
2937
<Game id={ id } />
3038
</Suspense>
3139
);
3240
break;
3341
case "":
3442
component = (
35-
<Suspense fallback={<div>Loading...</div>}>
43+
<Suspense fallback={Loading()}>
3644
<Lobby />
3745
</Suspense>
3846
);

frontend/style.css

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#root {
2+
height: 100%;
3+
}
4+
15
.outer {
26
display: table;
37
position: absolute;
@@ -272,6 +276,9 @@ input[type="checkbox"], input[type="radio"] {
272276
flex-grow: 1;
273277
margin: 0 auto;
274278
padding-right: 30px;
279+
280+
display: flex;
281+
flex-direction: column;
275282
}
276283

277284
.lobby-header {

0 commit comments

Comments
 (0)