Skip to content

Commit

Permalink
Merge pull request #741 from bigcapitalhq/fix-ssr-invoice-template
Browse files Browse the repository at this point in the history
fix: style SSR invoice paper template
  • Loading branch information
abouolia authored Nov 6, 2024
2 parents 04b6016 + 17a8aba commit de8a867
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/server/src/interfaces/Http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export const ACCEPT_TYPE = {
APPLICATION_JSON_TABLE: 'application/json+table',
APPLICATION_XLSX: 'application/xlsx',
APPLICATION_CSV: 'application/csv',
APPLICATION_TEXT_HTML: 'application/json+html',
};
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ export function InvoicePaperTemplate({
</Text>
</Stack>
),
thStyle: { width: '60%' },
},
{ label: lineQuantityLabel, accessor: 'quantity', align: 'right' },
{ label: lineRateLabel, accessor: 'rate', align: 'right' },
Expand Down
4 changes: 3 additions & 1 deletion shared/pdf-templates/src/components/PaperTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ interface PaperTemplateTableProps {
label: string;
value?: JSX.Element;
align?: 'left' | 'center' | 'right';
thStyle?: React.CSSProperties;
}>;
data: Array<Record<string, any>>;
}
Expand Down Expand Up @@ -140,7 +141,7 @@ PaperTemplate.Table = ({ columns, data }: PaperTemplateTableProps) => {
<thead>
<tr>
{columns.map((col, index) => (
<x.th key={index} textAlign={col.align}>
<x.th key={index} textAlign={col.align} style={col.thStyle}>
{col.label}
</x.th>
))}
Expand Down Expand Up @@ -210,6 +211,7 @@ PaperTemplate.TotalLine = ({
[totalBottomBordered]: border === PaperTemplateTotalBorder.Dark,
[totalBottomGrayBordered]: border === PaperTemplateTotalBorder.Gray,
})}
style={style}
>
<x.div min-w="160px">{label}</x.div>
<x.div flex={'1 1 auto'} textAlign={'right'}>
Expand Down
5 changes: 3 additions & 2 deletions shared/pdf-templates/src/components/PaperTemplateLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ th {
border-style: solid;
border-width: 0;
}
body{
margin: 0;
font-size: 1rem;
Expand All @@ -57,10 +56,12 @@ body{
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
}
body, h1, h2, h3, h4, h5, h6{
font-family: "Open Sans", sans-serif;
font-optical-sizing: auto;
font-style: normal;
}
strong {
font-weight: 600;
}
`;

0 comments on commit de8a867

Please sign in to comment.