Skip to content

Commit

Permalink
clearer widget deletion + post edit button (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel-Therrien-Beslogic authored Nov 27, 2024
1 parent 0c6a783 commit 3337629
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions canopeum_frontend/src/components/social/PostCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useContext, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Dropdown, Popover } from 'rsuite'
import DropdownMenu from 'rsuite/esm/Dropdown/DropdownMenu'
import type { OverlayTriggerHandle } from 'rsuite/esm/internals/Picker'
Expand All @@ -23,6 +24,7 @@ type Props = {
}

const PostCard = ({ post, deletePost }: Props) => {
const { t } = useTranslation()
const { formatDate } = useContext(LanguageContext)
const { toggleLike } = usePostsStore()
const { getApiClient } = useApiClient()
Expand Down Expand Up @@ -72,10 +74,13 @@ const PostCard = ({ post, deletePost }: Props) => {
style={{ width: 'fit-content' }}
>
<DropdownMenu>
<Dropdown.Item onClick={() => setConfirmPostDeleteOpen(true)}>
<div className='d-flex gap-2'>
<span className='material-symbols-outlined text-danger'>delete</span>
</div>
<Dropdown.Item>
<span className='material-symbols-outlined align-middle'>edit_square</span>{' '}
{t('generic.edit')} (Not yet implemented)
</Dropdown.Item>
<Dropdown.Item className='' onClick={() => setConfirmPostDeleteOpen(true)}>
<span className='material-symbols-outlined align-middle text-danger'>delete</span>
<span className='text-danger'>{' '}{t('generic.delete')}</span>
</Dropdown.Item>
</DropdownMenu>
</Popover>
Expand Down
2 changes: 1 addition & 1 deletion canopeum_frontend/src/components/social/WidgetDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const WidgetDialog = ({ handleClose, open }: Props) => {
onClick={() => handleClose('delete', innerWidget)}
type='button'
>
<span className='material-symbols-outlined text-primary'>cancel</span>
<span className='material-symbols-outlined text-danger'>delete</span>
</button>
)}
</div>
Expand Down

0 comments on commit 3337629

Please sign in to comment.