Skip to content

Commit

Permalink
➕ Add table data type 'code'
Browse files Browse the repository at this point in the history
  • Loading branch information
devmount committed May 24, 2024
1 parent 3d87c8e commit e9a823e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions frontend/src/components/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<span v-if="fieldData.type === tableDataType.text">
{{ fieldData.value }}
</span>
<span v-else-if="fieldData.type === tableDataType.code" class="flex gap-4 items-center">
<code>{{ fieldData.value }}</code>
<text-button :copy="fieldData.value" />
</span>
<span v-else-if="fieldData.type === tableDataType.link">
<a :href="fieldData.link" target="_blank">{{ fieldData.value }}</a>
</span>
Expand Down Expand Up @@ -94,6 +98,7 @@ import { tableDataButtonType, tableDataType } from '@/definitions';
import PrimaryButton from '@/elements/PrimaryButton.vue';
import SecondaryButton from '@/elements/SecondaryButton.vue';
import CautionButton from '@/elements/CautionButton.vue';
import TextButton from '@/elements/TextButton.vue';
import LoadingSpinner from '@/elements/LoadingSpinner.vue';
const props = defineProps({
Expand Down
1 change: 1 addition & 0 deletions frontend/src/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ export const tableDataType = {
text: 1,
link: 2,
button: 3,
code: 4,
};

export const tableDataButtonType = {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/admin/InviteCodePanelView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const pageNotification = ref('');
const filteredInvites = computed(() => invites.value.map((invite) => ({
code: {
type: tableDataType.text,
type: tableDataType.code,
value: invite.code,
},
status: {
Expand Down

0 comments on commit e9a823e

Please sign in to comment.