-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More monorepo migration fixes (#1257)
* fix: More monorepo migration fixes * fix: Corrected icon sizes & other fixes * fix(theseus): Change color of mod installation button * fix(theseus): More Turborepo fixes * chore: Prettier --------- Co-authored-by: Geometrically <[email protected]>
- Loading branch information
1 parent
8704d3a
commit f171364
Showing
16 changed files
with
141 additions
and
197 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
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
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,64 @@ | ||
<script setup lang="ts"> | ||
import { DropdownIcon, FolderOpenIcon, SearchIcon } from '@modrinth/assets' | ||
import { Button, OverflowMenu } from '@modrinth/ui' | ||
import { open } from '@tauri-apps/api/dialog' | ||
import { add_project_from_path, get } from '@/helpers/profile.js' | ||
import { handleError } from '@/store/notifications.js' | ||
import { useRouter } from 'vue-router' | ||
const props = defineProps({ | ||
instance: { | ||
type: Object, | ||
required: true, | ||
}, | ||
}) | ||
const router = useRouter() | ||
const handleAddContentFromFile = async () => { | ||
const newProject = await open({ multiple: true }) | ||
if (!newProject) return | ||
for (const project of newProject) { | ||
await add_project_from_path(props.instance.path, project, 'mod').catch(handleError) | ||
} | ||
props.instance.initProjects(await get(props.instance.path).catch(handleError)) | ||
} | ||
const handleSearchContent = async () => { | ||
await router.push({ | ||
path: `/browse/${props.instance.metadata.loader === 'vanilla' ? 'datapack' : 'mod'}`, | ||
query: { i: props.instance.path }, | ||
}) | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="joined-buttons"> | ||
<Button color="primary" @click="handleSearchContent"><SearchIcon /> Add content </Button> | ||
|
||
<OverflowMenu | ||
:options="[ | ||
{ | ||
id: 'search', | ||
action: () => handleSearchContent, | ||
}, | ||
{ | ||
id: 'from_file', | ||
action: () => handleAddContentFromFile, | ||
}, | ||
]" | ||
class="btn btn-primary btn-dropdown-animation icon-only" | ||
> | ||
<DropdownIcon /> | ||
<template #search> | ||
<SearchIcon /> | ||
<span class="no-wrap"> Search </span> | ||
</template> | ||
<template #from_file> | ||
<FolderOpenIcon /> | ||
<span class="no-wrap"> Add from file </span> | ||
</template> | ||
</OverflowMenu> | ||
</div> | ||
</template> |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.