Skip to content

Commit

Permalink
feat: display runtime version for Expo Go (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
IZUMI-Zu authored Dec 15, 2024
1 parent 9d944ac commit 00235c0
Show file tree
Hide file tree
Showing 18 changed files with 243 additions and 199 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "20"
cache: "npm"

- name: Install dependencies
run: npm install
Expand All @@ -93,9 +94,11 @@ jobs:
- name: Create preview
id: preview
uses: expo/expo-github-action/preview@v8
env:
EXPO_PUBLIC_COMMIT_HASH: ${{ steps.pr-details.outputs.head_sha }}
with:
comment: false
qr-target: 'expo-go'
qr-target: "expo-go"
github-token: ${{ secrets.GITHUB_TOKEN }}
command: eas update --auto --branch pr-${{ needs.check_permissions.outputs.pr_head_ref }}

Expand All @@ -104,7 +107,7 @@ jobs:
id: find_comment
with:
issue-number: ${{ needs.check_permissions.outputs.pr_number }}
comment-author: 'github-actions[bot]'
comment-author: "github-actions[bot]"
body-includes: Expo Preview

- name: Create or Update Comment
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ yarn-error.*
.idea/
*.iml
.vscode/

android/
ios/
16 changes: 15 additions & 1 deletion SettingPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {Avatar, Button, IconButton, List, Surface, Text, useTheme} from "react-n
import {ActionSheetProvider} from "@expo/react-native-action-sheet";
import * as Application from "expo-application";
import {useTranslation} from "react-i18next";
import Constants, {ExecutionEnvironment} from "expo-constants";

import CasdoorLoginPage, {CasdoorLogout} from "./CasdoorLoginPage";
import LoginMethodSelector from "./LoginMethodSelector";
Expand All @@ -32,6 +33,7 @@ const SettingPage = () => {
const {userInfo, clearAll} = useStore();
const theme = useTheme();
const {t} = useTranslation();

const {openActionSheet} = LoginMethodSelector({
onSelectMethod: (method) => {
setLoginMethod(method);
Expand Down Expand Up @@ -106,10 +108,22 @@ const SettingPage = () => {

<List.Item
title={t("settings.Version")}
description={Application.nativeApplicationVersion}
description={
Constants.executionEnvironment === ExecutionEnvironment.Standalone
? Application.nativeApplicationVersion
: Constants.expoConfig?.version
}
left={props => <List.Icon {...props} icon="information" />}
/>

{process.env.EXPO_PUBLIC_COMMIT_HASH && (
<List.Item
title={t("settings.Commit Hash")}
description={process.env.EXPO_PUBLIC_COMMIT_HASH.slice(0, 7)}
left={props => <List.Icon {...props} icon="git" />}
/>
)}

</List.Section>
</Surface>

Expand Down
10 changes: 6 additions & 4 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"scheme": "casdoor-app",
"sdkVersion": "52.0.0",
"runtimeVersion": {
"policy": "appVersion"
},
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": [
"**/*"
],
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "org.casdoor.casdoorapp",
Expand All @@ -26,7 +28,7 @@
"backgroundColor": "#ffffff"
},
"package": "org.casdoor.casdoorapp",
"versionCode": 0
"versionCode": 510011500
},
"web": {
"favicon": "./assets/favicon.png"
Expand Down
6 changes: 3 additions & 3 deletions locales/ar/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
"Preferences": "التفضيلات",
"Language": "اللغة",
"About": "حول",
"Version": "الإصدار"
"Version": "الإصدار",
"Commit Hash": "رمز التعديل"
},
"syncLogic": {
"Sync failed": "فشل المزامنة",
"Access token has expired, please login again": "انتهت صلاحية رمز الوصول، يرجى تسجيل الدخول مرة أخرى"
}
}

}
6 changes: 3 additions & 3 deletions locales/de/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
"Preferences": "Einstellungen",
"Language": "Sprache",
"About": "Über",
"Version": "Version"
"Version": "Version",
"Commit Hash": "Commit Hash"
},
"syncLogic": {
"Sync failed": "Synchronisierung fehlgeschlagen",
"Access token has expired, please login again": "Das Zugriffstoken ist abgelaufen, bitte melden Sie sich erneut an"
}
}

}
3 changes: 2 additions & 1 deletion locales/en/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
"Preferences": "Preferences",
"Language": "Language",
"About": "About",
"Version": "Version"
"Version": "Version",
"Commit Hash": "Commit Hash"
},
"syncLogic": {
"Sync failed": "Sync failed",
Expand Down
6 changes: 3 additions & 3 deletions locales/es/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
"Preferences": "Preferencias",
"Language": "Idioma",
"About": "Acerca de",
"Version": "Versión"
"Version": "Versión",
"Commit Hash": "Hash de confirmación"
},
"syncLogic": {
"Sync failed": "Error de sincronización",
"Access token has expired, please login again": "El token de acceso ha expirado, por favor inicie sesión nuevamente"
}
}

}
6 changes: 3 additions & 3 deletions locales/fr/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
"Preferences": "Préférences",
"Language": "Langue",
"About": "À propos",
"Version": "Version"
"Version": "Version",
"Commit Hash": "Hash de commit"
},
"syncLogic": {
"Sync failed": "Échec de la synchronisation",
"Access token has expired, please login again": "Le jeton d'accès a expiré, veuillez vous reconnecter"
}
}

}
3 changes: 2 additions & 1 deletion locales/ja/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
"Preferences": "設定",
"Language": "言語",
"About": "について",
"Version": "バージョン"
"Version": "バージョン",
"Commit Hash": "コミットハッシュ"
},
"syncLogic": {
"Sync failed": "同期に失敗しました",
Expand Down
6 changes: 3 additions & 3 deletions locales/ko/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
"Preferences": "설정",
"Language": "언어",
"About": "정보",
"Version": "버전"
"Version": "버전",
"Commit Hash": "커밋 해시"
},
"syncLogic": {
"Sync failed": "동기화 실패",
"Access token has expired, please login again": "액세스 토큰이 만료되었습니다. 다시 로그인해주세요"
}
}

}
6 changes: 3 additions & 3 deletions locales/pt/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
"Preferences": "Preferências",
"Language": "Idioma",
"About": "Sobre",
"Version": "Versão"
"Version": "Versão",
"Commit Hash": "Hash de Commit"
},
"syncLogic": {
"Sync failed": "Sincronização falhou",
"Access token has expired, please login again": "O token de acesso expirou, por favor faça login novamente"
}
}

}
6 changes: 3 additions & 3 deletions locales/ru/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
"Preferences": "Настройки",
"Language": "Язык",
"About": "О программе",
"Version": "Версия"
"Version": "Версия",
"Commit Hash": "Хэш коммита"
},
"syncLogic": {
"Sync failed": "Синхронизация не удалась",
"Access token has expired, please login again": "Токен доступа истёк, пожалуйста, войдите снова"
}
}

}
6 changes: 3 additions & 3 deletions locales/th/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
"Preferences": "การตั้งค่า",
"Language": "ภาษา",
"About": "เกี่ยวกับ",
"Version": "เวอร์ชัน"
"Version": "เวอร์ชัน",
"Commit Hash": "รหัสการตรวจสอบ"
},
"syncLogic": {
"Sync failed": "การซิงค์ล้มเหลว",
"Access token has expired, please login again": "โทเค็นการเข้าถึงหมดอายุ กรุณาล็อกอินอีกครั้ง"
}
}

}
6 changes: 3 additions & 3 deletions locales/uk/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
"Preferences": "Налаштування",
"Language": "Мова",
"About": "Про програму",
"Version": "Версія"
"Version": "Версія",
"Commit Hash": "Хеш коміта"
},
"syncLogic": {
"Sync failed": "Синхронізація не вдалася",
"Access token has expired, please login again": "Токен доступу минув, будь ласка, увійдіть знову"
}
}

}
3 changes: 2 additions & 1 deletion locales/zh/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
"Preferences": "偏好设置",
"Language": "语言",
"About": "关于",
"Version": "版本"
"Version": "版本",
"Commit Hash": "提交哈希"
},
"syncLogic": {
"Sync failed": "同步失败",
Expand Down
Loading

0 comments on commit 00235c0

Please sign in to comment.