feat: add mobile shell and unified search
Some checks failed
ci / 정본·보안·린트·타입·테스트 (push) Failing after 50s
ci / 워크스페이스 빌드 검증 (push) Has been skipped
ci / Supabase Edge Functions + Cloudflare Worker (push) Successful in 20s
ci / .NET API 서버 테스트 (push) Successful in 12s
deploy-site / deploy (push) Successful in 39s
ci / 모바일 린트·타입·Jest (push) Failing after 3h10m31s
Some checks failed
ci / 정본·보안·린트·타입·테스트 (push) Failing after 50s
ci / 워크스페이스 빌드 검증 (push) Has been skipped
ci / Supabase Edge Functions + Cloudflare Worker (push) Successful in 20s
ci / .NET API 서버 테스트 (push) Successful in 12s
deploy-site / deploy (push) Successful in 39s
ci / 모바일 린트·타입·Jest (push) Failing after 3h10m31s
This commit is contained in:
parent
f505a03d34
commit
5ca3709b32
98 changed files with 5168 additions and 2093 deletions
|
|
@ -20,10 +20,10 @@ import {
|
|||
View,
|
||||
} from 'react-native'
|
||||
import { useIsFocused } from '@react-navigation/native'
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
||||
import { useI18n, type TranslationKey } from '@d3ro/i18n'
|
||||
import type {
|
||||
DictationTemplateField,
|
||||
DocumentTemplateType,
|
||||
TemplateKind,
|
||||
UserTemplate,
|
||||
UserTemplateSelection,
|
||||
|
|
@ -31,6 +31,7 @@ import type {
|
|||
import { useAuth } from '../lib/auth-context'
|
||||
import { useMobilePreferences } from '../lib/preferences-context'
|
||||
import { ThemeButton, ThemeCard, ThemeText } from '../theme/themed-components'
|
||||
import { ScreenHeader } from '../components/ScreenHeader'
|
||||
import {
|
||||
createTemplate,
|
||||
deleteTemplate,
|
||||
|
|
@ -43,6 +44,14 @@ import {
|
|||
updateTemplate,
|
||||
} from '../features/templates'
|
||||
|
||||
const TEMPLATE_TYPE_KEYS: Record<DocumentTemplateType, TranslationKey> = {
|
||||
minutes: 'mobile.templates.type.minutes',
|
||||
report: 'mobile.templates.type.report',
|
||||
'idea-note': 'mobile.templates.type.ideaNote',
|
||||
custom: 'mobile.templates.type.custom',
|
||||
mindmap: 'mobile.templates.type.mindmap',
|
||||
}
|
||||
|
||||
interface TemplatesScreenProps {
|
||||
initialKind?: TemplateKind
|
||||
onSelectTemplate?: (template: UserTemplate) => void
|
||||
|
|
@ -123,7 +132,6 @@ export default function TemplatesScreen({
|
|||
initialKind = 'dictation',
|
||||
onSelectTemplate,
|
||||
}: TemplatesScreenProps): React.ReactElement {
|
||||
const insets = useSafeAreaInsets()
|
||||
const isFocused = useIsFocused()
|
||||
const { t } = useI18n()
|
||||
const { user } = useAuth()
|
||||
|
|
@ -347,7 +355,9 @@ export default function TemplatesScreen({
|
|||
<ThemeText variant="small" color="muted">
|
||||
{item.template_kind === 'dictation'
|
||||
? t('mobile.templates.fieldCount', { count: item.fields.length })
|
||||
: t('mobile.templates.documentType', { type: item.template_type ?? 'custom' })}
|
||||
: t('mobile.templates.documentType', {
|
||||
type: t(TEMPLATE_TYPE_KEYS[item.template_type ?? 'custom']),
|
||||
})}
|
||||
</ThemeText>
|
||||
<View style={styles.actions}>
|
||||
<ThemeButton
|
||||
|
|
@ -403,13 +413,14 @@ export default function TemplatesScreen({
|
|||
|
||||
return (
|
||||
<View style={styles.container} testID="templates-screen">
|
||||
<View style={[styles.header, { paddingTop: insets.top + 10 }]}>
|
||||
<View style={styles.headerText}>
|
||||
<ThemeText variant="title" accessibilityRole="header">{t('mobile.templates.title')}</ThemeText>
|
||||
<ThemeText variant="small" color="muted">{t('mobile.templates.description')}</ThemeText>
|
||||
</View>
|
||||
<ThemeButton label={t('mobile.templates.add')} onPress={openCreate} testID="templates-add" />
|
||||
</View>
|
||||
<ScreenHeader
|
||||
title={t('mobile.templates.title')}
|
||||
subtitle={t('mobile.templates.description')}
|
||||
rightContent={(
|
||||
<ThemeButton label={t('mobile.templates.add')} onPress={openCreate} testID="templates-add" />
|
||||
)}
|
||||
testID="templates-header"
|
||||
/>
|
||||
{!realtimeConnected && (
|
||||
<View style={styles.banner} testID="templates-realtime-warning">
|
||||
<ThemeText variant="small" color="muted">{t('mobile.templates.realtimeWaiting')}</ThemeText>
|
||||
|
|
@ -669,7 +680,7 @@ function createStyles(palette: Palette): ReturnType<typeof StyleSheet.create> {
|
|||
banner: { paddingHorizontal: 20, paddingVertical: 8, backgroundColor: palette.accent.dim },
|
||||
controls: { padding: 16, gap: 10, borderBottomWidth: 1, borderBottomColor: palette.border.subtle },
|
||||
tabs: { flexDirection: 'row', gap: 8 },
|
||||
tab: { flex: 1, minHeight: 44, alignItems: 'center', justifyContent: 'center', borderRadius: 9, borderWidth: 1, borderColor: palette.border.default },
|
||||
tab: { flex: 1, minHeight: 48, alignItems: 'center', justifyContent: 'center', borderRadius: 9, borderWidth: 1, borderColor: palette.border.default },
|
||||
tabActive: { backgroundColor: palette.accent.main, borderColor: palette.accent.main },
|
||||
input: { minHeight: 48, borderWidth: 1, borderColor: palette.border.default, borderRadius: 10, backgroundColor: palette.bg.inset, color: palette.text.primary, paddingHorizontal: 12, fontSize: 14 },
|
||||
inlineError: { padding: 12, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 10, borderBottomWidth: 1, borderBottomColor: palette.tag.red },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue