mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 04:26:57 +00:00
add a footer
This commit is contained in:
@@ -1,17 +1,18 @@
|
|||||||
import { Document, Page, Text, View } from "@react-pdf/renderer";
|
import { Document, Page, Text, View } from "@react-pdf/renderer";
|
||||||
|
|
||||||
import { type MatchFormValues } from "@/app/[locale]/(main)/match/MatchForm";
|
import { type MatchFormValues } from "@/app/[locale]/(main)/match/MatchForm";
|
||||||
|
import Footer from "@/app/[locale]/(main)/match/components/pdf/Footer";
|
||||||
import Header from "@/app/[locale]/(main)/match/components/pdf/Header";
|
import Header from "@/app/[locale]/(main)/match/components/pdf/Header";
|
||||||
import InfoTable from "@/app/[locale]/(main)/match/components/pdf/InfoTable";
|
import InfoTable from "@/app/[locale]/(main)/match/components/pdf/InfoTable";
|
||||||
import Team from "@/app/[locale]/(main)/match/components/pdf/Team";
|
import Team from "@/app/[locale]/(main)/match/components/pdf/Team";
|
||||||
|
|
||||||
import { styles } from "./pdf/styles";
|
import { styles } from "./pdf/styles";
|
||||||
|
|
||||||
interface PdfProps {
|
interface IProps {
|
||||||
data: MatchFormValues;
|
data: MatchFormValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const FeuilleMatchPdf = ({ data }: PdfProps) => {
|
export const FeuilleMatchPdf = ({ data }: IProps) => {
|
||||||
const boardsCount = Math.max(
|
const boardsCount = Math.max(
|
||||||
data.team1_players?.length || 0,
|
data.team1_players?.length || 0,
|
||||||
data.team2_players?.length || 0,
|
data.team2_players?.length || 0,
|
||||||
@@ -40,7 +41,6 @@ export const FeuilleMatchPdf = ({ data }: PdfProps) => {
|
|||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* --- Team A Column --- */}
|
|
||||||
<Team
|
<Team
|
||||||
team={"A"}
|
team={"A"}
|
||||||
boards={boards}
|
boards={boards}
|
||||||
@@ -48,7 +48,6 @@ export const FeuilleMatchPdf = ({ data }: PdfProps) => {
|
|||||||
teamName={data.team1}
|
teamName={data.team1}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* --- Team B Column --- */}
|
|
||||||
<Team
|
<Team
|
||||||
team={"B"}
|
team={"B"}
|
||||||
boards={boards}
|
boards={boards}
|
||||||
@@ -68,6 +67,8 @@ export const FeuilleMatchPdf = ({ data }: PdfProps) => {
|
|||||||
<Text>Arbitre</Text>
|
<Text>Arbitre</Text>
|
||||||
<Text>Capitaine B</Text>
|
<Text>Capitaine B</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
<Footer />
|
||||||
</Page>
|
</Page>
|
||||||
</Document>
|
</Document>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { Text, View } from "@react-pdf/renderer";
|
||||||
|
|
||||||
|
import { styles } from "@/app/[locale]/(main)/match/components/pdf/styles";
|
||||||
|
|
||||||
|
const Footer = () => (
|
||||||
|
<View style={styles.footer}>
|
||||||
|
<Text style={styles.footerText}>
|
||||||
|
Generated at https://echecsfrance.com/match
|
||||||
|
</Text>
|
||||||
|
;
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default Footer;
|
||||||
@@ -64,4 +64,16 @@ export const styles = StyleSheet.create({
|
|||||||
lastCell: {
|
lastCell: {
|
||||||
borderRightWidth: 0,
|
borderRightWidth: 0,
|
||||||
},
|
},
|
||||||
|
footer: {
|
||||||
|
position: "absolute",
|
||||||
|
zIndex: 1,
|
||||||
|
bottom: 40,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
fontSize: 8,
|
||||||
|
},
|
||||||
|
footerText: {
|
||||||
|
marginTop: 2,
|
||||||
|
textAlign: "center",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user