Roland Ding
1.0.1.4 updated the theme to soft with primary hue sky, updated the save button as primary.
ae18beb | import gradio as gr | |
| import pandas as pd | |
| from user import * | |
| from invoices import * | |
| data_billing = { | |
| "user":{}, | |
| "payment_method":"", | |
| "invoices":pd.DataFrame() | |
| } | |
| def init_app(): | |
| # data_billing["user"] = get_user("JohnSmith9982") | |
| # data_billing["billing_info"] = data_billing["user"]["billing_info"] | |
| # data_billing["payment_method"] = data_billing["user"]["payment_method"] | |
| # data_billing["invoices"] = get_invoices["user"]["invoices"] | |
| pass | |
| with gr.Blocks( | |
| css="footer {visibility: hidden}", | |
| theme=gr.themes.Soft(primary_hue="sky"), | |
| title="Billing" | |
| ) as ui: | |
| gr.HTML("<h2>Payment Method</h2>") | |
| with gr.Row(): | |
| payment_method = gr.Dropdown(["Credit Card", "Paypal", "Bitcoin", "Other"],label="Payment Method Type") | |
| card_number = gr.Textbox(lines=1, label="Card Number",placeholder="Enter your card number here") | |
| with gr.Row(): | |
| card_expiration = gr.Textbox(lines=1, label="Expire Date",placeholder="MM/YY") | |
| card_cvv = gr.Textbox(lines=1, label="CVV", placeholder="Enter card cvv here") | |
| card_zip = gr.Textbox(lines=1, label="Zip Code", placeholder="Enter your zip code") | |
| with gr.Row(): | |
| payment_reset_button = gr.Button("Reset") | |
| payment_save_button = gr.Button("Save",variant="primary") | |
| gr.HTML("<h2>Invoices List</h2>") | |
| invoices_table = gr.DataFrame( | |
| headers=["Date", "ID", "Name", "Price", "Quantity", "Total", "Status"], | |
| datatype=["date", "str", "str", "number", "number", "number", "str"], | |
| interactive=False, | |
| ) | |
| if __name__ == "__main__": | |
| init_app() | |
| ui.launch() |