Skip to content

Commit

Permalink
add to gcal button
Browse files Browse the repository at this point in the history
  • Loading branch information
transcental committed Nov 21, 2024
1 parent eea86c0 commit b58b8bf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,8 @@ def create_event(ack: Callable, body: dict[str, Any], client: WebClient):
@app.action("propose-event")
def create_event(ack: Callable, body: dict[str, Any], client: WebClient):
handle_propose_event_btn(ack, body, client)


@app.action("add-to-gcal")
def add_to_gcal(ack: Callable):
ack()
12 changes: 12 additions & 0 deletions views/app_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ def get_home(user_id: str):
"action_id": "more-info",
}
)
buttons.append(
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Add to GCal",
"emoji": True,
},
"url": event["fields"]["Calendar Link"],
"action_id": "add-to-gcal",
}
)
upcoming_events_blocks.append({"type": "actions", "elements": [*buttons]})

return {
Expand Down

0 comments on commit b58b8bf

Please sign in to comment.