Skip to content

Commit 70a8ee4

Browse files
authored
Merge pull request #48 from ansari-project/usability-improvements
Usability improvements
2 parents 839e5f8 + 714788b commit 70a8ee4

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

src/components/chat/ChatInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const ChatInput: React.FC<ChatInputProps> = ({ value, onSendPress, onInputChange
9292
onKeyPress={(event: KeyboardEvent) => handleKeyPress(event)}
9393
onChangeText={handleChange}
9494
onContentSizeChange={handleContentSizeChange}
95-
className={`flex-1 rounded text-sm ${isRTL ? 'ml-2.5 text-right' : 'mr-2.5 text-left'}`}
95+
className={`flex-1 rounded text-base ${isRTL ? 'ml-2.5 text-right' : 'mr-2.5 text-left'}`}
9696
style={{
9797
color: theme.textColor,
9898
outlineWidth: 0,

src/components/chat/MessageBubble.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ const markdownStyles = {
155155
},
156156
heading5: {
157157
flexDirection: 'row',
158-
fontSize: 13,
158+
fontSize: 16,
159159
},
160160
heading6: {
161161
flexDirection: 'row',
162-
fontSize: 11,
162+
fontSize: 16,
163163
},
164164

165165
// Horizontal Rule

src/components/menu/NameContainer.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useDispatch, useSelector } from 'react-redux'
77
import { useTranslation } from 'react-i18next'
88
import { useRouter } from 'expo-router'
99
import { CloseIcon, LikeIcon, LogoutIcon } from '@/components/svg'
10-
import { useAuth } from '@/hooks'
10+
import { useAuth, useLogout } from '@/hooks'
1111

1212
type NameContainerProps = {
1313
name: string
@@ -24,6 +24,7 @@ const NameContainer: React.FC<NameContainerProps> = ({ name, nameColor, displayN
2424
const { t } = useTranslation('common')
2525
const router = useRouter()
2626
const dispatch = useDispatch<AppDispatch>()
27+
const doLogout = useLogout()
2728

2829
if (nameColor === undefined) {
2930
nameColor = theme.textColor
@@ -105,10 +106,11 @@ const NameContainer: React.FC<NameContainerProps> = ({ name, nameColor, displayN
105106
)}
106107
<Pressable
107108
className={'flex-row items-center py-4'}
108-
onPress={() => {
109+
onPress={async () => {
109110
setIsVisible(false)
110111
dispatch(toggleSideMenu(false))
111-
router.push('/logout')
112+
await doLogout()
113+
router.push('/')
112114
}}
113115
>
114116
<LogoutIcon stroke={theme.textColor} />

src/components/prompts/PromptCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ const PromptCard: React.FC<Props> = ({ title, subtitle, Icon, onPress, isMiddle
4343
>
4444
<View className='flex-1'>
4545
<StyledText
46-
className='text-sm leading-[21px] font-bold'
46+
className='text-base font-bold'
4747
textAlign='left'
4848
style={{ color: isActive ? theme.hoverColor : theme.textColor }}
4949
>
5050
{title}
5151
</StyledText>
5252
<StyledText
5353
textAlign='left'
54-
className='text-sm leading-[21px] font-normal'
54+
className='text-base font-normal'
5555
style={{ color: isActive ? theme.hoverColor : theme.textColor }}
5656
>
5757
{subtitle}

src/services/UserService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class UserService {
6262

6363
// Checking if the response is OK (status code in the range 200-299)
6464
if (!response.ok) {
65-
throw new ApplicationError('Failed to update password')
65+
const error = await response.json()
66+
throw new ApplicationError(error.detail || error.error || error.message || 'Failed to update password')
6667
}
6768

6869
// Parsing the JSON response

src/utils/styles.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const createThemedStyles = (
8282
color: theme.buttonPrimaryColor,
8383
fontWeight: 'bold',
8484
fontFamily: 'Inter',
85+
fontSize: 16,
8586
},
8687
buttonSecondary: {
8788
cursor: 'pointer',
@@ -98,6 +99,7 @@ const createThemedStyles = (
9899
color: theme.buttonSecondaryColor,
99100
fontWeight: 'bold',
100101
fontFamily: 'Inter',
102+
fontSize: 16,
101103
},
102104
buttonTextDisabled: {
103105
color: theme.textColor,

0 commit comments

Comments
 (0)