Skip to content

Commit 8109219

Browse files
authored
Merge pull request #27 from astrochun/19_twitter_button
Add tweet button in upper left
2 parents b409835 + af7a2e5 commit 8109219

4 files changed

Lines changed: 68 additions & 55 deletions

File tree

assets/gh_sponsor_button_white.html

Lines changed: 0 additions & 48 deletions
This file was deleted.

assets/header_buttons.html

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!-- This includes buttons for Twitter and GitHub Sponsors -->
2+
<html lang="en" data-color-mode="light" data-light-theme="light" data-dark-theme="dark">
3+
<head>
4+
<meta charset="utf-8">
5+
<link rel="dns-prefetch" href="https://assets-git.f3mw1.com">
6+
<link rel="dns-prefetch" href="https://avatars.githubusercontent.com">
7+
<link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com">
8+
<link rel="dns-prefetch" href="https://user-images.githubusercontent.com/">
9+
10+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
11+
<link crossorigin="anonymous" media="all"
12+
integrity="sha512-asWzZPGAVyBJV9QUsWjnig4Pr9eg/5G8dgl2TXT7oceXZmA6ZEYP1KtXsD1awUJL0PDDIknQATXYT8Gpggv3jw=="
13+
rel="stylesheet"
14+
href="https://assets-git.f3mw1.com/assets/sponsors-embed-6ac5b364f18057204957d414b168e78a.css" />
15+
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
16+
17+
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
18+
19+
<meta name="browser-optimizely-client-errors-url"
20+
content="https://api.github.com/_private/browser/optimizely_client/errors">
21+
22+
<link rel="mask-icon" href="https://assets-git.f3mw1.com/pinned-octocat.svg" color="#000000">
23+
<link rel="alternate icon" class="js-site-favicon" type="image/png"
24+
href="https://assets-git.f3mw1.com/favicons/favicon.png">
25+
<link rel="icon" class="js-site-favicon" type="image/svg+xml"
26+
href="https://assets-git.f3mw1.com/favicons/favicon.svg">
27+
28+
<meta name="theme-color" content="#fafafa">
29+
<meta name="color-scheme" content="light" />
30+
31+
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
32+
33+
<meta name="enabled-homepage-translation-languages" content="ko">
34+
</head>
35+
36+
<body style="word-wrap: break-word;">
37+
<main>
38+
<!-- Using flexbox to have buttons side by side -->
39+
<div class="container" style="display: flex;">
40+
<div style="width: 50%;">
41+
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
42+
<a class="twitter-share-button" data-show-count="false" data-size="large"
43+
href="https://twitter.com/share?ref_src=twsrc%5Etfw
44+
&text=Check out this @streamlit app of @uarizona's public salary data by @astrochunly
45+
&url=https://sapp4ua.herokuapp.com">Tweet</a>
46+
</div>
47+
<div style="flex-grow: 1">
48+
<a class="btn btn-block" style="box-shadow: none; height: 30px"
49+
aria-label="Sponsor @astrochun" target="_blank"
50+
href="https://github.com/sponsors/astrochun?o=esb">
51+
<svg aria-hidden="true" viewBox="0 2 15 15" version="1.1" data-view-component="true"
52+
height="15" width="15" class="octicon octicon-heart icon-sponsor text-pink mr-2">
53+
<path fill-rule="evenodd" d="M4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.565 20.565 0 008 13.393a20.561 20.561 0 003.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.75.75 0 01-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5zM8 14.25l-.345.666-.002-.001-.006-.003-.018-.01a7.643 7.643 0 01-.31-.17 22.075 22.075 0 01-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.08 22.08 0 01-3.744 2.584l-.018.01-.006.003h-.002L8 14.25zm0 0l.345.666a.752.752 0 01-.69 0L8 14.25z"></path></svg>
54+
<span>Sponsor</span>
55+
</a>
56+
</div>
57+
</div>
58+
</main>
59+
60+
</body>
61+
</html>

salary_app/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.1.6'
1+
__version__ = '0.1.7'

salary_app/main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def load_data():
3333

3434

3535
@st.cache
36-
def sponsor_button() -> str:
36+
def header_buttons() -> str:
3737
"""Return white-background version of GitHub Sponsor button"""
38-
file_name = "assets/gh_sponsor_button_white.html"
38+
file_name = "assets/header_buttons.html"
3939
with open(file_name, 'r', encoding='utf-8') as f:
40-
button_html = f.read().replace('\n', '')
40+
buttons_html = f.read().replace('\n', '')
4141

42-
return button_html
42+
return buttons_html
4343

4444

4545
def main(bokeh=True):
@@ -49,8 +49,8 @@ def main(bokeh=True):
4949
initial_sidebar_state='auto')
5050

5151
# Display GitHub Sponsor at top
52-
sponsor_button_html = sponsor_button()
53-
html(sponsor_button_html, width=116, height=35)
52+
buttons_html = header_buttons()
53+
html(buttons_html, width=200, height=30)
5454

5555
st.title(title)
5656
st.markdown(

0 commit comments

Comments
 (0)