Skip to content

Commit

Permalink
fix: incorporate the login SSO login button to the first row (#62)
Browse files Browse the repository at this point in the history
* Modify the SSO login location

* Modify the SSO login location

* Remove redundant code

* Added support for TrollStore online installation of IPA

* fix lang errot

* fix ipa error

* ipa add HStack

* ipa add HStack

* 解除按钮事件冲突显示

* style: format

---------

Co-authored-by: Andy Hsu <[email protected]>
  • Loading branch information
anwen-anyi and xhofe authored Mar 7, 2023
1 parent dfafe1e commit 1d1076f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 29 deletions.
4 changes: 3 additions & 1 deletion src/lang/en/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"failed_load_img": "Failed to load image",
"open_with": "Open with ...",
"install": "Install",
"installing": "Installing"
"installing": "Installing",
"tr-install": "TrollStore",
"tr-installing": "TrollStore Installing"
},
"layouts": {
"list": "List View",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/previews/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const previews: Preview[] = [
},
{
name: "Ipa",
exts: ["ipa"],
exts: ["ipa", "tipa"],
component: lazy(() => import("./ipa")),
},
{
Expand Down
53 changes: 35 additions & 18 deletions src/pages/home/previews/ipa.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,48 @@
import { Button } from "@hope-ui/solid"
import { Button, HStack } from "@hope-ui/solid"
import { createSignal } from "solid-js"
import { useT } from "~/hooks"
import { useT, useLink } from "~/hooks"
import { objStore } from "~/store"
import { api, baseName, safeBtoa } from "~/utils"
import { FileInfo } from "./info"

const Ipa = () => {
const t = useT()
const [installing, setInstalling] = createSignal(false)
const [trInstalling, setTrInstalling] = createSignal(false)
const { currentObjLink } = useLink()
return (
<FileInfo>
<Button
as="a"
href={
"itms-services://?action=download-manifest&url=" +
`${api}/i/${safeBtoa(
encodeURIComponent(objStore.raw_url) +
"/" +
baseName(encodeURIComponent(objStore.obj.name))
)}.plist`
}
onClick={() => {
setInstalling(true)
}}
>
{t(`home.preview.${installing() ? "installing" : "install"}`)}
</Button>
<HStack spacing="$2">
<Button
as="a"
href={
"itms-services://?action=download-manifest&url=" +
`${api}/i/${safeBtoa(
encodeURIComponent(objStore.raw_url) +
"/" +
baseName(encodeURIComponent(objStore.obj.name))
)}.plist`
}
onClick={() => {
setInstalling(true)
}}
>
{t(`home.preview.${installing() ? "installing" : "install"}`)}
</Button>
<Button
as="a"
colorScheme="primary"
href={
"apple-magnifier://install?url=" +
encodeURIComponent(currentObjLink(true))
}
onClick={() => {
setTrInstalling(true)
}}
>
{t(`home.preview.${trInstalling() ? "tr-installing" : "tr-install"}`)}
</Button>
</HStack>
</FileInfo>
)
}
Expand Down
8 changes: 0 additions & 8 deletions src/pages/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,6 @@ const Login = () => {
>
<SwitchLanguageWhite />
<SwitchColorMode />
</Flex>
<Flex
mt="$2"
justifyContent="space-evenly"
alignItems="center"
color="$neutral10"
w="$full"
>
<SSOLogin />
</Flex>
</VStack>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { Obj, ObjType } from "~/types"
import { ext } from "./path"

const iconMap = {
"dmg,ipa,plist": BsApple,
"dmg,ipa,plist,tipa": BsApple,
"exe,msi": BsWindows,
"zip,gz,rar,7z,tar,jar,xz": BsFileEarmarkZipFill,
apk: ImAndroid,
Expand Down

0 comments on commit 1d1076f

Please sign in to comment.