Skip to content

Commit

Permalink
fix: 🐛 Hämta alla aviseringar och sortera på senast ändrad
Browse files Browse the repository at this point in the history
  • Loading branch information
kajetan-kazimierczak committed Sep 30, 2021
1 parent fab42c8 commit 71cb230
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
4 changes: 3 additions & 1 deletion packages/app/components/notification.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export const Notification = ({ item }: NotificationProps) => {
const open = () => setIsOpen(true)
const close = () => setIsOpen(false)

const displayDate = item.dateCreated
const displayDate = item.dateModified
? moment(item.dateModified).fromNow()
: item.dateCreated
? moment(item.dateCreated).fromNow()
: null

Expand Down
8 changes: 8 additions & 0 deletions packages/app/components/notificationsList.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ export const NotificationsList = () => {
const child = useChild()
const { data } = useNotifications(child)

data.sort((a, b) =>
a.dateModified > b.dateModified
? -1
: b.dateModified > a.dateModified
? 1
: 0
)

return (
<List
style={styles.container}
Expand Down
4 changes: 2 additions & 2 deletions packages/app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: 33c82491102f20ecddb6c6a2c273696ace3191e0
FBReactNativeSpec: df8f81d2a7541ee6755a047b398a5cb5a72acd0e
Flipper: b1fddf9a17c32097b2b4c806ad158b2f36bb2692
Expand All @@ -619,7 +619,7 @@ SPEC CHECKSUMS:
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
FlipperKit: aec2d931adeee48a07bab1ea8bcc8a6bb87dfce4
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 5337263514dd6f09803962437687240c5dc39aa4
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
hermes-engine: 7dcd1dbd908e6353bd7e4a4add72dba7bf76bf84
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@react-navigation/stack": "5.14.4",
"@skolplattformen/api-hooks": "3.0.0",
"@skolplattformen/curriculum": "1.4.2",
"@skolplattformen/embedded-api": "5.3.2",
"@skolplattformen/embedded-api": "5.3.3",
"@ui-kitten/components": "5.0.0",
"@ui-kitten/eva-icons": "5.0.0",
"buffer": "6.0.3",
Expand Down
8 changes: 4 additions & 4 deletions packages/app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1341,10 +1341,10 @@
dependencies:
deepmerge "^4.2.2"

"@skolplattformen/embedded-api@5.3.2":
version "5.3.2"
resolved "https://registry.yarnpkg.com/@skolplattformen/embedded-api/-/embedded-api-5.3.2.tgz#13bf2192ecd5d7e4140c17183eab574988eb9e00"
integrity sha512-sh7NaImGDBfb5AO9igFVtTn1atWZ423yYU2HivsbcdDkFJgWXkwuTShWnV92bhV5qjUIF5ckNvdpV7FvJdp5WA==
"@skolplattformen/embedded-api@5.3.3":
version "5.3.3"
resolved "https://registry.yarnpkg.com/@skolplattformen/embedded-api/-/embedded-api-5.3.3.tgz#9c8b9c93a4d3f4857c79568a6be8b6bcab1817c2"
integrity sha512-rLE23xHdXSeBnax/pWEaVMG2nB9iHAk6tpIOnjCzcFUbm4OYNeJlfgoJkIZgNsDu5wYGJad7VJU0L0FSwVVnMA==
dependencies:
camelcase-keys "^6.2.2"
change-case "^4.1.2"
Expand Down

0 comments on commit 71cb230

Please sign in to comment.