Skip to content

Commit

Permalink
Simplify Feign players view
Browse files Browse the repository at this point in the history
  • Loading branch information
mogproject committed Dec 28, 2024
1 parent 0890ac0 commit dc65a66
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Header() {
<Container>
<Navbar.Brand href='#'>Feign-Discord CSS Generator</Navbar.Brand>

<Nav className="me-auto d-none d-xl-flex">
<Nav className="me-auto d-none d-lg-flex">
<Nav.Link href="#features">{t('features.features')}</Nav.Link>
<Nav.Link href="#settings">{t('settings.settings')}</Nav.Link>
<Nav.Link href="#preview">{t('preview.preview')}</Nav.Link>
Expand Down
2 changes: 1 addition & 1 deletion src/components/sections/DiscordUsers.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowDown, faArrowUp, faPen, faPenToSquare, faTractor, faTrash, faXmark } from "@fortawesome/free-solid-svg-icons";
import { faArrowDown, faArrowUp, faPen, faPenToSquare, faTrash, faXmark } from "@fortawesome/free-solid-svg-icons";
import { Container, Row, Col, InputGroup, Form, Button, Modal } from "react-bootstrap";
import { DiscordUser, ConfContext } from "../../models/Context";
import { useTranslation } from "react-i18next";
Expand Down
40 changes: 3 additions & 37 deletions src/components/sections/FeignPlayers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function FeignPlayers() {
const { t: translate } = useTranslation('translation', { keyPrefix: 'colors' });
const t = translate as ((s: string) => string);
return (
<Col key={`player-${color}`} className="mb-3">
<Col key={`player-${color}`} className="mb-3 col-1-5 col-lg-1-7">
<Row className="justify-content-center mb-2">{t(FEI_COLORS[color])}</Row>
<Row className="justify-content-center mb-2">
<img src={`assets/img/${FEI_COLORS[color]}-small.png`} width="80px" style={{ maxWidth: "80px" }} alt=""></img>
Expand Down Expand Up @@ -55,47 +55,13 @@ export function FeignPlayers() {

return (
<Container>
{/* large screen */}
<Row className="d-none d-md-flex">
{Array(7)
<Row>
{Array(13)
.fill(0)
.map((_, i: number) => {
return FeignPlayer(i);
})}
</Row>
<Row className="d-none d-md-flex">
{Array(6)
.fill(0)
.map((_, i: number) => {
return FeignPlayer(7 + i);
})}
<Col></Col>
</Row>

{/* small screen */}
<Row className="d-md-none">
{Array(5)
.fill(0)
.map((_, i: number) => {
return FeignPlayer(i);
})}
</Row>
<Row className="d-md-none">
{Array(5)
.fill(0)
.map((_, i: number) => {
return FeignPlayer(4 + i);
})}
</Row>
<Row className="d-md-none">
{Array(3)
.fill(0)
.map((_, i: number) => {
return FeignPlayer(8 + i);
})}
<Col></Col>
<Col></Col>
</Row>
</Container>
);
}
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom/client';
import "bootstrap/dist/css/bootstrap.min.css";
import './styles/index.css';
import './styles/discord.css';
import './styles/columns.css';
import "./i18n/config";
import App from './App';

Expand Down
37 changes: 37 additions & 0 deletions src/styles/columns.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.col-1-5 {
width: 20%;
flex: 0 0 auto;
}

.col-1-7 {
width: calc(100% / 7);
flex: 0 0 auto;
}

@media (min-width: 576px) {
.col-sm-1-7 {
width: calc(100% / 7);
flex: 0 0 auto;
}
}

@media (min-width: 768px) {
.col-md-1-7 {
width: calc(100% / 7);
flex: 0 0 auto;
}
}

@media (min-width: 992px) {
.col-lg-1-7 {
width: calc(100% / 7);
flex: 0 0 auto;
}
}

@media (min-width: 1200px) {
.col-xl-1-7 {
width: calc(100% / 7);
flex: 0 0 auto;
}
}

0 comments on commit dc65a66

Please sign in to comment.