skolplattformen-backup/packages/app/components/notificationsList.component...

33 lines
775 B
TypeScript
Raw Normal View History

import { useNotifications } from '@skolplattformen/api-hooks'
import { List } from '@ui-kitten/components'
2021-02-20 08:38:08 +00:00
import React from 'react'
import { StyleSheet } from 'react-native'
import { useChild } from './childContext.component'
import { Notification } from './notification.component'
2021-01-26 11:02:24 +00:00
export const NotificationsList = () => {
const child = useChild()
2021-02-20 08:38:08 +00:00
const { data } = useNotifications(child)
2021-01-26 11:02:24 +00:00
return (
<List
style={styles.container}
contentContainerStyle={styles.contentContainer}
data={data}
2021-01-26 11:02:24 +00:00
renderItem={(info) => (
<Notification key={info.item.id} item={info.item} />
)}
/>
2021-01-26 11:02:24 +00:00
)
}
const styles = StyleSheet.create({
container: {
height: '100%',
width: '100%',
},
2021-01-26 11:02:24 +00:00
contentContainer: {
padding: 10,
},
2021-01-26 11:02:24 +00:00
})