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

package component

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

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

Index

Package Files

reactions.go

type NewReaction Uses

type NewReaction struct {
    ReactableID string
}

NewReaction is a component for adding new reactions to a Reactable with ReactableID id.

func (NewReaction) Render Uses

func (nr NewReaction) Render() []*html.Node

type Reaction Uses

type Reaction struct {
    Reaction    reactions.Reaction
    CurrentUser users.User
}

Reaction is a component for displaying a single Reaction, as seen by CurrentUser.

func (Reaction) Render Uses

func (r Reaction) Render() []*html.Node

type ReactionsBar Uses

type ReactionsBar struct {
    Reactions   []reactions.Reaction
    CurrentUser users.User
    ID          string // ID is the reactable ID.
}

ReactionsBar is a component next to anything that can be reacted to, with reactable ID. It displays all reactions for that reactable ID, and a NewReaction component for adding new reactions.

func (ReactionsBar) Render Uses

func (r ReactionsBar) Render() []*html.Node

type ReactionsBarInner Uses

type ReactionsBarInner struct {
    Reactions   []reactions.Reaction
    CurrentUser users.User
    ReactableID string
}

ReactionsBarInner is a static component that displays all reactions, and a NewReaction component with ReactableID for adding new reactions.

func (ReactionsBarInner) Render Uses

func (r ReactionsBarInner) Render() []*html.Node

Package component imports 7 packages (graph) and is imported by 6 packages. Updated 2018-06-02. Refresh now. Tools for package owners.