Skip to content

Commit

Permalink
GITBOOK-5: No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Arbibe authored and gitbook-bot committed Nov 17, 2023
1 parent b0f5a29 commit 040ba1e
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 33 deletions.
21 changes: 12 additions & 9 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@

* [Introduction](guide/introduction.md)
* [Installation](guide/installation.md)
* [Overview](guide/overview.md)

## API Documentation
## Documentation

* [TimelineContext](api-documentation/timelinecontext/README.md)
* [useTimelineContext](api-documentation/timelinecontext/usetimelinecontext.md)
* [Row](api-documentation/row/README.md)
* [useRow](api-documentation/row/userow.md)
* [Subrow](api-documentation/row/subrow.md)
* [Item](api-documentation/item/README.md)
* [useItem](api-documentation/item/useitem.md)
* [TimelineContext](documentation/timelinecontext/README.md)
* [useTimelineContext](documentation/timelinecontext/usetimelinecontext.md)
* [Row](documentation/row/README.md)
* [useRow](documentation/row/userow.md)
* [Subrow](documentation/row/subrow.md)
* [Item](documentation/item/README.md)
* [useItem](documentation/item/useitem.md)

## Examples

* [Basic](examples/basic.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Each item in that stack should be rendered inside a subrow of some kind, that wi
<pre class="language-tsx" data-title="Timeline.tsx"><code class="lang-tsx">function Timeline(props: TimelineProps) {
const { setTimelineRef, style, timeframe } = useTimelineContext()

const groupedRows = useMemo(
const groupedSubrows = useMemo(
<strong> () => groupItemsToSubrows(items, timeframe),
</strong> [items, timeline.timeframe]
</strong> [items, timeframe]
)

return (
&#x3C;div ref={setTimelineRef} style={style}>
{rows.map((row) =>
{props.rows.map((row) =>
&#x3C;Row key={row.id} id={row.id} sidebar={&#x3C;Sidebar row={row} />}>
{groupedSubrows[row.id]?.map((subrow, index) =>
&#x3C;div key={`${row.id}-${index}`}>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ You will need to wrap your timeline and all of its component in a `<TimelineCont
{% code title="App.tsx" overflow="wrap" %}
```tsx
function App(){
const [row, setRow] = useRows()
const [rows, setRows] = useRows()
const [items, setItems] = useItems()
const [timeframe, setTimeframe] = useState(DEFAULT_TIMEFRAME)

Expand Down
3 changes: 3 additions & 0 deletions docs/examples/basic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Basic

{% embed url="https://codesandbox.io/p/sandbox/github/samuelarbibe/dnd-timeline/tree/main/examples/basic?embed=1&file=/src/App.tsx" %}
20 changes: 0 additions & 20 deletions docs/guide/overview.md

This file was deleted.

0 comments on commit 040ba1e

Please sign in to comment.