Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Spa #1076

Draft
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Draft

[3.x] Spa #1076

wants to merge 1 commit into from

Conversation

lee-to
Copy link
Collaborator

@lee-to lee-to commented Jun 27, 2024

Works via macro

MenuItem::macro('spa', function () {
    /** @var ModelResource $filler */
    $filler = value($this->getFiller());

    return $this->setUrl(
        fn() => $filler->getFragmentLoadUrl('_content')
    )->changeButton(
        static fn(ActionButton $btn) => $btn->async(selector: '#content')
    );
});

Next, we simply add the spa method to the menu

MenuItem::make(
    static fn () => __('moonshine::ui.resource.admins_title'),
    moonshine()->getContainer(MoonShineUserResource::class)
)->spa(),

TODO

  • Push state (browser history)
  • Set current menu item (mb events)
  • Fix the footer to the bottom
  • Сlick on the active menu again to exclude

prototype
@github-actions github-actions bot force-pushed the 3.x branch 2 times, most recently from 2364ade to c8a3b22 Compare June 28, 2024 07:09
@lee-to lee-to force-pushed the 3.x branch 2 times, most recently from 0235519 to 4d2c71a Compare June 28, 2024 07:09
@github-actions github-actions bot force-pushed the 3.x branch 2 times, most recently from 3066b8f to 70537e3 Compare June 28, 2024 07:09
@lee-to lee-to marked this pull request as draft July 1, 2024 12:29
@lee-to lee-to force-pushed the 3.x branch 3 times, most recently from ed3e696 to 8a66cf5 Compare July 19, 2024 13:42
@github-actions github-actions bot force-pushed the 3.x branch 2 times, most recently from df4524f to ae04551 Compare July 19, 2024 13:42
@lee-to lee-to force-pushed the 3.x branch 2 times, most recently from 6fa186f to bc3c799 Compare July 19, 2024 13:42
@github-actions github-actions bot force-pushed the 3.x branch 2 times, most recently from 1470001 to 48a1881 Compare July 19, 2024 13:43
@lee-to lee-to force-pushed the 3.x branch 4 times, most recently from c7b59d8 to d9532c2 Compare July 28, 2024 09:25
@github-actions github-actions bot force-pushed the 3.x branch 4 times, most recently from 1a4b2ed to 121f97a Compare July 28, 2024 09:25
@github-actions github-actions bot force-pushed the 3.x branch 4 times, most recently from 8035657 to b164596 Compare October 4, 2024 12:49
@lee-to lee-to force-pushed the 3.x branch 2 times, most recently from d4b6e15 to 19dd4c0 Compare October 27, 2024 18:36
@github-actions github-actions bot force-pushed the 3.x branch 2 times, most recently from 55235ae to c708498 Compare November 9, 2024 13:31
@github-actions github-actions bot force-pushed the 3.x branch 2 times, most recently from 7965155 to a7e9b88 Compare November 9, 2024 13:32
@github-actions github-actions bot force-pushed the 3.x branch 6 times, most recently from 4881720 to 868b06a Compare November 9, 2024 17:52
@lee-to lee-to force-pushed the 3.x branch 2 times, most recently from ab2ed37 to 05e4e61 Compare December 23, 2024 07:27
@github-actions github-actions bot force-pushed the 3.x branch 2 times, most recently from b183c2c to c72b49c Compare December 23, 2024 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant