Skip to content

Commit

Permalink
remove flipColumns option
Browse files Browse the repository at this point in the history
  • Loading branch information
EskiMojo14 committed Jun 1, 2024
1 parent c9ef924 commit a0040f7
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions website/src/components/ConsoleSandbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ import { getPrint } from "./utils";
export function makePrintStore<S, A extends Action>(reducer: Reducer<S, A>) {
const print = getPrint(
{ name: "Action", value: "State" },
{ highlightName: true, flipColumns: true },
{ name: "State", value: "Action" },
{ highlightName: true },
);
function wrappedReducer(state: S | undefined, action: A) {
const newState = reducer(state, action);
print(JSON.stringify(action, null, 2), newState);
print(JSON.stringify(newState, null, 2), action);
return newState;
}
return configureStore({ reducer: wrappedReducer });
Expand All @@ -81,16 +81,13 @@ import { highlight } from "highlight.js";
export function getPrint(
{ name = "Name", value = "Value" }: Partial<Record<"name" | "value", string>> = {},
{
highlightName,
flipColumns,
}: { highlightName?: boolean; flipColumns?: boolean } = {},
{ highlightName }: { highlightName?: boolean; } = {},
) {
const tbody = (
<tbody>
<tr>
<th>{flipColumns ? value : name}</th>
<th>{flipColumns ? name : value}</th>
<th>{name}</th>
<th>{value}</th>
</tr>
</tbody>
);
Expand Down Expand Up @@ -124,10 +121,10 @@ export function getPrint(
const tr = (
<tr>
<td>
<pre>{flipColumns ? valueCode : nameCode}</pre>
<pre>{nameCode}</pre>
</td>
<td>
<pre>{flipColumns ? nameCode : valueCode}</pre>
<pre>{valueCode}</pre>
</td>
</tr>
);
Expand Down

0 comments on commit a0040f7

Please sign in to comment.