fix: refactor layout to stack elements vertically and prevent overlapping
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Successful in 53s
Build & Deploy / 🏗️ Build (push) Successful in 2m2s
Build & Deploy / 🚀 Deploy (push) Successful in 15s
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s

- Name and Contact info are now vertically stacked in a left column

- Guarantees no horizontal overlap issues for long names or emails
This commit is contained in:
2026-06-09 14:58:52 +02:00
parent ec62704c3a
commit b6d6637e02

View File

@@ -17,11 +17,9 @@ interface PDFBusinessCardProps {
// Mintel Aesthetics Colors - EXACT PROD COLORS // Mintel Aesthetics Colors - EXACT PROD COLORS
const COLORS = { const COLORS = {
primary: '#011dff', // Bright Royal Blue primary: '#011dff', // Bright Royal Blue
primaryDark: '#000e7a',
green: '#82ed20', // Brand Accent Green green: '#82ed20', // Brand Accent Green
white: '#ffffff', white: '#ffffff',
grayText: '#6c757d', grayText: '#6c757d',
lightGray: '#f8f9fa',
}; };
const styles = StyleSheet.create({ const styles = StyleSheet.create({
@@ -46,68 +44,42 @@ const styles = StyleSheet.create({
// -- FRONT -- // -- FRONT --
frontContainer: { frontContainer: {
flex: 1, flex: 1,
position: 'relative',
},
frontLogoPos: {
position: 'absolute',
top: '8mm',
right: '8mm',
},
frontBottomBar: {
position: 'absolute',
bottom: 0,
left: 0,
right: 0,
height: '35mm',
backgroundColor: COLORS.primaryDark,
borderTopWidth: 2,
borderTopColor: COLORS.green,
display: 'flex',
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
}, },
frontTagline: {
color: COLORS.white,
fontSize: 12,
fontWeight: 'bold',
letterSpacing: 2,
textTransform: 'uppercase',
},
frontSubTagline: {
color: COLORS.green,
fontSize: 7,
marginTop: 4,
letterSpacing: 1,
textTransform: 'uppercase',
},
// -- BACK -- // -- BACK --
backContainer: { backContainer: {
flex: 1, flex: 1,
position: 'relative', padding: '8mm',
padding: '6mm 6mm', flexDirection: 'column',
justifyContent: 'space-between',
}, },
backLogo: { backHeader: {
marginBottom: '8mm', marginBottom: 'auto',
}, },
backMiddle: { backBody: {
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'flex-start', alignItems: 'flex-end',
width: '100%', width: '100%',
}, },
nameSection: { leftColumn: {
flex: 1,
flexDirection: 'column', flexDirection: 'column',
width: '35%', paddingRight: '4mm',
},
nameSection: {
marginBottom: '6mm',
}, },
nameText: { nameText: {
fontSize: 13, fontSize: 14,
fontWeight: 'bold', fontWeight: 'bold',
color: COLORS.primary, color: COLORS.primary,
marginBottom: 3, marginBottom: 2,
}, },
roleText: { roleText: {
fontSize: 7, fontSize: 7.5,
fontWeight: 'normal', fontWeight: 'normal',
color: COLORS.grayText, color: COLORS.grayText,
letterSpacing: 0.5, letterSpacing: 0.5,
@@ -115,35 +87,32 @@ const styles = StyleSheet.create({
}, },
contactSection: { contactSection: {
flexDirection: 'column', flexDirection: 'column',
width: '45%',
paddingLeft: '3mm',
borderLeftWidth: 1,
borderLeftColor: COLORS.lightGray,
}, },
contactRow: { contactRow: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
marginBottom: 5, marginBottom: 4,
}, },
iconCircle: { iconCircle: {
width: 6, width: 4,
height: 6, height: 4,
borderRadius: 3, borderRadius: 2,
backgroundColor: COLORS.green, backgroundColor: COLORS.green,
marginRight: 6, marginRight: 6,
}, },
contactText: { contactText: {
fontSize: 6.5, fontSize: 7,
color: COLORS.primaryDark, color: COLORS.primary,
fontWeight: 'normal', fontWeight: 'normal',
}, },
qrSection: { rightColumn: {
width: '20%', width: '18mm',
flexDirection: 'column',
alignItems: 'flex-end', alignItems: 'flex-end',
}, },
qrCodeWrapper: { qrCodeWrapper: {
width: '15mm', width: '18mm',
height: '15mm', height: '18mm',
padding: 1, padding: 1,
backgroundColor: COLORS.white, backgroundColor: COLORS.white,
}, },
@@ -151,26 +120,6 @@ const styles = StyleSheet.create({
width: '100%', width: '100%',
height: '100%', height: '100%',
}, },
footer: {
position: 'absolute',
bottom: '5mm',
left: '6mm',
right: '6mm',
flexDirection: 'row',
justifyContent: 'flex-start',
alignItems: 'center',
},
footerText: {
fontSize: 6,
color: COLORS.grayText,
letterSpacing: 0.5,
},
pipe: {
fontSize: 6,
color: COLORS.green,
marginHorizontal: 5,
fontWeight: 'bold',
},
}); });
export const PDFBusinessCard: React.FC<PDFBusinessCardProps> = ({ person, qrCodeDataUrl }) => { export const PDFBusinessCard: React.FC<PDFBusinessCardProps> = ({ person, qrCodeDataUrl }) => {
@@ -182,58 +131,47 @@ export const PDFBusinessCard: React.FC<PDFBusinessCardProps> = ({ person, qrCode
> >
{/* FRONT - Clean Modern KLZ Brand */} {/* FRONT - Clean Modern KLZ Brand */}
<Page size={[258, 173]} style={styles.pageBleed}> <Page size={[258, 173]} style={styles.pageBleed}>
<View style={styles.frontLogoPos}> <View style={styles.frontContainer}>
<KLZLogoVector width={110} color={COLORS.white} /> <KLZLogoVector width={140} color={COLORS.white} />
</View>
<View style={styles.frontBottomBar}>
<Text style={styles.frontTagline}>Empowering Energy</Text>
<Text style={styles.frontSubTagline}>High-Quality Cable Infrastructure</Text>
</View> </View>
</Page> </Page>
{/* BACK - Clean White with Bright Blue & Green Accents */} {/* BACK - Clean White with Bright Blue & Green Accents */}
<Page size={[258, 173]} style={styles.pageBleedBack}> <Page size={[258, 173]} style={styles.pageBleedBack}>
<View style={styles.backContainer}> <View style={styles.backContainer}>
<View style={styles.backLogo}> <View style={styles.backHeader}>
<KLZLogoVector width={70} color={COLORS.primary} /> <KLZLogoVector width={80} color={COLORS.primary} />
</View> </View>
<View style={styles.backMiddle}> <View style={styles.backBody}>
<View style={styles.nameSection}> <View style={styles.leftColumn}>
<Text style={styles.nameText}>{person.name}</Text> <View style={styles.nameSection}>
<Text style={styles.roleText}>{person.role}</Text> <Text style={styles.nameText}>{person.name}</Text>
</View> <Text style={styles.roleText}>{person.role}</Text>
</View>
<View style={styles.contactSection}> <View style={styles.contactSection}>
<View style={styles.contactRow}> <View style={styles.contactRow}>
<View style={styles.iconCircle} /> <View style={styles.iconCircle} />
<Text style={styles.contactText}>{person.phone}</Text> <Text style={styles.contactText}>{person.phone}</Text>
</View> </View>
<View style={styles.contactRow}> <View style={styles.contactRow}>
<View style={styles.iconCircle} /> <View style={styles.iconCircle} />
<Text style={styles.contactText}>{person.email}</Text> <Text style={styles.contactText}>{person.email}</Text>
</View> </View>
<View style={styles.contactRow}> <View style={styles.contactRow}>
<View style={styles.iconCircle} /> <View style={styles.iconCircle} />
<Text style={styles.contactText}>klz-cables.com</Text> <Text style={styles.contactText}>klz-cables.com</Text>
</View>
</View> </View>
</View> </View>
<View style={styles.qrSection}> <View style={styles.rightColumn}>
<View style={styles.qrCodeWrapper}> <View style={styles.qrCodeWrapper}>
<Image src={qrCodeDataUrl} style={styles.qrCode} /> <Image src={qrCodeDataUrl} style={styles.qrCode} />
</View> </View>
</View> </View>
</View> </View>
<View style={styles.footer}>
<Text style={styles.footerText}>KLZ Vertriebs GmbH</Text>
<Text style={styles.pipe}>|</Text>
<Text style={styles.footerText}>Raiffeisenstraße 22</Text>
<Text style={styles.pipe}>|</Text>
<Text style={styles.footerText}>73630 Remshalden</Text>
</View>
</View> </View>
</Page> </Page>
</Document> </Document>