render package names using name property (#523)

Co-authored-by: neil molina <neil@neils-MacBook-Pro.local>
This commit is contained in:
Neil 2023-04-28 13:26:35 +08:00 committed by GitHub
parent 6c3be19da2
commit 2cdbb75172
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 13 deletions

View file

@ -15,7 +15,7 @@
import { trimGithubSlug } from "$libs/github";
import PackageImage from "../package-card/bg-image.svelte";
import PackageVersionSelector from "$components/package-install-button/package-version-selector.svelte";
import { isPackageInstalled } from "$libs/native-mock";
import { fixPackageName } from "$libs/packages/pkg-utils";
export let pkg: GUIPackage;
let installing = false;
@ -65,7 +65,7 @@
</figure>
<article class="w-2/3 p-4 pt-8">
<div class="align-center flex items-center gap-2">
<h3 class="text-primary text-3xl">{pkg.full_name}</h3>
<h3 class="text-primary text-3xl">{fixPackageName(pkg.name)}</h3>
<ButtonIcon
icon="pencil"
helpText="edit package"

View file

@ -6,6 +6,7 @@
import BgImage from "./bg-image.svelte";
import PackageInstallButton from "$components/package-install-button/package-install-button.svelte";
import PackageInstalledBadge from "$components/package-install-button/package-installed-badge.svelte";
import { fixPackageName } from "$libs/packages/pkg-utils";
export let pkg: GUIPackage;
export let link: string;
@ -17,10 +18,6 @@
console.log("do nothing");
};
const fixPackageName = (title: string) => {
return title.replace("-", "\u2011");
};
// Using this instead of css :active because there is a button inside of a button
let isActive = false;
const activate = () => (isActive = true);

View file

@ -45,3 +45,7 @@ export const isInstalling = (pkg: GUIPackage) => {
pkg.install_progress_percentage < 100
);
};
export const fixPackageName = (title: string) => {
return title.replace("-", "\u2011");
};

View file

@ -106,7 +106,7 @@ To read more about this package go to [${guiPkg.homepage}](${guiPkg.homepage}).
`;
const updatedPackage: Partial<GUIPackage> = {
...pkg,
bottles: pkg?.bottles || [],
readme: {
data: readmeMd,
type: "md"

View file

@ -13,10 +13,10 @@
"strict": true,
"types": ["vitest/globals", "@testing-library/jest-dom"],
"paths": {
"$appcss": ["src/app.css"],
"$libs/*": ["src/libs/*"],
"@native": ["src/libs/native-electron.ts"],
"$components/*": ["src/components/*"],
"$appcss": ["./src/app.css"],
"$libs/*": ["./src/libs/*"],
"@native": ["./src/libs/native-electron.ts"],
"$components/*": ["./src/components/*"],
"@tea/ui/*": ["../ui/src/*"]
}
},

View file

@ -12,8 +12,8 @@ const config: UserConfig = {
// this dynamic-ish static importing is followed by the svelte build
// but for vscode editing intellisense tsconfig.json is being used
"@native": isMock
? path.resolve("src/libs/native-mock.ts")
: path.resolve("src/libs/native-electron.ts"),
? path.resolve("./src/libs/native-mock.ts")
: path.resolve("./src/libs/native-electron.ts"),
$components: path.resolve("./src/components"),
$libs: path.resolve("./src/libs"),
$appcss: path.resolve("./src/app.css")