45 lines
943 B
Svelte
45 lines
943 B
Svelte
|
<script>
|
||
|
import { ActionButton } from "@budibase/bbui"
|
||
|
import GoogleLogo from "assets/google-logo.png"
|
||
|
import { store } from "builderStore"
|
||
|
import { auth } from "stores/portal"
|
||
|
|
||
|
export let preAuthStep
|
||
|
|
||
|
$: tenantId = $auth.tenantId
|
||
|
</script>
|
||
|
|
||
|
<ActionButton
|
||
|
on:click={async () => {
|
||
|
// TODO: can probably remove
|
||
|
const datasourceId = await preAuthStep()
|
||
|
window.open(
|
||
|
`/api/global/auth/${tenantId}/google2?datasourceId=${datasourceId}&appId=${$store.appId}`,
|
||
|
"_blank"
|
||
|
)
|
||
|
}}
|
||
|
>
|
||
|
<div class="inner">
|
||
|
<img src={GoogleLogo} alt="google icon" />
|
||
|
<p>Sign in with Google</p>
|
||
|
</div>
|
||
|
</ActionButton>
|
||
|
|
||
|
<style>
|
||
|
.inner {
|
||
|
display: flex;
|
||
|
flex-direction: row;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
padding-top: var(--spacing-xs);
|
||
|
padding-bottom: var(--spacing-xs);
|
||
|
}
|
||
|
.inner img {
|
||
|
width: 18px;
|
||
|
margin: 3px 10px 3px 3px;
|
||
|
}
|
||
|
.inner p {
|
||
|
margin: 0;
|
||
|
}
|
||
|
</style>
|