Skip to content

Commit

Permalink
add notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
docimin committed Jun 29, 2024
1 parent 0bfe0f3 commit e25a44c
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 11 deletions.
1 change: 1 addition & 0 deletions messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"gallery": "Galerie",
"events": "Veranstaltungen",
"announcements": "Ankündigungen",
"notifications": "Benachrichtigungen",
"users": "Benutzer",
"myprofile": "Mein Profil",
"communities": "Gemeinschaften",
Expand Down
1 change: 1 addition & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"gallery": "Gallery",
"events": "Events",
"announcements": "Announcements",
"notifications": "Notifications",
"users": "Users",
"myprofile": "My Profile",
"communities": "Communities",
Expand Down
1 change: 1 addition & 0 deletions messages/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"gallery": "Galerij",
"events": "Evenementen",
"announcements": "Aankondigingen",
"notifications": "Meldingen",
"users": "Gebruikers",
"myprofile": "Mijn Profiel",
"communities": "Gemeenschappen",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"type": "module",
"scripts": {
"dev": "next dev --turbo",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/(auth)/login/page.client.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client'
import { useEffect, useState } from 'react'
import { useState } from 'react'
import {
SiGithub,
SiDiscord,
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/(main)/announcements/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default async function AnnouncementsPage() {
<PageLayout title={'Announcements'}>
<ul
role="list"
className="mx-auto mb-4 mt-8 max-w-4xl divide-y divide-gray-100 overflow-hidden shadow-sm ring-1 ring-black/95 dark:ring-white/95 sm:rounded-xl"
className="mx-8 lg:mx-auto mb-4 mt-8 max-w-4xl divide-y divide-gray-100 overflow-hidden shadow-sm ring-1 ring-black/95 dark:ring-white/95 sm:rounded-xl"
>
{announcementData &&
announcementData.map((announcement) => {
Expand Down
10 changes: 3 additions & 7 deletions src/app/[locale]/(user)/notifications/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import { getUserDataSingle } from '@/utils/server-api/user/getUserData'
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
import { getAvatarImageUrlPreview } from '@/components/getStorageItem'

export const runtime = 'edge'

export default async function Page() {
const notifications = await getUserNotifications()
return (
<PageLayout title={'Notifications'}>
<ul
role="list"
className="mx-auto mb-4 mt-8 max-w-4xl divide-y divide-gray-100 overflow-hidden shadow-sm ring-1 ring-black/95 dark:ring-white/95 sm:rounded-xl"
className="mx-8 lg:mx-auto mb-4 mt-8 max-w-4xl divide-y divide-gray-100 overflow-hidden shadow-sm ring-1 ring-black/95 dark:ring-white/95 sm:rounded-xl"
>
{notifications &&
notifications.documents.map(async (notification) => {
Expand Down Expand Up @@ -47,12 +49,6 @@ export default async function Page() {
</p>
</div>
</div>
<div className="flex shrink-0 items-center gap-x-4">
<ChevronRight
className="h-5 w-5 flex-none text-gray-400"
aria-hidden="true"
/>
</div>
</li>
)
}
Expand Down
1 change: 1 addition & 0 deletions src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default async function LocaleLayout({ children, params: { locale } }) {
gallery={pageNames('gallery')}
events={pageNames('events')}
announcements={pageNames('announcements')}
notifications={pageNames('notifications')}
users={pageNames('users')}
myprofile={pageNames('myprofile')}
legal={pageNames('legal')}
Expand Down
1 change: 0 additions & 1 deletion src/components/account/views/frontpage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Button } from '@/components/ui/button'
import { Label } from '@/components/ui/label'
import { Textarea } from '@/components/ui/textarea'
import { databases } from '@/app/appwrite-client'
import { Checkbox } from '@/components/ui/checkbox'
import { useToast } from '@/components/ui/use-toast'
import { useState } from 'react'
import UploadAvatar from '@/components/account/uploadAvatar'
Expand Down
8 changes: 8 additions & 0 deletions src/components/header/data.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client'
import {
BellIcon,
CalendarIcon,
CircleUserIcon,
File,
Expand Down Expand Up @@ -35,6 +36,13 @@ export const Nav1 = (translations: any) => [
variant: 'ghost' as const,
href: `/announcements`,
},
{
title: translations.notifications,
label: '',
icon: BellIcon,
variant: 'ghost' as const,
href: `/notifications`,
},
{
title: translations.events,
label: '',
Expand Down

0 comments on commit e25a44c

Please sign in to comment.