-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a proof of concept for rendering one column
This commit adds a proof of concept for allowing Perseus to render only a single column when the content contains two columns. The idea is that the containing page would render two separate `ServerItemRenderer` components, one for each column. It could then control how each column is laid out. Example code: ``` <div class="column-wrapper"> <div class="left-column"> <ServerItemRenderer item={item} apiOptions={{renderColumn: "left"}} /> </div> <div class="right-column"> <ServerItemRenderer item={item} apiOptions={{renderColumn: "right"}} /> </div> </div> ```
- Loading branch information
Showing
5 changed files
with
128 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import {ServerItemRendererWithDebugUI} from "../../../../testing/server-item-ren | |
import { | ||
itemWithInput, | ||
labelImageItem, | ||
satPassageItem, | ||
} from "../__testdata__/item-renderer.testdata"; | ||
|
||
type StoryArgs = Record<any, any>; | ||
|
@@ -23,3 +24,15 @@ export const InputNumberItem = (args: StoryArgs): React.ReactElement => { | |
export const LabelImageItem = (args: StoryArgs): React.ReactElement => { | ||
return <ServerItemRendererWithDebugUI item={labelImageItem} />; | ||
}; | ||
|
||
export const SATPassageItem = (args: StoryArgs): React.ReactElement => { | ||
return <ServerItemRendererWithDebugUI item={satPassageItem} />; | ||
}; | ||
|
||
export const SATPassageItemLeftColumn = (args: StoryArgs): React.ReactElement => { | ||
return <ServerItemRendererWithDebugUI item={satPassageItem} apiOptions={{renderColumn: "left"}} />; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
aag
Author
Member
|
||
}; | ||
|
||
export const SATPassageItemRightColumn = (args: StoryArgs): React.ReactElement => { | ||
return <ServerItemRendererWithDebugUI item={satPassageItem} apiOptions={{renderColumn: "right"}}/>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@aag did you look into whether any special handling is needed for skipping hints when rendering the left column?