Skip to content

Add dynamic activation for documentation page menu items #4

@erdoganbulut

Description

@erdoganbulut

https://github.com/sdtrdev/paymple-ui/blob/develop/src/routes/Documentation/index.tsx

<Menu
  mode="inline"
  defaultSelectedKeys={['1']}
  defaultOpenKeys={['sub1']}
  style={{ height: '100%' }}
>

[en]

There is a default selected menu item, when the user visits any of the document pages.

The Documentation-Home page is still selected, when the user directly visits a sub-document page such as privacy-policy. However, if he clicks on another page from the menu, the menu-item of the page he clicked becomes active and goes to that page.

There is an error here. The menu-item becomes active because the user clicks on the menu-item. In fact, it should be active because it is on that page. Thus, even if the user visits a sub-page directly, the relevant menu-item will be active.

We should make this field dynamic according to the page the user is active on.

[tr]

Kullanıcı döküman sayfalarından herhangi birini ziyaret ettiğinde, default seçili menü item vardır.

Kullanıcı direkt olarak privacy-policy gibi alt bir döküman sayfasını ziyaret ettiğinde, yine de Documentation-Home sayfası seçili oluyor. Ancak menüden başka bir sayfaya tıklarsa, tıkladığı sayfanın menu-item'ı aktif oluyor ve o sayfaya gidiyor.

Burada bir hata var. Menu-item kullanıcı menu-item'a tıkladığı için aktif oluyor. Aslında o sayfada bulunduğu için aktif olması lazım. Böylelikle kullanıcı alt bir sayfayı bile doğrudan ziyaret etse, ilgili menu-item aktif olacaktır.

Bu alanı kullanıcının aktif olduğu sayfaya göre dinamik hale getirmeliyiz.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions