Skip to content

Commit

Permalink
Merge pull request #49 from sparrowapp-dev/feat/add-custom-email-redi…
Browse files Browse the repository at this point in the history
…rect

feat: add custom email redirect
  • Loading branch information
gc-codes authored Jun 5, 2024
2 parents 798bf96 + 1b7671c commit b9ca32f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import EntryPoint from './pages/Auth/entry-point/EntryPoint.svelte';
import BgContainer from '$lib/components/bgContainer/BgContainer.svelte';
import bg from '$lib/assets/sparrowLogoBackground.svg';
import ExternalNavigation from './routing/ExternalNavigation.svelte';
import constants from '$lib/utils/constants';
export let url = '/';
</script>

Expand All @@ -26,6 +28,9 @@
<Route path="/update/password/:id" component={UpdatePassword} />
<Route path="/reset/password/:id/:code" component={ResetPassword} />
<Route path="/redirect" component={OauthRedirect} />
<Route path="/support">
<ExternalNavigation to={`mailto:${constants.SPARROW_SUPPORT_EMAIL}`}/>
</Route>
<!-- <Route path="/success" component={AuthSuccess} /> -->
<Route path="/*"><Navigate to="/init" /></Route>
</Router>
Expand Down
24 changes: 24 additions & 0 deletions src/routing/ExternalNavigation.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script>
import { onMount } from 'svelte';
/**
* external link to redirect
*/
export let to = '';
onMount(() => {
window.location.href = to;
});
</script>

<div class="redirect d-flex align-items-center justify-content-center p-5">
<p class="sparrow-fs-18">
If the email client doesn't open automatically, please click <a href={to}>here</a> to email support.
</p>
</div>

<style>
.redirect {
height: 100vh;
}
</style>

0 comments on commit b9ca32f

Please sign in to comment.