Skip to content

Commit

Permalink
Update component tempalte with new component helper API
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwillchen committed Dec 13, 2023
1 parent 8a893c9 commit 35d1ea9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions scripts/component_template/component_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from pydantic import validate_arguments

import optic.components.component_name.component_name_pb2 as component_name_pb
import optic.protos.ui_pb2 as pb
from optic.component_helpers import handler_type, insert_component
from optic.events import ClickEvent

Expand All @@ -24,11 +23,9 @@ def component_name(
"""
insert_component(
key=key,
type=pb.Type(
name="component_name",
value=component_name_pb.ComponentNameType(
label=label,
on_click_handler_id=handler_type(on_click) if on_click else None,
).SerializeToString(),
type_name="component_name",
proto=component_name_pb.ComponentNameType(
label=label,
on_click_handler_id=handler_type(on_click),
),
)

0 comments on commit 35d1ea9

Please sign in to comment.