menu fixes: add company links in general; add tracking to lang menu (#2902)

- the company links appear back in the burger menu. they could be
selectively shown if mobile but i'd argue they should just always be
there.
- add the `track` to LanguageMenu to make the menu update. however, i'm
a little annoyed that i don't understand why the Help menu already works
without this :-/

### Change Type

- [x] `patch` — Bug fix

### Release Notes

- Add company menu links back in and make sure the Language menu is
updated on change.
This commit is contained in:
Mime Čuvalo 2024-02-21 15:19:56 +00:00 committed by GitHub
parent a8ca235eaf
commit e9dc9a1158
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -45,6 +45,7 @@ const components: TLComponents = {
<DefaultMainMenu> <DefaultMainMenu>
<LocalFileMenu /> <LocalFileMenu />
<DefaultMainMenuContent /> <DefaultMainMenuContent />
<Links />
</DefaultMainMenu> </DefaultMainMenu>
), ),
KeyboardShortcutsDialog: (props) => { KeyboardShortcutsDialog: (props) => {

View file

@ -67,6 +67,7 @@ const components: TLComponents = {
<DefaultMainMenu> <DefaultMainMenu>
<MultiplayerFileMenu /> <MultiplayerFileMenu />
<DefaultMainMenuContent /> <DefaultMainMenuContent />
<Links />
</DefaultMainMenu> </DefaultMainMenu>
), ),
KeyboardShortcutsDialog: (props) => { KeyboardShortcutsDialog: (props) => {

View file

@ -1,11 +1,11 @@
import { useEditor } from '@tldraw/editor' import { track, useEditor } from '@tldraw/editor'
import { useUiEvents } from '../context/events' import { useUiEvents } from '../context/events'
import { useLanguages } from '../hooks/useTranslation/useLanguages' import { useLanguages } from '../hooks/useTranslation/useLanguages'
import { TldrawUiMenuCheckboxItem } from './primitives/menus/TldrawUiMenuCheckboxItem' import { TldrawUiMenuCheckboxItem } from './primitives/menus/TldrawUiMenuCheckboxItem'
import { TldrawUiMenuGroup } from './primitives/menus/TldrawUiMenuGroup' import { TldrawUiMenuGroup } from './primitives/menus/TldrawUiMenuGroup'
import { TldrawUiMenuSubmenu } from './primitives/menus/TldrawUiMenuSubmenu' import { TldrawUiMenuSubmenu } from './primitives/menus/TldrawUiMenuSubmenu'
export function LanguageMenu() { export const LanguageMenu = track(function LanguageMenu() {
const editor = useEditor() const editor = useEditor()
const trackEvent = useUiEvents() const trackEvent = useUiEvents()
const { languages, currentLanguage } = useLanguages() const { languages, currentLanguage } = useLanguages()
@ -29,4 +29,4 @@ export function LanguageMenu() {
</TldrawUiMenuGroup> </TldrawUiMenuGroup>
</TldrawUiMenuSubmenu> </TldrawUiMenuSubmenu>
) )
} })