home: github.com/shurcooL/home/component Index | Files

package component

import "github.com/shurcooL/home/component"

Package component contains individual components that can render themselves as HTML.

Index

Package Files

button.go container.go doc.go header.go tabnav.go

Variables

var  bool

RedLogo controls whether the logo is displayed in red, rather than its normal color.

func RepositoryTabNav Uses

func RepositoryTabNav(selected RepositoryTab, repoPath string, packages int, openIssues, openChanges uint64) htmlg.Component

type BlankSlate Uses

type BlankSlate struct {
    Content htmlg.Component
}

BlankSlate is a blank slate.

func (BlankSlate) Render Uses

func (bs BlankSlate) Render() []*html.Node

type EllipsisButton Uses

type EllipsisButton struct {
    // OnClick is the value that the onclick handler gets set to.
    OnClick string
}

EllipsisButton is a button with a horizontal ellipsis. It can be used to expand/collapse additional details.

func (EllipsisButton) Render Uses

func (b EllipsisButton) Render() []*html.Node

type Flash Uses

type Flash struct {
    Content htmlg.Component
}

Flash is a flash message.

func (Flash) Render Uses

func (f Flash) Render() []*html.Node
type Header struct {
    CurrentUser       users.User
    NotificationCount uint64 // Only needed if CurrentUser.ID != 0.
    ReturnURL         string
}

Header is a header component that displays current user and notifications.

func (Header) Render Uses

func (h Header) Render() []*html.Node

Render implements htmlg.Component.

type Logo struct{}

Logo is a logo component. It links to "/".

func (Logo) Render Uses

func (Logo) Render() []*html.Node

Render implements htmlg.Component.

type Notifications Uses

type Notifications struct {
    // Count is the number of unread notifications the user has.
    Count uint64
}

Notifications is an icon for displaying if user has unread notifications. It links to "/notifications".

func (Notifications) Render Uses

func (n Notifications) Render() []*html.Node

Render implements htmlg.Component.

type PostButton Uses

type PostButton struct {
    Action    string
    Text      string
    ReturnURL string
}

PostButton is a button that performs a POST action.

func (PostButton) Render Uses

func (b PostButton) Render() []*html.Node

type RepositoryTab Uses

type RepositoryTab uint8
const (
    NoTab RepositoryTab = iota
    PackagesTab
    HistoryTab
    IssuesTab
    ChangesTab
)

type Tab Uses

type Tab struct {
    Content  htmlg.Component
    URL      string
    OnClick  string
    Selected bool
}

Tab is a single tab entry within a TabNav.

func (Tab) Render Uses

func (t Tab) Render() []*html.Node

type TabNav Uses

type TabNav struct {
    Tabs []Tab
}

TabNav is a left-aligned horizontal row of tabs Primer CSS component.

http://primercss.io/nav/#tabnav

func (TabNav) Render Uses

func (t TabNav) Render() []*html.Node

Package component imports 8 packages (graph) and is imported by 9 packages. Updated 2020-07-18. Refresh now. Tools for package owners.