Skip to content

Commit

Permalink
Fix bugs with height
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLorantfy committed Jul 21, 2024
1 parent e049c04 commit 607dc16
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

## Motivation

Zod is an amazing library. However, hairy zod errors can take a while to understand. The goal of `zod-error-viewer` is to drastically cut down on the time it takes to read and understand even the most complex zod errors.
Zod is a game changer for building quality software. However, hairy zod errors can take a while to understand. The goal of `zod-error-viewer` is to drastically cut down on the time it takes to read and understand even the most complex zod errors.

## Getting Started

Expand Down
6 changes: 6 additions & 0 deletions packages/zod-error-viewer/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<style>
html,
body {
height: 100%;
}

#storybook-root {
max-width: 100%;
height: 100%;
}
</style>
42 changes: 0 additions & 42 deletions packages/zod-error-viewer/README.md

This file was deleted.

Binary file removed packages/zod-error-viewer/img/example.png
Binary file not shown.
Binary file removed packages/zod-error-viewer/img/logo.png
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/zod-error-viewer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zod-error-viewer",
"version": "1.3.0",
"version": "1.3.1",
"license": "MIT",
"author": {
"name": "Ben Lorantfy",
Expand Down
4 changes: 4 additions & 0 deletions packages/zod-error-viewer/src/ZodErrorViewer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -451,5 +451,9 @@ export const CustomTheme: Story = {
truncationBackground: "#4b4b4b",
truncation: "#d3d3d3",
},
height: "fill",
},
parameters: {
layout: "fullscreen",
},
};
11 changes: 11 additions & 0 deletions packages/zod-error-viewer/src/ZodErrorViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,23 @@ export function ZodErrorViewer({
overflowX: "hidden",
}}
>
<div
style={{
position: "absolute",
left: 0,
top: 0,
height: height === "fill" ? "100%" : 0,
width: "3.25em",
backgroundColor: mergedTheme.lineNumberBackground,
}}
></div>
<div
style={{
position: "relative",
height: height === "fill" ? "100%" : undefined,
overflow: "auto",
maxWidth: "100%",
lineHeight: 0,
}}
>
<div style={{ width: "max-content" }}>
Expand Down

0 comments on commit 607dc16

Please sign in to comment.