Merge pull request #177 from Compagnia-d-Arme-del-Santo-Luca/refactor/business-card

♻️ refactor: update business card
This commit is contained in:
2026-10-19 14:04:30 +02:00
committed by GitHub
4 changed files with 578 additions and 355 deletions
+565 -350
View File
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 174 KiB

@@ -6,6 +6,7 @@ import BusinessCardPage from './index.js'
vi.mock('./envVars.js', () => ({
NAME: 'Test Name',
ASSOCIATION: 'Test Association',
POSITION: 'Test Position',
VAT: 'Test VAT',
PHONE: '+123456789',
@@ -28,6 +29,7 @@ describe('BusinessCardPage', () => {
// Name appears in uppercase in the first card
expect(screen.getByText('Test Name')).toBeInTheDocument()
expect(screen.getByText('Test Association')).toBeInTheDocument()
expect(screen.getByText('Test Position')).toBeInTheDocument()
// Check if values are rendered correctly in the second card
@@ -62,7 +64,7 @@ describe('BusinessCardPage', () => {
const user = userEvent.setup()
render(<BusinessCardPage />)
await user.click(screen.getByText('Print Business Card'))
await user.click(screen.getByText('Stampa'))
expect(mockPrint).toHaveBeenCalledTimes(1)
})
@@ -1,6 +1,7 @@
/* istanbul ignore file */
export const NAME = import.meta.env.VITE_BC_NAME || '[FULL NAME]'
export const POSITION = import.meta.env.VITE_BC_POSITION || 'Ass. di rievocazione storica affiliata C.E.R.S. (XIV-XV secolo)'
export const ASSOCIATION = import.meta.env.VITE_BC_ASSOCIATION || 'Ass. di rievocazione storica affiliata C.E.R.S.'
export const POSITION = import.meta.env.VITE_BC_POSITION || '(fine XIV - inizio XV secolo)'
export const PHONE = import.meta.env.VITE_BC_PHONE || null
export const EMAIL = import.meta.env.VITE_BC_EMAIL || '[Redacted for privacy]'
export const FACEBOOK = import.meta.env.VITE_BC_FACEBOOK || 'compagniadarmedelsantoluca'
@@ -150,10 +150,15 @@ const BusinessCardPage = () => {
color="text.secondary"
fontSize="0.55rem"
fontFamily="Oswald, sans-serif"
textTransform="uppercase"
// textTransform="uppercase"
fontWeight={700}>
{env.NAME}
</Typography>
{env.ASSOCIATION != null && (
<Typography variant="caption" color="text.secondary" fontSize="0.55rem">
{env.ASSOCIATION}
</Typography>
)}
<Typography variant="caption" color="text.secondary" fontSize="0.55rem" mb={0.5}>
{env.POSITION}
</Typography>
@@ -180,7 +185,7 @@ const BusinessCardPage = () => {
<Box
sx={{
ariaLabel: 'Print Business Card',
ariaLabel: 'Stampa',
my: 7,
display: 'flex',
justifyContent: 'center',
@@ -189,7 +194,7 @@ const BusinessCardPage = () => {
},
}}>
<Button variant="contained" startIcon={<Print />} onClick={() => window.print()}>
Print Business Card
Stampa
</Button>
</Box>
</Page>