component

package
v0.0.0-...-abfb1be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2023 License: Unlicense Imports: 6 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EllipsisButton

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

func (b EllipsisButton) 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

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

Render implements htmlg.Component.

type Logo struct{}

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

func (Logo) Render

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

Render implements htmlg.Component.

type Notifications

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

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

Render implements htmlg.Component.

type PostButton

type PostButton struct {
	Action    string
	Text      string
	ReturnURL string
}

PostButton is a button that performs a POST action.

func (PostButton) Render

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL