-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add ErrorWidget, InvitesTotal, and UsersTotal components
- Add ErrorWidget component with basic layout and text content for displaying a 404 error. - Add InvitesTotal component for displaying the total number of invites. - Add UsersTotal component for displaying the total number of users.
- Loading branch information
1 parent
bed963a
commit b4ef180
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<template> | ||
<WidgetTemplate> | ||
<div class="flex flex-row-reverse justify-between p-3"> | ||
<div class="text-left flex-grow text-xl leading-tight tracking-tight md:text-2xl"> | ||
<div class="text-gray-400 dark:text-gray-300 mb-0 font-bold">404 Error</div> | ||
<div class="text-gray-300 dark:text-gray-200 text-lg font-normal">Could not find the widget.</div> | ||
</div> | ||
</div> | ||
</WidgetTemplate> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from "vue"; | ||
import WidgetTemplate from "@/templates/WidgetTemplate.vue"; | ||
export default defineComponent({ | ||
name: "ErrorWidget", | ||
components: { | ||
WidgetTemplate, | ||
}, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<template> | ||
<WidgetTemplate :title="__('Total Invites')" :value="count" icon="fa-envelope" /> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from "vue"; | ||
import { useInvitationStore } from "@/stores/invitations"; | ||
import { mapState } from "pinia"; | ||
import WidgetTemplate from "@/templates/WidgetTemplate.vue"; | ||
export default defineComponent({ | ||
name: "InvitesTotal", | ||
components: { | ||
WidgetTemplate, | ||
}, | ||
computed: { | ||
count() { | ||
return String(this.invitations.length); | ||
}, | ||
...mapState(useInvitationStore, ["invitations"]), | ||
}, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<template> | ||
<WidgetTemplate :title="__('Total Users')" :value="count" icon="fa-user" /> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from "vue"; | ||
import { mapState } from "pinia"; | ||
import { useUsersStore } from "@/stores/users"; | ||
import WidgetTemplate from "@/templates/WidgetTemplate.vue"; | ||
export default defineComponent({ | ||
name: "UsersTotal", | ||
components: { | ||
WidgetTemplate, | ||
}, | ||
computed: { | ||
count() { | ||
return String(this.users.length); | ||
}, | ||
...mapState(useUsersStore, ["users"]), | ||
}, | ||
}); | ||
</script> |