permit multiple buttons (update + launch) to show in appstore; remove homepage print

This commit is contained in:
Tobias Merkle 2024-05-28 09:35:04 -04:00
parent 912e96c86c
commit 88ded5d29f
5 changed files with 25 additions and 19 deletions

View File

@ -14,7 +14,7 @@
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport"
content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1.00001, viewport-fit=cover" />
<script type="module" crossorigin src="/main:app_store:sys/assets/index-Gc4HI_PE.js"></script>
<script type="module" crossorigin src="/main:app_store:sys/assets/index--h2dsLNv.js"></script>
<link rel="stylesheet" crossorigin href="/main:app_store:sys/assets/index-OOHWYMdt.css">
</head>

View File

@ -10,9 +10,10 @@ import classNames from "classnames";
interface ActionButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
app: AppInfo;
isIcon?: boolean;
permitMultiButton?: boolean;
}
export default function ActionButton({ app, isIcon = false, ...props }: ActionButtonProps) {
export default function ActionButton({ app, isIcon = false, permitMultiButton = false, ...props }: ActionButtonProps) {
const { installed, downloaded, updatable } = useMemo(() => {
const versions = Object.entries(app?.metadata?.properties?.code_hashes || {});
const latestHash = (versions.find(([v]) => v === app.metadata?.properties?.current_version) || [])[1];
@ -48,6 +49,8 @@ export default function ActionButton({ app, isIcon = false, ...props }: ActionBu
return (
<>
{/* if it's got a UI and it's updatable, show both buttons if we have space (launch will otherwise push out update) */}
{permitMultiButton && installed && updatable && launchPath && <UpdateButton app={app} {...props} isIcon={isIcon} />}
{(installed && launchPath)
? <LaunchButton app={app} {...props} isIcon={isIcon} launchPath={launchPath} />
: (installed && updatable)

View File

@ -140,7 +140,11 @@ export default function AppPage() {
)
)}
</div>}
<ActionButton app={app} className={classNames("self-center bg-orange text-lg px-12")} />
<div className={classNames("flex-center gap-2", {
'flex-col': isMobile,
})}>
<ActionButton app={app} className={classNames("self-center bg-orange text-lg px-12")} permitMultiButton />
</div>
{app.installed && app.state?.mirroring && (
<button type="button" onClick={goToPublish}>
Publish

View File

@ -194,7 +194,6 @@ fn init(our: Address) {
.get("id")
.unwrap_or(&"0".to_string())
.clone();
println!("id: {id}");
let icon = match id.to_uppercase().as_str() {
"0" => ICON_0,
"1" => ICON_1,