Skip to content

Commit

Permalink
feat: added basic empty state
Browse files Browse the repository at this point in the history
  • Loading branch information
mwargan committed Apr 25, 2024
1 parent 5472aca commit f8efa21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/views/DashboardView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const itemData = computed(() => ({
completed: data.value?.bestRedirect?.uuid,
},
{
text: "Test your magic link",
text: t("Test your magic link"),
href: !data.value?.bestRedirect?.uuid
? "/redirects/create"
: `/redirects/${data.value?.bestRedirect?.uuid}`,
Expand Down
10 changes: 10 additions & 0 deletions src/views/RedirectsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { Redirect } from "@/types/redirect";
import CardElement from "@/components/CardElement.vue";
import { getRedirectQrCodeUrl, getRedirects } from "@/useRedirects";
import { removeProtocol } from "@/helpers/urlFormatter";
import BaseButton from "@/components/BaseButton.vue";
const redirects = ref([] as Redirect[]);
const isLoading = ref(true);
Expand Down Expand Up @@ -57,5 +58,14 @@ const defaultEndpoint = (redirect: Redirect) => {
/>
</template>
</card-element>

<card-element
v-if="redirects.length === 0 && !isLoading"
:title="$t('Create a free permanent magic link')"
>
<base-button to="/redirects/create">
{{ $t("Create a free permanent magic link") }}
</base-button>
</card-element>
</div>
</template>

0 comments on commit f8efa21

Please sign in to comment.