fix: app
This commit is contained in:
@@ -8,13 +8,13 @@ import {
|
||||
StatusBar as RNStatusBar,
|
||||
Alert,
|
||||
ScrollView,
|
||||
Platform,
|
||||
} from 'react-native'
|
||||
import { StatusBar } from 'expo-status-bar'
|
||||
import { SafeAreaView } from 'react-native-safe-area-context'
|
||||
import { Image } from 'expo-image'
|
||||
import { useRouter, useLocalSearchParams } from 'expo-router'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { LinearGradient } from 'expo-linear-gradient'
|
||||
|
||||
import { LeftArrowIcon, DeleteIcon, EditIcon, ChangeIcon, WhiteStarIcon } from '@/components/icon'
|
||||
import { DeleteConfirmDialog } from '@/components/ui/delete-confirm-dialog'
|
||||
@@ -128,13 +128,13 @@ export default function GenerationRecordScreen() {
|
||||
switch (status?.toLowerCase()) {
|
||||
case 'completed':
|
||||
case 'success':
|
||||
return '#4CAF50'
|
||||
return '#4ADE80'
|
||||
case 'pending':
|
||||
case 'processing':
|
||||
return '#FF9800'
|
||||
return '#FF9966'
|
||||
case 'failed':
|
||||
case 'error':
|
||||
return '#F44336'
|
||||
return '#FF6B6B'
|
||||
default:
|
||||
return '#8A8A8A'
|
||||
}
|
||||
@@ -277,50 +277,61 @@ export default function GenerationRecordScreen() {
|
||||
|
||||
{/* 操作按钮 */}
|
||||
<View style={styles.actionSection}>
|
||||
{/* 下载按钮 */}
|
||||
{/* 下载按钮 - 主要操作使用渐变色 */}
|
||||
{hasResult && (
|
||||
<Pressable
|
||||
style={[styles.actionButton, styles.downloadButton, downloading && styles.buttonDisabled]}
|
||||
style={[styles.primaryButtonContainer, downloading && styles.buttonDisabled]}
|
||||
onPress={handleDownload}
|
||||
disabled={downloading}
|
||||
>
|
||||
<Text style={styles.downloadButtonText}>
|
||||
{downloading
|
||||
? `${t('generationRecord.downloading')} ${Math.round(progress * 100)}%`
|
||||
: t('generationRecord.download')}
|
||||
</Text>
|
||||
<LinearGradient
|
||||
colors={['#9966FF', '#FF6699', '#FF9966']}
|
||||
locations={[0.0015, 0.4985, 0.9956]}
|
||||
start={{ x: 1, y: 0 }}
|
||||
end={{ x: 0, y: 0 }}
|
||||
style={styles.gradientButton}
|
||||
>
|
||||
<Text style={styles.primaryButtonText}>
|
||||
{downloading
|
||||
? `${t('generationRecord.downloading')} ${Math.round(progress * 100)}%`
|
||||
: t('generationRecord.download')}
|
||||
</Text>
|
||||
</LinearGradient>
|
||||
</Pressable>
|
||||
)}
|
||||
|
||||
{/* 重新生成按钮 */}
|
||||
<Pressable
|
||||
style={[styles.actionButton, styles.rerunButton, rerunning && styles.buttonDisabled]}
|
||||
onPress={handleRerun}
|
||||
disabled={rerunning}
|
||||
>
|
||||
<ChangeIcon />
|
||||
<Text style={styles.actionButtonText}>{t('generationRecord.regenerate')}</Text>
|
||||
</Pressable>
|
||||
|
||||
{/* 再来一次按钮 */}
|
||||
{generation.template && (
|
||||
{/* 次要操作按钮行 */}
|
||||
<View style={styles.secondaryButtonRow}>
|
||||
{/* 重新生成按钮 */}
|
||||
<Pressable
|
||||
style={[styles.actionButton, styles.tryAgainButton]}
|
||||
onPress={handleTryAgain}
|
||||
style={[styles.secondaryButton, rerunning && styles.buttonDisabled]}
|
||||
onPress={handleRerun}
|
||||
disabled={rerunning}
|
||||
>
|
||||
<EditIcon />
|
||||
<Text style={styles.actionButtonText}>{t('generationRecord.reEdit')}</Text>
|
||||
<ChangeIcon />
|
||||
<Text style={styles.secondaryButtonText}>{t('generationRecord.regenerate')}</Text>
|
||||
</Pressable>
|
||||
)}
|
||||
|
||||
{/* 删除按钮 */}
|
||||
<Pressable
|
||||
style={[styles.actionButton, styles.deleteActionButton, deleting && styles.buttonDisabled]}
|
||||
onPress={() => setDeleteDialogOpen(true)}
|
||||
disabled={deleting}
|
||||
>
|
||||
<DeleteIcon />
|
||||
</Pressable>
|
||||
{/* 再来一次按钮 */}
|
||||
{generation.template && (
|
||||
<Pressable
|
||||
style={styles.secondaryButton}
|
||||
onPress={handleTryAgain}
|
||||
>
|
||||
<EditIcon />
|
||||
<Text style={styles.secondaryButtonText}>{t('generationRecord.reEdit')}</Text>
|
||||
</Pressable>
|
||||
)}
|
||||
|
||||
{/* 删除按钮 */}
|
||||
<Pressable
|
||||
style={[styles.deleteButton, deleting && styles.buttonDisabled]}
|
||||
onPress={() => setDeleteDialogOpen(true)}
|
||||
disabled={deleting}
|
||||
>
|
||||
<DeleteIcon />
|
||||
</Pressable>
|
||||
</View>
|
||||
</View>
|
||||
</ScrollView>
|
||||
|
||||
@@ -438,40 +449,52 @@ const styles = StyleSheet.create({
|
||||
paddingHorizontal: 12,
|
||||
gap: 12,
|
||||
},
|
||||
actionButton: {
|
||||
// 主要按钮 - 渐变色
|
||||
primaryButtonContainer: {
|
||||
height: 48,
|
||||
borderRadius: 12,
|
||||
overflow: 'hidden',
|
||||
},
|
||||
gradientButton: {
|
||||
flex: 1,
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
paddingHorizontal: 16,
|
||||
paddingVertical: 12,
|
||||
borderRadius: 12,
|
||||
backgroundColor: '#1C1E22',
|
||||
gap: 8,
|
||||
},
|
||||
downloadButton: {
|
||||
backgroundColor: '#4CAF50',
|
||||
},
|
||||
downloadButtonText: {
|
||||
primaryButtonText: {
|
||||
color: '#FFFFFF',
|
||||
fontSize: 14,
|
||||
fontSize: 16,
|
||||
fontWeight: '600',
|
||||
},
|
||||
rerunButton: {
|
||||
backgroundColor: '#1C1E22',
|
||||
// 次要按钮行
|
||||
secondaryButtonRow: {
|
||||
flexDirection: 'row',
|
||||
gap: 8,
|
||||
},
|
||||
tryAgainButton: {
|
||||
backgroundColor: '#1C1E22',
|
||||
secondaryButton: {
|
||||
flex: 1,
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
height: 48,
|
||||
borderRadius: 12,
|
||||
backgroundColor: '#262A31',
|
||||
gap: 6,
|
||||
},
|
||||
deleteActionButton: {
|
||||
backgroundColor: '#1C1E22',
|
||||
width: 48,
|
||||
alignSelf: 'flex-end',
|
||||
},
|
||||
actionButtonText: {
|
||||
secondaryButtonText: {
|
||||
color: '#F5F5F5',
|
||||
fontSize: 14,
|
||||
fontWeight: '500',
|
||||
},
|
||||
deleteButton: {
|
||||
width: 48,
|
||||
height: 48,
|
||||
borderRadius: 12,
|
||||
backgroundColor: '#262A31',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
buttonDisabled: {
|
||||
opacity: 0.5,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user