Skip to content

Open source CapCut alternative.

TypeScript

Fix install page icon handling

David Lecbd031eddd8b
diff --git a/scripts/package-donkey-app.sh b/scripts/package-donkey-app.sh
index b34bff44..f968828b 100755
--- a/scripts/package-donkey-app.sh
+++ b/scripts/package-donkey-app.sh
@@ -21,6 +21,7 @@ BUILD_DIR="$ROOT_DIR/apps/Donkey"
EXECUTABLE="$BUILD_DIR/.build/release/Donkey"
CACHE_DIR="$BUILD_DIR/.build/package-cache"
APP_ICON_SOURCE="$BUILD_DIR/Sources/Donkey/Resources/Donkey.icns"
+APP_ICONSET_SOURCE="$BUILD_DIR/Sources/Donkey/Resources/Donkey.iconset"
DMG_BACKGROUND_SOURCE="$ROOT_DIR/scripts/assets/donkey-dmg-background.svg"
DMG_BACKGROUND_RENDERED="$ROOT_DIR/dist/donkey-dmg-background.png"
DMG_WINDOW_WIDTH=760
@@ -50,15 +51,37 @@ render_dmg_background() {
set_dmg_volume_icon() {
local volume_dir="$1"
+ local volume_icon_source="$RESOURCES_DIR/Donkey.icns"
- if [ -f "$APP_ICON_SOURCE" ]; then
- cp "$APP_ICON_SOURCE" "$volume_dir/.VolumeIcon.icns"
+ if [ -f "$volume_icon_source" ]; then
+ cp "$volume_icon_source" "$volume_dir/.VolumeIcon.icns"
SetFile -t icns -c icnC "$volume_dir/.VolumeIcon.icns"
SetFile -a V "$volume_dir/.VolumeIcon.icns"
SetFile -a C "$volume_dir"
fi
}
+prepare_app_icon() {
+ local destination="$RESOURCES_DIR/Donkey.icns"
+
+ if [ -d "$APP_ICONSET_SOURCE" ]; then
+ if ! command -v iconutil >/dev/null 2>&1; then
+ echo "iconutil is required to package Donkey.app from $APP_ICONSET_SOURCE." >&2
+ exit 1
+ fi
+ iconutil --convert icns --output "$destination" "$APP_ICONSET_SOURCE"
+ return
+ fi
+
+ if [ -f "$APP_ICON_SOURCE" ]; then
+ cp "$APP_ICON_SOURCE" "$destination"
+ return
+ fi
+
+ echo "Missing app icon sources: $APP_ICONSET_SOURCE or $APP_ICON_SOURCE" >&2
+ exit 1
+}
+
configure_dmg_window() {
local mount_dir="$1"
@@ -172,9 +195,7 @@ if [ -n "$RESOURCE_BUNDLE" ]; then
elif [ -d "$BUILD_DIR/.build/release/Donkey_Donkey.resources" ]; then
cp -R "$BUILD_DIR/.build/release/Donkey_Donkey.resources/." "$RESOURCES_DIR/"
fi
-if [ -f "$APP_ICON_SOURCE" ]; then
- cp "$APP_ICON_SOURCE" "$RESOURCES_DIR/Donkey.icns"
-fi
+prepare_app_icon
SPARKLE_FRAMEWORK="$(find "$BUILD_DIR/.build" -path "*/release/Sparkle.framework" -type d | head -n 1 || true)"
if [ -z "$SPARKLE_FRAMEWORK" ]; then
diff --git a/site/src/app/install/_components/InstallInstructions.tsx b/site/src/app/install/_components/InstallInstructions.tsx
index 988b055e..a0aa66fd 100644
--- a/site/src/app/install/_components/InstallInstructions.tsx
+++ b/site/src/app/install/_components/InstallInstructions.tsx
@@ -1,6 +1,6 @@
import type { CSSProperties } from "react";
import Image from "next/image";
-import { ArrowRight, X } from "lucide-react";
+import { ArrowRight } from "lucide-react";
import {
Headline,
@@ -89,17 +89,6 @@ export function InstallInstructions() {
</div>
<div style={instructionPanelStyle}>
- <X
- aria-hidden="true"
- color="rgba(255,255,255,0.56)"
- size={27}
- strokeWidth={1.35}
- style={{
- position: "absolute",
- right: 26,
- top: 26,
- }}
- />
<h3
style={{
color: "#fff",
@@ -158,12 +147,14 @@ function InstallStepCard({ step }: InstallStepCardProps) {
<Image
alt={step.imageAlt}
height={413}
+ loading="eager"
src={step.imageSrc}
style={{
display: "block",
height: "auto",
width: "100%",
}}
+ unoptimized
width={617}
/>
</div>