Skip to content

Commit

Permalink
fix: fix beautify
Browse files Browse the repository at this point in the history
  • Loading branch information
S-N-O-R-L-A-X committed Jan 7, 2024
1 parent cd5e3c0 commit 97b8154
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/Components/ShowAllBoards/ShowAllBoards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ import "./index.css"
import { CompleteBoard, ShowResultsContext } from "../../views/Show/ShowResults";
import { PropsWithChildren } from "react";

export default function ShowAllBoards(props: PropsWithChildren) {
interface ShowAllBoardsProps extends PropsWithChildren {
beautify?: boolean;
}

export default function ShowAllBoards(props: ShowAllBoardsProps) {

return (
<ShowResultsContext.Consumer>
{
(context) =>
(
<div className="all-boards">
{context.all_boards.map((board: CompleteBoard, idx: number) => <ShowCards key={idx} all_hands={board.board} board_number={idx + 1} dds={context.dds} />)}
{context.all_boards.map((board: CompleteBoard, idx: number) => <ShowCards key={idx} all_hands={board.board} board_number={idx + 1} dds={context.dds} {...props} />)}
</div>
)
}
Expand Down
1 change: 1 addition & 0 deletions src/Components/ShowCards/ShowCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface ShowCardsProps extends PropsWithChildren {
board_number: number;
dds: boolean;
canClick?: boolean;
beautify?: boolean;
}

const OfflineBridgeSolver = React.lazy(() => import("../../views/Analysis/OfflineBridgeSolver"))
Expand Down
4 changes: 2 additions & 2 deletions src/views/Show/ShowResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ interface ShowResultsContextProps {
export const ShowResultsContext = createContext<ShowResultsContextProps>({ all_boards: [], dds: false });

export default function ShowResults(props: ShowResultsProps) {
const { all_boards, dds } = props;
const { all_boards, dds, ...rest } = props;
return (
<ShowResultsContext.Provider value={{ all_boards, dds }}>
{dds && <Analysis />}
<ShowAllBoards />
<ShowAllBoards {...rest} />
</ShowResultsContext.Provider>
)
}

0 comments on commit 97b8154

Please sign in to comment.