Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit c4f16c0

Browse files
committed
chore: better launch process
1 parent 2b46ebf commit c4f16c0

File tree

3 files changed

+45
-21
lines changed

3 files changed

+45
-21
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ jobs:
1717
- uses: actions/setup-node@v1
1818
with:
1919
node-version: "16"
20+
- name: Install Apple Arch
21+
uses: actions-rs/toolchain@v1
22+
if: matrix.os == 'macos-latest'
23+
with:
24+
toolchain: stable
25+
override: true
26+
target: aarch64-apple-darwin
27+
components: rustfmt, clippy
2028
- name: Cache node modules
2129
uses: actions/cache@v2
2230
env:

src/eph/components/ShadowText.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default function ShadowText(props: { children: string }): JSX.Element {
2+
return (
3+
<div
4+
className="text-white flex text-lg justify-end px-4"
5+
style={{
6+
textShadow: "0 0 2px black",
7+
}}
8+
>
9+
{props.children}
10+
</div>
11+
);
12+
}

src/eph/views/HomePage.tsx

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import { MinecraftAccount } from "common/struct/accounts";
4040
import { MinecraftProfile } from "common/struct/profiles";
4141
import { Canceller } from "common/task/cancel";
4242
import { BsServer } from "react-icons/bs";
43+
import ShadowText from "eph/components/ShadowText";
4344

4445
export function RequestPasswordDialog(props: {
4546
again: boolean;
@@ -439,8 +440,11 @@ const HomePage = observer(() => {
439440
</MetroCardProvider>
440441
</div>
441442
{profile && value !== null ? (
442-
<>
443-
<div className="flex items-center justify-end m-3">
443+
<div>
444+
{homePageStore.isLaunching && (
445+
<ShadowText>{homePageStore.launchingHelper}</ShadowText>
446+
)}
447+
<div className="flex items-center justify-end mx-3 mb-3">
444448
<Select
445449
value={value}
446450
options={_.map(profiles, (i, id) => ({
@@ -452,27 +456,27 @@ const HomePage = observer(() => {
452456
className="overflow-ellipsis"
453457
placementTop
454458
/>
455-
<Button
456-
onClick={() => homePageStore.launch(account, profile)}
457-
disabled={homePageStore.isLaunching}
458-
variant="contained"
459-
className="whitespace-nowrap"
460-
>
461-
{homePageStore.isLaunching
462-
? homePageStore.launchingHelper
463-
: t("launch")}
464-
</Button>
459+
{homePageStore.isLaunching ? (
460+
<Button
461+
onClick={homePageStore.cancel}
462+
variant="contained"
463+
className="whitespace-nowrap"
464+
>
465+
{t("cancel")}
466+
</Button>
467+
) : (
468+
<Button
469+
onClick={() => homePageStore.launch(account, profile)}
470+
variant="contained"
471+
className="whitespace-nowrap"
472+
>
473+
{t("launch")}
474+
</Button>
475+
)}
465476
</div>
466-
</>
467-
) : (
468-
<div
469-
className="flex justify-end p-3 text-white"
470-
style={{
471-
textShadow: "0 0 2px black",
472-
}}
473-
>
474-
{t("profile.notSelected")}
475477
</div>
478+
) : (
479+
<ShadowText>{t("profile.notSelected")}</ShadowText>
476480
)}
477481
</div>
478482
</div>

0 commit comments

Comments
 (0)