File size: 2,637 Bytes
55c2187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
from ctypes import sizeof
import json
from re import search
from data import get_all
from dataset import get_datasets
from models import get_models
from papers import get_papers
import streamlit as st
from upload import upload_ipfs
#from metamask_component import metamask_component
from wallet_connect import wallet_connect
import web3
from abi.abi import get_contract
import requests
from streamlit_lottie import st_lottie
from streamlit_lottie import st_lottie_spinner
import time


st.set_page_config(
    page_title="PaperswithFVM",
    layout="wide"
)

def load_lottieurl(url: str):
    r = requests.get(url)
    if r.status_code != 200:
        return None
    return r.json()


lottie_url_download = "https://assets8.lottiefiles.com/packages/lf20_xhlbndhm.json"
lottie_download = load_lottieurl(lottie_url_download)

col1, col2, col3 = st.columns([1,1.5,1])

with col1:
    st.write(' ')
with col2:
    st_lottie(lottie_download, key="hello",width =300)
with col3:
    st.write(' ')




_, _, _, col, _, _, _ = st.columns([1]*6+[1.18])

with col:
    connect_button = wallet_connect(label="wallet", key="wallet")

if connect_button != 'not':
    print(connect_button)


    # Metamask
    #value = metamask_component(account_results="hello there")

    #connect_button = wallet_connect(label="wallet", key="wallet")


    with st.sidebar:
        option = st.radio(
            'Select Category',
            ('All','Papers','Datasets', 'Models', "Upload"))


    if option == "Papers":
        with st.form("form1", clear_on_submit=False): 
            search_word = st.text_input(f'Search here')
            submit = st.form_submit_button("Submit")
        if submit:
            get_papers(search_word)
            st.balloons()
    elif option == "Datasets":
        with st.form("form1", clear_on_submit=False): 
            search_word = st.text_input(f'Search {option} here')
            submit = st.form_submit_button("Submit")
        if submit:
            get_datasets(search_word)
            st.balloons()
    elif option == "Models":
        with st.form("form1", clear_on_submit=False): 
            search_word = st.text_input(f'Search {option} here')
            submit = st.form_submit_button("Submit")
        if submit:
            get_models(search_word)
            st.balloons()
    elif option == "Upload":
        upload_ipfs()

    else:
        with st.form("form1", clear_on_submit=False): 
            search_word = st.text_input(f'Search {option} here')
            submit = st.form_submit_button("Submit")
        if submit:
            get_all(search_word)
            st.balloons()