Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: JSONViewer component style update to fits on dark and light mode #3792

Merged
merged 7 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"react-hook-form": "^7.52.0",
"react-hotkeys-hook": "^4.5.0",
"react-icons": "^5.2.1",
"react-json-view-lite": "^1.5.0",
"react-laag": "^2.0.5",
"react-markdown": "^8.0.7",
"react-pdf": "^9.0.0",
Expand Down
5 changes: 2 additions & 3 deletions src/frontend/src/modals/dictAreaModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,13 @@ export default function DictAreaModal({
<BaseModal.Content>
<div className="flex h-full w-full flex-col transition-all">
<JsonView
theme="vscode"
dark={isDark}
className={!isDark ? "json-view-white" : "json-view-dark"}
dark
editable={!!onChange}
enableClipboard
onChange={handleJsonChange}
src={cloneDeep(componentValue)}
customizeCopy={customizeCopy}
theme="vscode"
/>
</div>
</BaseModal.Content>
Expand Down
12 changes: 4 additions & 8 deletions src/frontend/src/style/classes.css
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,14 @@ textarea[class^="ag-"]:focus {
height: fit-content !important;
}

.json-view-white {
background-color: #f8fafc !important;
}

.json-view-dark {
background-color: #141924 !important;
.json-view.dark {
background-color: #161c28 !important;
}

.react-flow__node.dragging * {
cursor: grabbing !important;
}

.react-flow__node-noteNode:not(.selected){
.react-flow__node-noteNode:not(.selected) {
z-index: -1 !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ test("should be able to share a component on the store by clicking on the share
await page.getByText("New Project", { exact: true }).click();

await page.getByRole("heading", { name: "Basic Prompting" }).click();

await page.waitForSelector("text=share", { timeout: 10000 });
await page.waitForSelector("text=playground", { timeout: 10000 });
await page.waitForSelector("text=api", { timeout: 10000 });
Expand Down
Loading