mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
add user notifications (#148)
* added notification settings * notifications: added list to profile * notifications: changed appearance for comment notifications
This commit is contained in:
parent
23701a5261
commit
a39d000ff2
27 changed files with 552 additions and 218 deletions
43
src/components/notifications/NotificationComment/index.tsx
Normal file
43
src/components/notifications/NotificationComment/index.tsx
Normal file
|
@ -0,0 +1,43 @@
|
|||
import { FC } from 'react';
|
||||
|
||||
import { Anchor } from '~/components/common/Anchor';
|
||||
import { InlineUsername } from '~/components/common/InlineUsername';
|
||||
import { Square } from '~/components/common/Square';
|
||||
import { NotificationItem } from '~/types/notifications';
|
||||
import { formatText, getPrettyDate, getURLFromString } from '~/utils/dom';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
interface NotificationCommentProps {
|
||||
item: NotificationItem;
|
||||
}
|
||||
|
||||
const NotificationComment: FC<NotificationCommentProps> = ({ item }) => (
|
||||
<Anchor href={item.url} className={styles.link}>
|
||||
<div className={styles.message}>
|
||||
<div className={styles.icon}>
|
||||
<Square
|
||||
image={getURLFromString(item.user.photo, 'avatar')}
|
||||
className={styles.circle}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={styles.content}>
|
||||
<b className={styles.title}>
|
||||
<span>
|
||||
<InlineUsername>{item.user.username}</InlineUsername>:
|
||||
</span>
|
||||
</b>
|
||||
<div className={styles.text}>
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: formatText(item.text),
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Anchor>
|
||||
);
|
||||
|
||||
export { NotificationComment };
|
Loading…
Add table
Add a link
Reference in a new issue