fix recipe btn
Browse files
app.py
CHANGED
@@ -103,30 +103,23 @@ if check_input:
|
|
103 |
recipe_choices = get_recipe_choices(input_str)
|
104 |
st.write("Choose the recipe you want to use for your story.")
|
105 |
|
106 |
-
|
107 |
-
other_choices = st.columns(5)
|
108 |
-
|
109 |
-
with choice_1:
|
110 |
-
recipe_1 = st.button(
|
111 |
-
recipe_choices["recipe"],
|
112 |
-
on_click=craft_story_from_recipe,
|
113 |
-
kwargs={"input_str": input_str, "recipe": recipe_choices["recipe"]}
|
114 |
-
)
|
115 |
-
with choice_2:
|
116 |
-
recipe_2 = st.button(
|
117 |
-
recipe_choices["second_recipe"],
|
118 |
-
on_click=craft_story_from_recipe,
|
119 |
-
kwargs={"input_str": input_str, "recipe": recipe_choices["second_recipe"]}
|
120 |
-
)
|
121 |
_other_choices = [
|
122 |
recipe
|
123 |
for recipe in RECIPES
|
124 |
if recipe not in [recipe_choices["recipe"], recipe_choices["second_recipe"]]
|
125 |
]
|
126 |
for idx, recipe in enumerate(_other_choices):
|
127 |
-
with
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
other_recipe = st.button(
|
129 |
-
|
130 |
on_click=craft_story_from_recipe,
|
131 |
kwargs={"input_str": input_str, "recipe": recipe}
|
132 |
)
|
|
|
103 |
recipe_choices = get_recipe_choices(input_str)
|
104 |
st.write("Choose the recipe you want to use for your story.")
|
105 |
|
106 |
+
recipe_choices_col = st.columns(7)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
_other_choices = [
|
108 |
recipe
|
109 |
for recipe in RECIPES
|
110 |
if recipe not in [recipe_choices["recipe"], recipe_choices["second_recipe"]]
|
111 |
]
|
112 |
for idx, recipe in enumerate(_other_choices):
|
113 |
+
with recipe_choices_col[idx]:
|
114 |
+
if recipe == recipe_choices["recipe"]:
|
115 |
+
_recipe = f"🥇 {recipe}"
|
116 |
+
elif recipe == recipe_choices["second_recipe"]:
|
117 |
+
_recipe = f"🥈 {recipe}"
|
118 |
+
else:
|
119 |
+
_recipe = recipe
|
120 |
+
|
121 |
other_recipe = st.button(
|
122 |
+
_recipe,
|
123 |
on_click=craft_story_from_recipe,
|
124 |
kwargs={"input_str": input_str, "recipe": recipe}
|
125 |
)
|