Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Import all svgs with ?component parameter
Browse files Browse the repository at this point in the history
Fixes weird hydration issues + gives correct type
  • Loading branch information
brawaru committed Jun 13, 2024
1 parent e4f40d1 commit 638c8d3
Show file tree
Hide file tree
Showing 47 changed files with 218 additions and 218 deletions.
26 changes: 13 additions & 13 deletions components/ui/Badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
</template>

<script setup>
import ModrinthIcon from '~/assets/images/logo.svg'
import ModeratorIcon from '~/assets/images/sidebar/admin.svg'
import CreatorIcon from '~/assets/images/utils/box.svg'
import ListIcon from '~/assets/images/utils/list.svg'
import EyeOffIcon from '~/assets/images/utils/eye-off.svg'
import DraftIcon from '~/assets/images/utils/file-text.svg'
import CrossIcon from '~/assets/images/utils/x.svg'
import ArchiveIcon from '~/assets/images/utils/archive.svg'
import ProcessingIcon from '~/assets/images/utils/updated.svg'
import CheckIcon from '~/assets/images/utils/check.svg'
import LockIcon from '~/assets/images/utils/lock.svg'
import CalendarIcon from '~/assets/images/utils/calendar.svg'
import CloseIcon from '~/assets/images/utils/check-circle.svg'
import ModrinthIcon from '~/assets/images/logo.svg?component'
import ModeratorIcon from '~/assets/images/sidebar/admin.svg?component'
import CreatorIcon from '~/assets/images/utils/box.svg?component'
import ListIcon from '~/assets/images/utils/list.svg?component'
import EyeOffIcon from '~/assets/images/utils/eye-off.svg?component'
import DraftIcon from '~/assets/images/utils/file-text.svg?component'
import CrossIcon from '~/assets/images/utils/x.svg?component'
import ArchiveIcon from '~/assets/images/utils/archive.svg?component'
import ProcessingIcon from '~/assets/images/utils/updated.svg?component'
import CheckIcon from '~/assets/images/utils/check.svg?component'
import LockIcon from '~/assets/images/utils/lock.svg?component'
import CalendarIcon from '~/assets/images/utils/calendar.svg?component'
import CloseIcon from '~/assets/images/utils/check-circle.svg?component'
defineProps({
type: {
Expand Down
2 changes: 1 addition & 1 deletion components/ui/Breadcrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</template>

<script setup>
import ChevronRightIcon from '~/assets/images/utils/chevron-right.svg'
import ChevronRightIcon from '~/assets/images/utils/chevron-right.svg?component'
defineProps({
linkStack: {
Expand Down
4 changes: 2 additions & 2 deletions components/ui/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
</template>

<script>
import CheckIcon from '~/assets/images/utils/check.svg'
import DropdownIcon from '~/assets/images/utils/dropdown.svg'
import CheckIcon from '~/assets/images/utils/check.svg?component'
import DropdownIcon from '~/assets/images/utils/dropdown.svg?component'
export default {
components: {
Expand Down
2 changes: 1 addition & 1 deletion components/ui/Chips.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</template>

<script>
import CheckIcon from '~/assets/images/utils/check.svg'
import CheckIcon from '~/assets/images/utils/check.svg?component'
export default {
components: {
Expand Down
4 changes: 2 additions & 2 deletions components/ui/CopyCode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</template>

<script>
import CheckIcon from '~/assets/images/utils/check.svg'
import ClipboardCopyIcon from '~/assets/images/utils/clipboard-copy.svg'
import CheckIcon from '~/assets/images/utils/check.svg?component'
import ClipboardCopyIcon from '~/assets/images/utils/clipboard-copy.svg?component'
export default {
components: {
Expand Down
8 changes: 4 additions & 4 deletions components/ui/EnvironmentIndicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
</span>
</template>
<script setup>
import InfoIcon from '~/assets/images/utils/info.svg'
import ClientIcon from '~/assets/images/utils/client.svg'
import GlobeIcon from '~/assets/images/utils/globe.svg'
import ServerIcon from '~/assets/images/utils/server.svg'
import InfoIcon from '~/assets/images/utils/info.svg?component'
import ClientIcon from '~/assets/images/utils/client.svg?component'
import GlobeIcon from '~/assets/images/utils/globe.svg?component'
import ServerIcon from '~/assets/images/utils/server.svg?component'
defineProps({
type: {
Expand Down
2 changes: 1 addition & 1 deletion components/ui/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</template>

<script>
import CrossIcon from '~/assets/images/utils/x.svg'
import CrossIcon from '~/assets/images/utils/x.svg?component'
export default {
components: {
Expand Down
4 changes: 2 additions & 2 deletions components/ui/ModalConfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

<script>
import { renderString } from 'omorphia'
import CrossIcon from '~/assets/images/utils/x.svg'
import TrashIcon from '~/assets/images/utils/trash.svg'
import CrossIcon from '~/assets/images/utils/x.svg?component'
import TrashIcon from '~/assets/images/utils/trash.svg?component'
import Modal from '~/components/ui/Modal.vue'
export default {
Expand Down
4 changes: 2 additions & 2 deletions components/ui/ModalCreation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@

<script>
import { Multiselect } from 'vue-multiselect'
import CrossIcon from '~/assets/images/utils/x.svg'
import CheckIcon from '~/assets/images/utils/right-arrow.svg'
import CrossIcon from '~/assets/images/utils/x.svg?component'
import CheckIcon from '~/assets/images/utils/right-arrow.svg?component'
import Modal from '~/components/ui/Modal.vue'
export default {
Expand Down
2 changes: 1 addition & 1 deletion components/ui/NavStackItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</template>

<script>
import ChevronRightIcon from '~/assets/images/utils/chevron-right.svg'
import ChevronRightIcon from '~/assets/images/utils/chevron-right.svg?component'
export default {
components: {
Expand Down
18 changes: 9 additions & 9 deletions components/ui/NotificationItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,15 @@

<script setup>
import { renderString } from 'omorphia'
import InvitationIcon from '~/assets/images/utils/user-plus.svg'
import ModerationIcon from '~/assets/images/sidebar/admin.svg'
import NotificationIcon from '~/assets/images/sidebar/notifications.svg'
import ReadIcon from '~/assets/images/utils/check-circle.svg'
import CalendarIcon from '~/assets/images/utils/calendar.svg'
import VersionIcon from '~/assets/images/utils/version.svg'
import CheckIcon from '~/assets/images/utils/check.svg'
import CrossIcon from '~/assets/images/utils/x.svg'
import ExternalIcon from '~/assets/images/utils/external.svg'
import InvitationIcon from '~/assets/images/utils/user-plus.svg?component'
import ModerationIcon from '~/assets/images/sidebar/admin.svg?component'
import NotificationIcon from '~/assets/images/sidebar/notifications.svg?component'
import ReadIcon from '~/assets/images/utils/check-circle.svg?component'
import CalendarIcon from '~/assets/images/utils/calendar.svg?component'
import VersionIcon from '~/assets/images/utils/version.svg?component'
import CheckIcon from '~/assets/images/utils/check.svg?component'
import CrossIcon from '~/assets/images/utils/x.svg?component'
import ExternalIcon from '~/assets/images/utils/external.svg?component'
import ThreadSummary from '~/components/ui/thread/ThreadSummary.vue'
import { getProjectLink, getVersionLink } from '~/helpers/projects.js'
import { getUserLink } from '~/helpers/users.js'
Expand Down
6 changes: 3 additions & 3 deletions components/ui/Pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
</template>

<script>
import GapIcon from '~/assets/images/utils/gap.svg'
import LeftArrowIcon from '~/assets/images/utils/left-arrow.svg'
import RightArrowIcon from '~/assets/images/utils/right-arrow.svg'
import GapIcon from '~/assets/images/utils/gap.svg?component'
import LeftArrowIcon from '~/assets/images/utils/left-arrow.svg?component'
import RightArrowIcon from '~/assets/images/utils/right-arrow.svg?component'
export default {
components: {
Expand Down
8 changes: 4 additions & 4 deletions components/ui/ProjectCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ import Categories from '~/components/ui/search/Categories.vue'
import Badge from '~/components/ui/Badge.vue'
import EnvironmentIndicator from '~/components/ui/EnvironmentIndicator.vue'
import CalendarIcon from '~/assets/images/utils/calendar.svg'
import EditIcon from '~/assets/images/utils/updated.svg'
import DownloadIcon from '~/assets/images/utils/download.svg'
import HeartIcon from '~/assets/images/utils/heart.svg'
import CalendarIcon from '~/assets/images/utils/calendar.svg?component'
import EditIcon from '~/assets/images/utils/updated.svg?component'
import DownloadIcon from '~/assets/images/utils/download.svg?component'
import HeartIcon from '~/assets/images/utils/heart.svg?component'
import Avatar from '~/components/ui/Avatar.vue'
export default {
Expand Down
16 changes: 8 additions & 8 deletions components/ui/ProjectMemberHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@
<script setup>
import { formatProjectType } from '~/plugins/shorthands.js'
import ChevronRightIcon from '~/assets/images/utils/chevron-right.svg'
import DropdownIcon from '~/assets/images/utils/dropdown.svg'
import CheckIcon from '~/assets/images/utils/check.svg'
import CrossIcon from '~/assets/images/utils/x.svg'
import RequiredIcon from '~/assets/images/utils/asterisk.svg'
import SuggestionIcon from '~/assets/images/utils/lightbulb.svg'
import ModerationIcon from '~/assets/images/sidebar/admin.svg'
import SendIcon from '~/assets/images/utils/send.svg'
import ChevronRightIcon from '~/assets/images/utils/chevron-right.svg?component'
import DropdownIcon from '~/assets/images/utils/dropdown.svg?component'
import CheckIcon from '~/assets/images/utils/check.svg?component'
import CrossIcon from '~/assets/images/utils/x.svg?component'
import RequiredIcon from '~/assets/images/utils/asterisk.svg?component'
import SuggestionIcon from '~/assets/images/utils/lightbulb.svg?component'
import ModerationIcon from '~/assets/images/sidebar/admin.svg?component'
import SendIcon from '~/assets/images/utils/send.svg?component'
import { acceptTeamInvite, removeTeamMember } from '~/helpers/teams.js'
const props = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion components/ui/VersionFilterControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<script setup>
import { Multiselect } from 'vue-multiselect'
import Checkbox from '~/components/ui/Checkbox.vue'
import ClearIcon from '~/assets/images/utils/clear.svg'
import ClearIcon from '~/assets/images/utils/clear.svg?component'
const props = defineProps({
versions: {
Expand Down
2 changes: 1 addition & 1 deletion components/ui/charts/ChartDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ import { analyticsSetToCSVString, intToRgba } from '~/utils/analytics.js'
import { UiChartsCompactChart as CompactChart, UiChartsChart as Chart } from '#components'
import PaletteIcon from '~/assets/icons/palette.svg'
import PaletteIcon from '~/assets/icons/palette.svg?component'
const router = useRouter()
const theme = useTheme()
Expand Down
6 changes: 3 additions & 3 deletions components/ui/report/ReportInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@
import { renderHighlightedString } from '~/helpers/highlight.js'
import Avatar from '~/components/ui/Avatar.vue'
import Badge from '~/components/ui/Badge.vue'
import ReportIcon from '~/assets/images/utils/report.svg'
import UnknownIcon from '~/assets/images/utils/unknown.svg'
import VersionIcon from '~/assets/images/utils/version.svg'
import ReportIcon from '~/assets/images/utils/report.svg?component'
import UnknownIcon from '~/assets/images/utils/unknown.svg?component'
import VersionIcon from '~/assets/images/utils/version.svg?component'
import ThreadSummary from '~/components/ui/thread/ThreadSummary.vue'
import CopyCode from '~/components/ui/CopyCode.vue'
Expand Down
14 changes: 7 additions & 7 deletions components/ui/thread/ConversationThread.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@
import { OverflowMenu, MarkdownEditor, DropdownIcon } from 'omorphia'
import { useImageUpload } from '~/composables/image-upload.ts'
import CopyCode from '~/components/ui/CopyCode.vue'
import ReplyIcon from '~/assets/images/utils/reply.svg'
import SendIcon from '~/assets/images/utils/send.svg'
import CloseIcon from '~/assets/images/utils/check-circle.svg'
import CrossIcon from '~/assets/images/utils/x.svg'
import EyeOffIcon from '~/assets/images/utils/eye-off.svg'
import CheckIcon from '~/assets/images/utils/check.svg'
import ModerationIcon from '~/assets/images/sidebar/admin.svg'
import ReplyIcon from '~/assets/images/utils/reply.svg?component'
import SendIcon from '~/assets/images/utils/send.svg?component'
import CloseIcon from '~/assets/images/utils/check-circle.svg?component'
import CrossIcon from '~/assets/images/utils/x.svg?component'
import EyeOffIcon from '~/assets/images/utils/eye-off.svg?component'
import CheckIcon from '~/assets/images/utils/check.svg?component'
import ModerationIcon from '~/assets/images/sidebar/admin.svg?component'
import ThreadMessage from '~/components/ui/thread/ThreadMessage.vue'
import { isStaff } from '~/helpers/users.js'
import { isApproved, isRejected } from '~/helpers/projects.js'
Expand Down
2 changes: 1 addition & 1 deletion components/ui/thread/ThreadSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</template>

<script setup>
import ChevronRightIcon from '~/assets/images/utils/chevron-right.svg'
import ChevronRightIcon from '~/assets/images/utils/chevron-right.svg?component'
import ThreadMessage from '~/components/ui/thread/ThreadMessage.vue'
const props = defineProps({
Expand Down
30 changes: 15 additions & 15 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -428,21 +428,21 @@ import {
Button,
ReportIcon,
} from 'omorphia'
import HamburgerIcon from '~/assets/images/utils/hamburger.svg'
import CrossIcon from '~/assets/images/utils/x.svg'
import SearchIcon from '~/assets/images/utils/search.svg'
import NotificationIcon from '~/assets/images/sidebar/notifications.svg'
import SettingsIcon from '~/assets/images/sidebar/settings.svg'
import ModerationIcon from '~/assets/images/sidebar/admin.svg'
import HomeIcon from '~/assets/images/sidebar/home.svg'
import MoonIcon from '~/assets/images/utils/moon.svg'
import SunIcon from '~/assets/images/utils/sun.svg'
import PlusIcon from '~/assets/images/utils/plus.svg'
import DropdownIcon from '~/assets/images/utils/dropdown.svg'
import LogOutIcon from '~/assets/images/utils/log-out.svg'
import ChartIcon from '~/assets/images/utils/chart.svg'
import HamburgerIcon from '~/assets/images/utils/hamburger.svg?component'
import CrossIcon from '~/assets/images/utils/x.svg?component'
import SearchIcon from '~/assets/images/utils/search.svg?component'
import NotificationIcon from '~/assets/images/sidebar/notifications.svg?component'
import SettingsIcon from '~/assets/images/sidebar/settings.svg?component'
import ModerationIcon from '~/assets/images/sidebar/admin.svg?component'
import HomeIcon from '~/assets/images/sidebar/home.svg?component'
import MoonIcon from '~/assets/images/utils/moon.svg?component'
import SunIcon from '~/assets/images/utils/sun.svg?component'
import PlusIcon from '~/assets/images/utils/plus.svg?component'
import DropdownIcon from '~/assets/images/utils/dropdown.svg?component'
import LogOutIcon from '~/assets/images/utils/log-out.svg?component'
import ChartIcon from '~/assets/images/utils/chart.svg?component'
import NavRow from '~/components/ui/NavRow.vue'
import ModalCreation from '~/components/ui/ModalCreation.vue'
Expand Down
62 changes: 31 additions & 31 deletions pages/[type]/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -1080,26 +1080,26 @@ import {
CheckIcon,
XIcon,
} from 'omorphia'
import CrownIcon from '~/assets/images/utils/crown.svg'
import CalendarIcon from '~/assets/images/utils/calendar.svg'
import DownloadIcon from '~/assets/images/utils/download.svg'
import UpdateIcon from '~/assets/images/utils/updated.svg'
import QueuedIcon from '~/assets/images/utils/list-end.svg'
import CodeIcon from '~/assets/images/sidebar/mod.svg'
import ExternalIcon from '~/assets/images/utils/external.svg'
import ReportIcon from '~/assets/images/utils/report.svg'
import HeartIcon from '~/assets/images/utils/heart.svg'
import IssuesIcon from '~/assets/images/utils/issues.svg'
import WikiIcon from '~/assets/images/utils/wiki.svg'
import DiscordIcon from '~/assets/images/external/discord.svg'
import BuyMeACoffeeLogo from '~/assets/images/external/bmac.svg'
import PatreonIcon from '~/assets/images/external/patreon.svg'
import KoFiIcon from '~/assets/images/external/kofi.svg'
import PayPalIcon from '~/assets/images/external/paypal.svg'
import OpenCollectiveIcon from '~/assets/images/external/opencollective.svg'
import UnknownIcon from '~/assets/images/utils/unknown-donation.svg'
import ChevronRightIcon from '~/assets/images/utils/chevron-right.svg'
import BoxIcon from '~/assets/images/utils/box.svg'
import CrownIcon from '~/assets/images/utils/crown.svg?component'
import CalendarIcon from '~/assets/images/utils/calendar.svg?component'
import DownloadIcon from '~/assets/images/utils/download.svg?component'
import UpdateIcon from '~/assets/images/utils/updated.svg?component'
import QueuedIcon from '~/assets/images/utils/list-end.svg?component'
import CodeIcon from '~/assets/images/sidebar/mod.svg?component'
import ExternalIcon from '~/assets/images/utils/external.svg?component'
import ReportIcon from '~/assets/images/utils/report.svg?component'
import HeartIcon from '~/assets/images/utils/heart.svg?component'
import IssuesIcon from '~/assets/images/utils/issues.svg?component'
import WikiIcon from '~/assets/images/utils/wiki.svg?component'
import DiscordIcon from '~/assets/images/external/discord.svg?component'
import BuyMeACoffeeLogo from '~/assets/images/external/bmac.svg?component'
import PatreonIcon from '~/assets/images/external/patreon.svg?component'
import KoFiIcon from '~/assets/images/external/kofi.svg?component'
import PayPalIcon from '~/assets/images/external/paypal.svg?component'
import OpenCollectiveIcon from '~/assets/images/external/opencollective.svg?component'
import UnknownIcon from '~/assets/images/utils/unknown-donation.svg?component'
import ChevronRightIcon from '~/assets/images/utils/chevron-right.svg?component'
import BoxIcon from '~/assets/images/utils/box.svg?component'
import Badge from '~/components/ui/Badge.vue'
import Categories from '~/components/ui/search/Categories.vue'
import EnvironmentIndicator from '~/components/ui/EnvironmentIndicator.vue'
Expand All @@ -1111,22 +1111,22 @@ import NavStack from '~/components/ui/NavStack.vue'
import NavStackItem from '~/components/ui/NavStackItem.vue'
import ProjectMemberHeader from '~/components/ui/ProjectMemberHeader.vue'
import MessageBanner from '~/components/ui/MessageBanner.vue'
import SettingsIcon from '~/assets/images/utils/settings.svg'
import UsersIcon from '~/assets/images/utils/users.svg'
import CategoriesIcon from '~/assets/images/utils/tags.svg'
import DescriptionIcon from '~/assets/images/utils/align-left.svg'
import LinksIcon from '~/assets/images/utils/link.svg'
import CopyrightIcon from '~/assets/images/utils/copyright.svg'
import LicenseIcon from '~/assets/images/utils/book-text.svg'
import GalleryIcon from '~/assets/images/utils/image.svg'
import VersionIcon from '~/assets/images/utils/version.svg'
import SettingsIcon from '~/assets/images/utils/settings.svg?component'
import UsersIcon from '~/assets/images/utils/users.svg?component'
import CategoriesIcon from '~/assets/images/utils/tags.svg?component'
import DescriptionIcon from '~/assets/images/utils/align-left.svg?component'
import LinksIcon from '~/assets/images/utils/link.svg?component'
import CopyrightIcon from '~/assets/images/utils/copyright.svg?component'
import LicenseIcon from '~/assets/images/utils/book-text.svg?component'
import GalleryIcon from '~/assets/images/utils/image.svg?component'
import VersionIcon from '~/assets/images/utils/version.svg?component'
import { reportProject } from '~/utils/report-helpers.ts'
import Breadcrumbs from '~/components/ui/Breadcrumbs.vue'
import { userCollectProject } from '~/composables/user.js'
import CollectionCreateModal from '~/components/ui/CollectionCreateModal.vue'
import OrganizationIcon from '~/assets/images/utils/organization.svg'
import OrganizationIcon from '~/assets/images/utils/organization.svg?component'
import ModerationChecklist from '~/components/ui/ModerationChecklist.vue'
import ModeratorIcon from '~/assets/images/sidebar/admin.svg'
import ModeratorIcon from '~/assets/images/sidebar/admin.svg?component'
import { getVersionsToDisplay } from '~/helpers/projects.js'
const data = useNuxtApp()
Expand Down
2 changes: 1 addition & 1 deletion pages/[type]/[id]/changelog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</div>
</template>
<script setup>
import DownloadIcon from '~/assets/images/utils/download.svg'
import DownloadIcon from '~/assets/images/utils/download.svg?component'
import { renderHighlightedString } from '~/helpers/highlight.js'
import VersionFilterControl from '~/components/ui/VersionFilterControl.vue'
import Pagination from '~/components/ui/Pagination.vue'
Expand Down
Loading

0 comments on commit 638c8d3

Please sign in to comment.