Skip to content

Commit

Permalink
feat(mobile): minor ui tweaks (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkdev98 authored Sep 7, 2024
1 parent 60a0ac6 commit 92bd451
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
11 changes: 9 additions & 2 deletions apps/mobile/app/(app)/appearance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useColorScheme } from '@/hooks/useColorScheme'
import { t } from '@lingui/macro'
import { useLingui } from '@lingui/react'
import { MoonStarIcon, SunIcon } from 'lucide-react-native'
import { ScrollView } from 'react-native'
import { ScrollView, StatusBar } from 'react-native'

export default function AppearanceScreen() {
const { colorScheme, setColorScheme } = useColorScheme()
Expand All @@ -21,7 +21,14 @@ export default function AppearanceScreen() {
<Tabs
value={colorScheme || 'light'}
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
onValueChange={(value: any) => setColorScheme(value)}
onValueChange={(value: any) => {
setColorScheme(value)
if (value === 'dark') {
StatusBar.setBarStyle('light-content')
} else {
StatusBar.setBarStyle('dark-content')
}
}}
>
<TabsList>
<TabsTrigger value="light">
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/app/(app)/transaction/new-record.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function NewRecordScreen() {
}}
className="w-[160px]"
>
<TabsList className="border border-border dark:border-background/20">
<TabsList className="border border-border dark:border-primary/10">
<TabsTrigger value="0">
<KeyboardIcon className="!text-primary size-6" />
</TabsTrigger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export function SelectCategoryField({
/>
<TextTicker
marqueeDelay={500}
duration={180 * item.name.length}
duration={200 * item.name.length}
bouncePadding={{ left: 5, right: 5 }}
bounce
loop
Expand Down
7 changes: 5 additions & 2 deletions apps/mobile/lib/date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ const shortenAmPm = (text: string): string => {

const removeLeadingZero = (text: string): string => text.replace(/^0/, '')

export const formatTime = (date: Date, locale?: string): string => {
export const formatTime = (date?: Date, locale?: string): string => {
if (!date) {
return ''
}
return removeLeadingZero(
shortenAmPm(
date.toLocaleTimeString(locale, {
new Date(date)?.toLocaleTimeString?.(locale || 'en-US', {
hour: '2-digit',
minute: '2-digit',
}) || '',
Expand Down

0 comments on commit 92bd451

Please sign in to comment.