Skip to content

Commit

Permalink
add activity indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
yjshin229 committed Dec 6, 2023
1 parent b92dad5 commit acf91f0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
4 changes: 2 additions & 2 deletions TaskTerriers/src/Screens/MessagesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { MaterialIcons } from '@expo/vector-icons'
import { BUColor, NeutralColor } from '../Libs'
import { Span } from '../StyleToProps'

interface Props {}
interface Props { }

const MessagesTab = ({ navigation, route }) => {
/*********
Expand Down Expand Up @@ -118,7 +118,7 @@ const MessagesTab = ({ navigation, route }) => {
return (
<MessagesCard
chatName={item?.chatName}
messagePreview={'previewwwwwwwwdfla;dfdlfsdjklfdjsl'}
messagePreview={'Message Preview'}
profilePicPath={''}
onPress={() => onPressCard(item)}
/>
Expand Down
28 changes: 20 additions & 8 deletions TaskTerriers/src/Screens/Services/ServiceDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IconNames } from '../../components/types'
import { TaskTerriersNavigationModule } from '../../modules/NavigationModule'
import TaskTerriersSafeAreaView from '../../Views/TaskTerriersSafeAreaView'
import { Col, Row, Span } from '../../StyleToProps'
import { NeutralColor } from '../../Libs'
import { BUColor, NeutralColor } from '../../Libs'
import { Divider } from '../../components/Divider'
import { ActivityIndicator, LayoutChangeEvent, ScrollView } from 'react-native'
import { UniversalButton } from '../../components/Buttons'
Expand Down Expand Up @@ -66,7 +66,7 @@ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia

useEffect(() => {
GET_user_details()
setIsLoading(false)

}, [serviceDetail])

/************
Expand All @@ -83,6 +83,8 @@ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
console.log(result)
} catch (error) {
console.error('Error fetching service details:', error)
} finally {
setIsLoading(false)
}
}

Expand Down Expand Up @@ -203,18 +205,28 @@ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
)
}

const renderActivityIndicator = () => {
return (
<Col mt20>
<ActivityIndicator size={'large'} color={BUColor['red']} />
</Col>
)
}

/***********
* render()
***********/
return (
<TaskTerriersSafeAreaView style={{ flex: 1, backgroundColor: NeutralColor['neutral-100'] }}>
{renderNavBar()}
<Col flex p16>
{renderProfileSection()}
<Divider />
{renderInfo()}
{renderLocation()}
</Col>
{isLoading ? renderActivityIndicator() :
<Col flex p16>
{renderProfileSection()}
<Divider />
{renderInfo()}
{renderLocation()}
</Col>
}
{renderMessageButton()}
</TaskTerriersSafeAreaView>
)
Expand Down

0 comments on commit acf91f0

Please sign in to comment.