1
0
Fork 0
mirror of synced 2024-06-20 19:30:28 +12:00
budibase/packages/builder/src/components/backend/DatasourceNavigator/_components/GoogleButton.svelte

53 lines
999 B
Svelte
Raw Normal View History

2022-01-06 21:08:54 +13:00
<script>
import GoogleLogo from "assets/google-logo.png"
import { store } from "builderStore"
import { auth } from "stores/portal"
export let preAuthStep
2022-01-27 05:45:28 +13:00
export let datasource
2022-01-06 21:08:54 +13:00
$: tenantId = $auth.tenantId
</script>
<button
2022-01-06 21:08:54 +13:00
on:click={async () => {
2022-01-27 05:45:28 +13:00
let ds = datasource
if (!ds) {
ds = await preAuthStep()
}
2022-01-06 21:08:54 +13:00
window.open(
2022-02-10 03:41:20 +13:00
`/api/global/auth/${tenantId}/datasource/google?datasourceId=${ds._id}&appId=${$store.appId}`,
2022-01-06 21:08:54 +13:00
"_blank"
)
}}
>
<img src={GoogleLogo} alt="google icon" />
<p>Sign in with Google</p>
</button>
2022-01-06 21:08:54 +13:00
<style>
button {
width: 195px;
height: 40px;
font-size: 14px;
2022-01-06 21:08:54 +13:00
display: flex;
flex-direction: row;
align-items: center;
font-weight: 500;
background: #4285f4;
color: #ffffff;
border: none;
cursor: pointer;
padding: 2px;
border-radius: 2px;
2022-01-06 21:08:54 +13:00
}
img {
border-radius: 2px;
2022-01-06 21:08:54 +13:00
width: 18px;
margin-right: 11px;
background: #ffffff;
padding: 10px;
2022-01-06 21:08:54 +13:00
}
</style>