Skip to content

Commit

Permalink
Fix mobile views for players (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrvecera authored Jan 10, 2023
1 parent d2a6874 commit 48d0dca
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
5 changes: 5 additions & 0 deletions packages/web/src/analytics/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ const leaderboardsDisplayed = (): void => {
firebase.logEvent("leaderboards");
};

const playersPageDisplayed = (): void => {
firebase.logEvent("playersPage");
};

const playerCardDisplayed = (): void => {
firebase.logEvent("playerCard");
};
Expand Down Expand Up @@ -136,6 +140,7 @@ const firebaseAnalytics = {
playerCardDisplayed,
leaderboardsDateInteraction,
leaderboardsTypeInteraction,
playersPageDisplayed,
playerCardMatchesDisplayed,
playerCardMatchDetailsDisplayed,
playerCardFullMatchDetailsDisplayed,
Expand Down
10 changes: 5 additions & 5 deletions packages/web/src/components/charts/geo-map/geo-world-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { ResponsiveChoropleth } from "@nivo/geo";
import { geoMapFeatures } from "./geo-map-features";
import { stateNamesByCode } from "./states";
import { Row, Space, Table } from "antd";
import { Row, Table } from "antd";
import { CountryFlag } from "../../country-flag";
import { UserOutlined } from "@ant-design/icons";

Expand Down Expand Up @@ -65,8 +65,8 @@ const GeoWorldMap: React.FC<GeoWorldMapProps> = ({ data }) => {
return (
<div>
<Row justify={"center"}>
<Space size={"large"} align={"center"} wrap={true}>
<div style={{ width: 650, height: 420 }}>
<div style={{ display: "flex", flexWrap: "wrap", justifyContent: "center" }}>
<div style={{ width: "100%", maxWidth: 650, height: 420, marginRight: 20 }}>
<ResponsiveChoropleth
data={data}
features={geoMapFeatures.features}
Expand Down Expand Up @@ -127,15 +127,15 @@ const GeoWorldMap: React.FC<GeoWorldMapProps> = ({ data }) => {
// ]}
/>
</div>
<div>
<div style={{ flex: "1", maxWidth: 450 }}>
<Table
dataSource={data.slice(0, 10)}
columns={columns}
size="small"
pagination={false}
/>
</div>
</Space>
</div>
</Row>
</div>
);
Expand Down
8 changes: 7 additions & 1 deletion packages/web/src/pages/about/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Typography } from "antd";
import { doc, getDoc, getFirestore } from "firebase/firestore";
import { KofiDonate } from "./kofi-donate";
import config from "../../config";
import { PayPalDonation } from "./paypal-donations";

const { Title, Link, Text, Paragraph } = Typography;

Expand Down Expand Up @@ -242,7 +243,8 @@ const About: React.FC = () => {
kind of income (donations/ads?).
<br />
<br />
If you would like to give financial support, you can do so. <br />
If you like the site please consider donating.
<br />
100% of donations will go towards this project costs <br />
<br />
<KofiDonate />
Expand All @@ -252,6 +254,10 @@ const About: React.FC = () => {
<br />
no registration required.
</i>
<br />
<br />
<PayPalDonation />
<i>Direct PayPal</i>
</div>
</div>
);
Expand Down
3 changes: 3 additions & 0 deletions packages/web/src/pages/players/stats/player-stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Loading } from "../../../components/loading";
import { AlertBox } from "../../../components/alert-box";
import { Link } from "react-router-dom";
import routes from "../../../routes";
import firebaseAnalytics from "../../../analytics";

const { Text, Title } = Typography;

Expand All @@ -27,6 +28,8 @@ const PlayerStats: React.FC = () => {
const [error, setError] = useState("");

useEffect(() => {
firebaseAnalytics.playersPageDisplayed();

try {
(async () => {
setIsLoading(true);
Expand Down

0 comments on commit 48d0dca

Please sign in to comment.