Skip to content

Commit

Permalink
fix map, fix isfollowing
Browse files Browse the repository at this point in the history
  • Loading branch information
docimin committed Aug 31, 2024
1 parent f7f217d commit c01c32b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions src/app/[locale]/(main)/map/page.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogTitle,
} from '@/components/ui/dialog'
import { formatDate } from '@/components/calculateTimeLeft'
Expand All @@ -16,6 +15,7 @@ import { toast } from 'sonner'
import { client, Query } from '@/app/appwrite-client'
import { Polygon } from '@/components/map/polygon'
import { Circle } from '@/components/map/circle'
import sanitizeHtml from 'sanitize-html'

export default function PageClient() {
const [events, setEvents] = useState<Events.EventsType>(null)
Expand Down Expand Up @@ -174,6 +174,9 @@ export default function PageClient() {
return `${process.env.NEXT_PUBLIC_API_URL}/v1/storage/buckets/avatars/files/${avatarId}/preview?project=${process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID}&width=100&height=100`
}

const sanitizedDescription = sanitizeHtml(currentEvent?.description)
const descriptionResult = sanitizedDescription.replace(/\n/g, '<br />')

return (
<div className={'h-[90vh] w-full'}>
<Dialog
Expand All @@ -193,11 +196,15 @@ export default function PageClient() {
>
<DialogContent>
<DialogTitle>{currentEvent?.title}</DialogTitle>
<DialogDescription>{currentEvent?.description}</DialogDescription>
<DialogFooter>
<div>Start: {formatDate(new Date(currentEvent?.date))}</div>
<div>Until: {formatDate(new Date(currentEvent?.dateUntil))}</div>
</DialogFooter>
<DialogDescription>
<div
dangerouslySetInnerHTML={{
__html: descriptionResult || 'Nothing here yet!',
}}
/>
</DialogDescription>
<div>Start: {formatDate(new Date(currentEvent?.date))}</div>
<div>Until: {formatDate(new Date(currentEvent?.dateUntil))}</div>
</DialogContent>
</Dialog>

Expand Down
2 changes: 1 addition & 1 deletion src/utils/server-api/followers/getFollowing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function getIsFollowing(followerId: string) {
'',
false,
`/user/isFollowing?followerId=${followerId}`,
ExecutionMethod.POST
ExecutionMethod.GET
)

return JSON.parse(data.responseBody)
Expand Down

0 comments on commit c01c32b

Please sign in to comment.