Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

Commit

Permalink
レビュー投稿数をモックで表示
Browse files Browse the repository at this point in the history
  • Loading branch information
takmita committed May 19, 2022
1 parent 094cd9b commit bb20c50
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion bee_slack_app/view/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ def home(
see_more_recommended_book_action_id: str,
read_review_action_id: str,
post_review_action_id: str,
user_info_action_id: str
user_info_action_id: str,
review_count_all: int,
):
"""
アプリホーム画面
Expand Down Expand Up @@ -75,6 +76,15 @@ def home(
"type": "header",
"text": {"type": "plain_text", "text": "本のレビュー", "emoji": True},
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": f"* 現在のレビュー投稿数 {review_count_all}件*",
}, # type:ignore
],
},
{
"type": "actions",
"elements": [
Expand Down
3 changes: 2 additions & 1 deletion bee_slack_app/view_controller/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ def home_controller(app):
@app.event("app_home_opened")
def update_home_view(ack, event, client):
ack()

review_count_all = 123
client.views_publish(
user_id=event["user"],
view=home(
read_review_action_id="read_review",
post_review_action_id="post_review",
see_more_recommended_book_action_id="book_recommend",
user_info_action_id="user_info",
review_count_all=review_count_all,
),
)

0 comments on commit bb20c50

Please sign in to comment.