Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/mobile/components/chat/chat-input-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ function ChatInputNotices({
compact
/>
)}
{speechError && (
<Text
style={[styles.errorText, { color: tokens.statusBadText }]}
accessibilityRole="alert"
>
{speechError}
</Text>
)}
{speechError === t("speech.micDenied") && (
<TouchableOpacity
style={styles.permissionAction}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,25 @@ export function FrequencyTypeCards({
return (
<View style={styles.fieldGroup}>
<Text style={styles.label}>{t("habits.form.frequency")}</Text>
<View style={styles.frequencyCarousel} onLayout={handleLayout}>
<View style={styles.frequencyCarouselRow}>
<Pressable
style={[
styles.frequencyArrow,
activeIndex === 0 ? styles.frequencyArrowDisabled : null,
]}
disabled={activeIndex === 0}
onPress={() => goToIndex(activeIndex - 1)}
accessibilityRole="button"
accessibilityLabel={t("common.previous")}
hitSlop={8}
>
<ChevronLeft size={18} strokeWidth={2} color={tokens.fg2} />
</Pressable>

<ScrollView
ref={scrollRef}
style={styles.frequencyScroll}
onLayout={handleLayout}
horizontal
pagingEnabled
showsHorizontalScrollIndicator={false}
Expand Down Expand Up @@ -165,36 +181,21 @@ export function FrequencyTypeCards({
})}
</ScrollView>

<View style={styles.frequencyArrowRow} pointerEvents="box-none">
<Pressable
style={[
styles.frequencyArrow,
activeIndex === 0 ? styles.frequencyArrowHidden : null,
]}
disabled={activeIndex === 0}
onPress={() => goToIndex(activeIndex - 1)}
accessibilityRole="button"
accessibilityLabel={t("common.previous")}
hitSlop={8}
>
<ChevronLeft size={18} strokeWidth={2} color={tokens.fg2} />
</Pressable>
<Pressable
style={[
styles.frequencyArrow,
activeIndex === FREQUENCY_TYPE_CARDS.length - 1
? styles.frequencyArrowHidden
: null,
]}
disabled={activeIndex === FREQUENCY_TYPE_CARDS.length - 1}
onPress={() => goToIndex(activeIndex + 1)}
accessibilityRole="button"
accessibilityLabel={t("common.next")}
hitSlop={8}
>
<ChevronRight size={18} strokeWidth={2} color={tokens.fg2} />
</Pressable>
</View>
<Pressable
style={[
styles.frequencyArrow,
activeIndex === FREQUENCY_TYPE_CARDS.length - 1
? styles.frequencyArrowDisabled
: null,
]}
disabled={activeIndex === FREQUENCY_TYPE_CARDS.length - 1}
onPress={() => goToIndex(activeIndex + 1)}
accessibilityRole="button"
accessibilityLabel={t("common.next")}
hitSlop={8}
>
<ChevronRight size={18} strokeWidth={2} color={tokens.fg2} />
</Pressable>
</View>

<View style={styles.frequencyDots}>
Expand Down
24 changes: 9 additions & 15 deletions apps/mobile/components/habits/habit-form-fields/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,13 @@ export function createStyles(tokens: AppTokens) {
fontSize: 20,
lineHeight: 25,
},
frequencyCarousel: {
position: "relative",
frequencyCarouselRow: {
flexDirection: "row",
alignItems: "center",
gap: 6,
},
frequencyScroll: {
flex: 1,
},
frequencySlide: {
paddingHorizontal: 4,
Expand All @@ -448,17 +453,6 @@ export function createStyles(tokens: AppTokens) {
borderWidth: 1.5,
borderColor: tokens.primary,
},
frequencyArrowRow: {
position: "absolute",
top: 0,
bottom: 0,
left: 0,
right: 0,
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
paddingHorizontal: 2,
},
frequencyArrow: {
width: 32,
height: 32,
Expand All @@ -469,8 +463,8 @@ export function createStyles(tokens: AppTokens) {
borderWidth: 1,
borderColor: tokens.hairline,
},
frequencyArrowHidden: {
opacity: 0,
frequencyArrowDisabled: {
opacity: 0.3,
},
frequencyDots: {
flexDirection: "row",
Expand Down
Loading