|
1 | 1 | <script lang="ts">
|
2 | 2 | import { mdiDownload, mdiEye, mdiStar, mdiPlay, mdiPause, mdiTrashCan, mdiTrayFull, mdiTrayMinus, mdiSync, mdiLinkLock, mdiArchiveCheck, mdiPauseCircle, mdiPlayCircle, mdiStarMinus, mdiStarPlus, mdiStarOutline, mdiTagMultiple } from '@mdi/js';
|
3 | 3 | import { createEventDispatcher } from 'svelte';
|
4 |
| - import Button from '@smui/button'; |
5 | 4 | import LinearProgress from '@smui/linear-progress';
|
6 | 5 | import Tooltip, { Wrapper } from '@smui/tooltip';
|
7 | 6 | import { getContextClient } from '@urql/svelte';
|
|
19 | 18 | import { CompatibilityState } from '$lib/generated';
|
20 | 19 | import { markdown } from '$lib/utils/markdown';
|
21 | 20 | import type { ButtonDisplay } from '$lib/utils/responsiveButton';
|
22 |
| - import ResponsiveButton from '../ResponsiveButton.svelte'; |
| 21 | + import ResponsiveButton from '$lib/components/ResponsiveButton.svelte'; |
23 | 22 |
|
24 | 23 | export let mod: PartialMod;
|
25 | 24 |
|
|
32 | 31 | }
|
33 | 32 |
|
34 | 33 | $: authorClick = () => {
|
35 |
| - $search = `author:"${author}"` |
36 |
| - } |
| 34 | + $search = `author:"${author}"`; |
| 35 | + }; |
37 | 36 |
|
38 | 37 | export let selected: boolean;
|
39 | 38 |
|
|
70 | 69 | iconHover: mdiTrayMinus,
|
71 | 70 | tooltip: isInstalled ?
|
72 | 71 | 'This mod is queued to be uninstalled. Click to cancel the operation.' :
|
73 |
| - 'This mod is queued to be installed. Click to cancel the operation.', |
| 72 | + 'This mod is queued to be installed. Click to cancel the operation.', |
74 | 73 | };
|
75 | 74 | }
|
76 | 75 |
|
77 | 76 | let display: ButtonDisplay = {
|
78 | 77 | icon: mdiDownload,
|
79 | 78 | iconHover: mdiDownload,
|
80 | 79 | tooltip: 'Click to install this mod.',
|
81 |
| - } |
| 80 | + }; |
82 | 81 | if (isInstalled) {
|
83 | 82 | display = {
|
84 | 83 | icon: mdiArchiveCheck,
|
|
87 | 86 | };
|
88 | 87 | } else if (compatibility.state !== CompatibilityState.Works) {
|
89 | 88 | if (installButtonDisabled) {
|
90 |
| - display.tooltip = `You can't install this mod. Reason:`; |
| 89 | + display.tooltip = 'You can\'t install this mod. Reason:'; |
91 | 90 | } else {
|
92 |
| - display.tooltip = `There are problems reported with this mod, but you can try to install it anyways. Details:`; |
| 91 | + display.tooltip = 'There are problems reported with this mod, but you can try to install it anyways. Details:'; |
93 | 92 | }
|
94 | 93 | if (compatibility.note) {
|
95 | 94 | display.tooltipHtml = '<br/>' + compatibility.note;
|
|
99 | 98 | }
|
100 | 99 | }
|
101 | 100 | if (queued) {
|
102 |
| - display.tooltip = "This mod is already queued for another operation."; |
| 101 | + display.tooltip = 'This mod is already queued for another operation.'; |
103 | 102 | delete display.tooltipHtml;
|
104 | 103 | }
|
105 | 104 | return display;
|
|
112 | 111 | iconHover: mdiTrayMinus,
|
113 | 112 | tooltip: isEnabled ?
|
114 | 113 | 'This mod is queued to be Paused. Click to cancel the operation.' :
|
115 |
| - 'This mod is queued to be Resumed. Click to cancel the operation.', |
| 114 | + 'This mod is queued to be Resumed. Click to cancel the operation.', |
116 | 115 | };
|
117 | 116 | }
|
118 | 117 |
|
|
129 | 128 | };
|
130 | 129 | }
|
131 | 130 | if (queued) {
|
132 |
| - display.tooltip = "This mod is already queued for another operation."; |
| 131 | + display.tooltip = 'This mod is already queued for another operation.'; |
133 | 132 | }
|
134 | 133 | return display;
|
135 | 134 | })();
|
|
152 | 151 | icon: mdiStarOutline,
|
153 | 152 | iconHover: mdiStarPlus,
|
154 | 153 | tooltip: 'Click to add this mod to your Favorites.',
|
155 |
| - tooltipHtml: "Having a mod Favorited is unrelated to whether or not it's installed - it's a way to keep track of a mod for later regardless of what Profile you have selected." |
| 154 | + tooltipHtml: 'Having a mod Favorited is unrelated to whether or not it\'s installed - it\'s a way to keep track of a mod for later regardless of what Profile you have selected.', |
156 | 155 | };
|
157 | 156 | })();
|
158 | 157 |
|
|
314 | 313 | </div>
|
315 | 314 | </div>
|
316 | 315 | <!-- The purpose of the event handlers here are to prevent navigating to the mod's page when clicking on one of the sub-buttons of the div. Thus, it shouldn't be focusable despite having "interactions" -->
|
317 |
| - <!-- svelte-ignore a11y-no-noninteractive-element-interactions a11y-click-events-have-key-events --> |
| 316 | + <!-- svelte-ignore a11y-no-noninteractive-element-interactions --> |
318 | 317 | <div class="pr-2 flex h-full items-center" role="separator" tabindex="-1" on:click|stopPropagation={() => { /* empty */ }} on:keypress|stopPropagation={() => { /* empty */ }}>
|
319 | 318 | <ResponsiveButton
|
320 | 319 | display={enableButtonDisplay}
|
|
0 commit comments