Skip to content

Commit

Permalink
#20 - Added changes according to feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders164a committed Oct 17, 2023
1 parent 4519fa5 commit 86299c9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/components/base/toast.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
type="button"
class="-mx-1.5 -my-1.5 ml-auto inline-flex h-8 w-8 items-center justify-center rounded-lg bg-white p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white"
aria-label="Close"
@click="closeToast(props.toast)"
@click="closeToast()"
>
<span class="sr-only">Close</span>
<svg
Expand Down Expand Up @@ -126,21 +126,21 @@ const showToast = ref(true);
const isMouseOver = ref(false);
let value = ref(100);
const value = ref(100);
const timer = setInterval(() => {
if (isMouseOver.value) return;
value.value -= 0.2;
if (value.value < 0) {
value.value = 100;
clearInterval(timer);
closeToast(props.toast);
closeToast();
}
}, 10);
function closeToast(toast: Toast) {
function closeToast() {
showToast.value = false;
removeToast(toast);
removeToast(props.toast);
}
const props = defineProps({
Expand Down
4 changes: 2 additions & 2 deletions src/components/item/Browser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ async function uploadFiles(e: Event) {
} catch (error) {
addToast({
id: uuid(),
message: `Failed to upload file ${file.name}`,
message: t('fileBrowser.file.toast.upload.failed') + ' ' + file.name,
type: ToastType.Danger,
});
}
Expand Down Expand Up @@ -232,7 +232,7 @@ channel.bind('update', (data: ItemType) => {
if (isNew && isOwner) {
addToast({
id: uuid(),
message: `${item.name} has been created`,
message: item.name + ' ' + t('fileBrowser.file.toast.upload.success'),
type: ToastType.Success,
});
}
Expand Down
6 changes: 6 additions & 0 deletions src/lang/da.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ export default {
download: 'Download',
confirmDelete: 'Er du sikker på, at du vil slette denne fil?',
},
toast: {
upload: {
success: 'er blevet oprettet',
failed: 'Fejl i upload af ',
},
},
},
folder: {
create: {
Expand Down
6 changes: 6 additions & 0 deletions src/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ export default {
pink: 'Pink',
rose: 'Rose',
},
toast: {
upload: {
success: 'has been created',
failed: 'Failed to upload file',
},
},
},
docs: {
create: {
Expand Down

0 comments on commit 86299c9

Please sign in to comment.