Remove examples app landing page (#2678)

This PR removes the examples app landing page, the home route now shows
the basic example.

### Change Type

- [ ] `patch` — Bug fix
- [ ] `minor` — New feature
- [ ] `major` — Breaking change
- [ ] `dependencies` — Changes to package dependencies[^1]
- [x] `documentation` — Changes to the documentation only[^2]
- [ ] `tests` — Changes to any test code only[^2]
- [ ] `internal` — Any other changes that don't affect the published
package[^2]
- [ ] I don't know

[^1]: publishes a `patch` release, for devDependencies use `internal`
[^2]: will not publish a new version


### Release Notes

- Remove examples app landing page
This commit is contained in:
Taha 2024-01-29 15:27:15 +00:00 committed by GitHub
parent 23f60ee98e
commit a51ffb9544
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 26 deletions

View file

@ -1,24 +0,0 @@
import { ExamplesLink } from './components/ExamplesLink'
import ExamplesTldrawLogo from './components/ExamplesTldrawLogo'
import { examples } from './examples'
export function HomePage() {
return (
<div className="examples">
<div className="examples__header">
<div className="examples__title">
<ExamplesTldrawLogo /> examples
</div>
<p>
See docs at <a href="https://tldraw.dev">tldraw.dev</a>
</p>
</div>
<ul className="examples__list">
{examples.map((e) =>
e.value.map((e) => <ExamplesLink key={e.path} example={e} showDescriptionWhenInactive />)
)}
</ul>
<hr />
</div>
)
}

View file

@ -8,7 +8,6 @@ import {
import { createRoot } from 'react-dom/client'
import { RouterProvider, createBrowserRouter } from 'react-router-dom'
import { ExamplePage } from './ExamplePage'
import { HomePage } from './HomePage'
import { examples } from './examples'
import EndToEnd from './testing/end-to-end'
@ -19,11 +18,24 @@ import EndToEnd from './testing/end-to-end'
const assetUrls = getAssetUrlsByMetaUrl()
setDefaultEditorAssetUrls(assetUrls)
setDefaultUiAssetUrls(assetUrls)
const gettingStartedExamples = examples.find((e) => e.id === 'Getting Started')
if (!gettingStartedExamples) throw new Error('Could not find getting started exmaples')
const basicExample = gettingStartedExamples.value.find((e) => e.title === 'Basic')
if (!basicExample) throw new Error('Could not find basic example')
const router = createBrowserRouter([
{
path: '/',
element: <HomePage />,
lazy: async () => {
const Component = await basicExample.loadComponent()
return {
element: (
<ExamplePage example={basicExample}>
<Component />
</ExamplePage>
),
}
},
},
{
path: 'end-to-end',