Skip to content

Commit

Permalink
minor points feat fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonassimoen committed Dec 4, 2023
1 parent a88735b commit 027f605
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/components/UI/Alert/Alert.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { AlertStyle } from "./AlertStyle";

export const Alert = (props: any) => {
const { children, ...rest}= props;

return (
<AlertStyle {...rest}>
{children}
</AlertStyle>
);
};
8 changes: 8 additions & 0 deletions src/components/UI/Alert/AlertStyle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import styled from "@/styles/styled-components";
import { Alert } from "antd/lib";

export const AlertStyle = styled(Alert)`
.ant-alert-message {
color: #989998 !important;
}
`;
8 changes: 8 additions & 0 deletions src/pages/EditTeam/EditTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { PlayerList } from "@/components/PlayerList/PlayerList";
import { useGetMatchesQuery } from "@/services/matchesApi";
import { useGetPlayersQuery } from "@/services/playersApi";
import { Button } from "@/components/UI/Button/Button";
import { Alert } from "@/components/UI/Alert/Alert";

const _EditTeam = (props: AbstractTeamType) => {
const { user, teams } = useAppSelector((state) => state.userState);
Expand Down Expand Up @@ -188,6 +189,13 @@ const _EditTeam = (props: AbstractTeamType) => {
{t("team.saveTeam")}
</Button>)
}
<Alert
message="Tips"
description="Selecteer 15 spelers"
type="info"
showIcon
style={{margin: "10px auto"}}
/>
</Block>
</Col>
<Col md={12} sm={12} xs={24} className="right">
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Points/Points.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const _TeamPoints = (props: AbstractTeamType) => {
generalRank: result.team.rank !== null ? result.team.rank : "-",
visibleWeekPoints: (weekStat && weekStat.points) || "-",
visibleWeekRank: (weekStat && weekStat.rank) || "-",
weekWinnerPoints: result.weekWinner && result.weekWinner.points !== null ? result.weekWinner.points : "-",
weekWinnerPoints: (weekStat && weekStat.winner) || "-",
weekPointsConfirmed: !!weekPointsConfirmed,
provisionalPoints: provisionalPoints,
totalTransfers: result.transfers.length,
Expand All @@ -97,7 +97,7 @@ export const _TeamPoints = (props: AbstractTeamType) => {
const inPlayer = players.find((item: any) => item.id === transfer.inId);
return { ...transfer, outPlayer, inPlayer };
}),
weekAveragePoints: result.weekAveragePoints !== null ? parseFloat(result.weekAveragePoints).toFixed(2) : "-"
weekAveragePoints: (weekStat && weekStat.average) || "-"
};

const startedThisWeek = { started: result.team.weekId <= pointsWeekId, weekId: result.team.weekId };
Expand Down
2 changes: 1 addition & 1 deletion src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const router = createBrowserRouter([
},
{
path: "/public/:id", //todo
element: <ProtectedRoute access={true} redirectPath="/home"><Home /></ProtectedRoute>
element: <ProtectedRoute access={true} redirectPath="/home"><PointsPage /></ProtectedRoute>
},
{
path: "/team/:id",
Expand Down

0 comments on commit 027f605

Please sign in to comment.