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

Titlebar: add fluid api #399

Closed
jmsmyth opened this Issue May 3, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@jmsmyth
Copy link
Contributor

jmsmyth commented May 3, 2017

I'm finding that I have to copy this function into most new projects that use a titlebar:

export default function titleBar ({title, subtitle}) {
  return hx.div('hx-heading')
    .add(hx.div('hx-titlebar')
      .add(hx.div('hx-titlebar-container')
        .add(hx.div('hx-titlebar-header')
          .add(hx.detached('a').class('hx-titlebar-icon').attr('href', '/')
            .add(hx.detached('img').class('hx-logo')))
          .add(hx.div('hx-titlebar-title').text(title))
          .add(hx.div('hx-titlebar-subtitle').text(subtitle)))))
}

@jmsmyth jmsmyth added the Enhancement label May 3, 2017

@c-frater

This comment has been minimized.

Copy link
Contributor

c-frater commented May 3, 2017

I have a html template that's essentially equivalent to copying that function so I'm definitely all for adding this.

It would be awesome to also add an api for adding/removing/setting the links, icons and the 'custom area' (e.g. the 5th/6th example on hexagonjs.io)

@jmsmyth jmsmyth referenced this issue May 3, 2017

Merged

TitleBar: add a minimal fluid api #400

6 of 6 tasks complete
@jmsmyth

This comment has been minimized.

Copy link
Contributor

jmsmyth commented May 3, 2017

Yeah, agreed it would be good to have links / icons / 'the custom area' - not sure how to go about adding them... maybe by passing in selections? Any ideas?

@c-frater

This comment has been minimized.

Copy link
Contributor

c-frater commented May 3, 2017

I'd suggest for links / icons use a tag-input style method for adding? (possibly with a 'renderer'?)

For the custom area, I'd suggest working the same way the dropdown content works would be reasonable (e.g. accepts a selection or a function that populates)

@jmsmyth jmsmyth self-assigned this Jun 21, 2017

@jmsmyth jmsmyth closed this in #400 Aug 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment