Skip to content

Commit

Permalink
Merge pull request #702 from juanesquintero/master
Browse files Browse the repository at this point in the history
Fix: build error for default value in normalizeBorderToCSS
  • Loading branch information
wyozi authored Feb 24, 2025
2 parents bd6ee5f + b5b63ac commit 26d6859
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
12 changes: 6 additions & 6 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const code = `ReactPPTX.render(
}}
/>
</Slide>
<Slide style={{ backgroundColor: "#DDDDDD" }}>
<Text style={{ x: 3, y: 1, w: 3, h: 0.5, fontSize: 32 }}>
<Text.Bullet>Adding bullet 1</Text.Bullet>
Expand All @@ -163,18 +163,18 @@ const code = `ReactPPTX.render(
</Slide>
<Slide>
<Image
src={{ kind: "path", path: "https://source.unsplash.com/random/800x600" }}
src={{ kind: "path", path: "https://picsum.photos/800/600" }}
style={{ x: "10%", y: "10%", w: "80%", h: "80%" }}
/>
</Slide>
<Slide>
<Table
rows={[
[<Table.Cell
colSpan={2}
style={{
align: "center",
backgroundColor: '#115599',
colSpan={2}
style={{
align: "center",
backgroundColor: '#115599',
color: 'white'
}}>
Title
Expand Down
2 changes: 1 addition & 1 deletion src/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ describe("test render", () => {
}}
>
<Image
src={{ kind: "path", path: "http://www.fillmurray.com/460/300" }}
src={{ kind: "path", path: "https://picsum.photos/460/300" }}
style={{ x: "10%", y: "10%", w: "80%", h: "80%" }}
/>
</Slide>
Expand Down
4 changes: 1 addition & 3 deletions src/preview/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ const normalizedColorToCSS = (color: HexColor | ComplexColor) => {

const normalizeBorderToCSS = (style: InternalTableStyle) =>
`${style.borderWidth ?? 0}px solid ${
style.borderColor
? normalizedColorToCSS(style.borderColor)
: undefined ?? "transparent"
style.borderColor ? normalizedColorToCSS(style.borderColor) : undefined
}`;

const SlideObjectShape = ({ shape }: { shape: InternalShape }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
const normalizedColorToPptxgenShapeFill = (
color: HexColor | ComplexColor | null | undefined
): pptxgen.ShapeFillProps | undefined => {
return typeof color === "string" ? { color: color } : color ?? undefined;
return typeof color === "string" ? { color: color } : (color ?? undefined);
};

const renderTextParts = (parts: InternalTextPart[]): PptxGenJs.TextProps[] => {
Expand Down

0 comments on commit 26d6859

Please sign in to comment.