2024-02-14 02:35:55 +00:00
package frameproto
import (
"io"
)
// WriteFrameButton3Action will write the HTML <meta/> element for the Frame-Protocol's (i.e., Farcaster Frame's) "fc:frame:button:3:action" name-value pair.
//
// For example, this call:
//
// var buttonAction string = "post"
//
2024-02-15 16:41:33 +00:00
// frameproto.WriteFrameButton3Action(writer, buttonAction)
2024-02-14 02:35:55 +00:00
//
// Would write this HTML <meta/> element:
//
// <meta property="fc:frame:button:3:action" content="post" />
//
// Note that this package provides some constants to use with WriteFrameButton3Action.
// Namely: ButtonActionLink (for "link"), ButtonActionMint (for "mint"), ButtonActionPost (for "post"), and ButtonActionPostRedirect (for "post_redirect").
//
// Which in code would be used as:
//
2024-02-15 16:41:33 +00:00
// // <meta property="fc:frame:button:3:action" content="link" />
2024-02-14 02:35:55 +00:00
// frameproto.WriteFrameButton3Action(writer, frameproto.ButtonActionLink)
//
// And:
//
2024-02-15 16:41:33 +00:00
// // <meta property="fc:frame:button:3:action" content="mint" />
2024-02-14 02:35:55 +00:00
// frameproto.WriteFrameButton3Action(writer, frameproto.ButtonActionMint)
//
// And:
//
2024-02-15 16:41:33 +00:00
// // <meta property="fc:frame:button:3:action" content="post" />
2024-02-14 02:35:55 +00:00
// frameproto.WriteFrameButton3Action(writer, frameproto.ButtonActionPost)
//
// And:
//
2024-02-15 16:41:33 +00:00
// // <meta property="fc:frame:button:3:action" content="post_redirect" />
2024-02-14 02:35:55 +00:00
// frameproto.WriteFrameButton3Action(writer, frameproto.ButtonActionPostRedirect)
2024-02-15 17:43:14 +00:00
func WriteFrameButton3Action ( writer io . Writer , action string ) error {
2024-02-14 02:35:55 +00:00
const property string = MetaPropertyFrameButton3Action
2024-02-15 17:43:14 +00:00
return writeMetaPropertyContent ( writer , property , action )
2024-02-14 02:35:55 +00:00
}