chore(ui): Organise Onboarding imports
This commit is contained in:
parent
ba1f1a2c5d
commit
5a1ed75454
4 changed files with 22 additions and 5 deletions
|
|
@ -4,12 +4,12 @@ import { type JSX, splitProps } from 'solid-js';
|
|||
import styles from './Link.module.scss';
|
||||
|
||||
export type LinkProps = JSX.IntrinsicElements['a'] & {
|
||||
prompt?: boolean;
|
||||
skipPrompt?: boolean;
|
||||
includeIcon?: boolean;
|
||||
};
|
||||
|
||||
function Link(props: LinkProps) {
|
||||
const [split, rest] = splitProps(props, ['prompt', 'class', 'href', 'onClick', 'children']);
|
||||
const [split, rest] = splitProps(props, ['skipPrompt', 'class', 'href', 'onClick', 'children']);
|
||||
const open = usePromptOpener();
|
||||
|
||||
return (
|
||||
|
|
@ -25,7 +25,7 @@ function Link(props: LinkProps) {
|
|||
)}
|
||||
class={`${styles.link} ${split.class || ''}`}
|
||||
onClick={(e) => {
|
||||
open(split.href, !!split.prompt);
|
||||
open(split.href, !!split.skipPrompt);
|
||||
if (typeof split.onClick === 'function')
|
||||
split.onClick(e as any);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import type { ImportType } from '@onelauncher/client/bindings';
|
|||
import Illustration from '~assets/illustrations/onboarding/import_from_others.svg?component-solid';
|
||||
import { bridge } from '~imports';
|
||||
import Button from '~ui/components/base/Button';
|
||||
import Link from '~ui/components/base/Link';
|
||||
import SelectList from '~ui/components/base/SelectList';
|
||||
import LauncherIcon from '~ui/components/content/LauncherIcon';
|
||||
import Modal, { createModal, type ModalProps } from '~ui/components/overlay/Modal';
|
||||
|
|
@ -52,6 +53,12 @@ function OnboardingImport() {
|
|||
)}
|
||||
</For>
|
||||
</div>
|
||||
<small class="pt-2 text-fg-secondary">
|
||||
Want to contribute a launcher import? Click
|
||||
{' '}
|
||||
<Link href="https://github.com/Polyfrost/OneLauncher" skipPrompt={true}>here</Link>
|
||||
.
|
||||
</small>
|
||||
</OverlayScrollbarsComponent>
|
||||
</div>
|
||||
</OnboardingStep>
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ function OnboardingLanguage() {
|
|||
</div>
|
||||
|
||||
<div class="w-full flex flex-row justify-end">
|
||||
<Link class="text-xs" href={TRANSLATION_WEBSITE}>Help translate OneLauncher</Link>
|
||||
<Link class="text-xs" href={TRANSLATION_WEBSITE} skipPrompt>Help translate OneLauncher</Link>
|
||||
</div>
|
||||
</div>
|
||||
</OnboardingStep>
|
||||
|
|
|
|||
|
|
@ -182,4 +182,14 @@ export function getPackageUrl(pkg: ManagedPackage): string {
|
|||
export const LOADERS: Loader[] = ['vanilla', 'fabric', 'forge', 'neoforge', 'quilt'] as const;
|
||||
export const PROVIDERS: Providers[] = ['Modrinth', 'Curseforge'] as const;
|
||||
export const PACKAGE_TYPES: PackageType[] = ['mod', 'resourcepack', 'datapack', 'shaderpack'] as const;
|
||||
export const LAUNCHER_IMPORT_TYPES: ImportType[] = ['PrismLauncher', 'Curseforge', 'Modrinth', 'ATLauncher', 'GDLauncher', 'FTBLauncher', 'MultiMC', 'TLauncher', 'Technic'] as const;
|
||||
export const LAUNCHER_IMPORT_TYPES: ImportType[] = [
|
||||
'PrismLauncher',
|
||||
'Curseforge',
|
||||
// 'Modrinth',
|
||||
'ATLauncher',
|
||||
'GDLauncher',
|
||||
// 'FTBLauncher',
|
||||
'MultiMC',
|
||||
// 'TLauncher',
|
||||
// 'Technic'
|
||||
] as const;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue