Skip to content

batosai/adonis-unpoly

Repository files navigation

Unpoly for AdonisJS 6

Easily add support for the server protocol expected by Unpoly.

Installation

node ace add @jrmc/adonis-unpoly

Or

npm install @jrmc/adonis-unpoly
node ace configure @jrmc/adonis-unpoly

Usage in controllers

Sample close drawer or redirect

  async store({ response, i18n, up }: HttpContext) {
    // ...

    session.flash('notification', {
      type: 'success',
      message: i18n.formatMessage('form.success.user.create'),
    })

    if (up.isDrawer()) {
      up.setDismissLayer()
    } else {
      response.redirect().toRoute('admin.users.index')
    }
  }

Usage in edge view

Sample back button

@if(up.isDrawer())
  <button up-dismiss>
    @svg('tabler:arrow-left')
  <button>
@else
  <a href="{{ $props.href }}">
    @svg('tabler:arrow-left')
  </a>
@end

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published