1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

added notes

This commit is contained in:
Fedor Katurov 2022-04-04 15:00:33 +07:00
parent 592284f438
commit fce11163aa
9 changed files with 138 additions and 11 deletions

View file

@ -0,0 +1,24 @@
import React, { VFC } from 'react';
import { Card } from '~/components/containers/Card';
import { Markdown } from '~/components/containers/Markdown';
import { Padder } from '~/components/containers/Padder';
import { formatText, getPrettyDate } from '~/utils/dom';
import styles from './styles.module.scss';
interface NoteCardProps {
content: string;
createdAt: string;
}
const NoteCard: VFC<NoteCardProps> = ({ content, createdAt }) => (
<Card className={styles.note}>
<Padder>
<Markdown className={styles.wrap} dangerouslySetInnerHTML={{ __html: formatText(content) }} />
</Padder>
<Padder className={styles.footer}>{getPrettyDate(createdAt)}</Padder>
</Card>
);
export { NoteCard };

View file

@ -0,0 +1,18 @@
@import "src/styles/variables";
@import "src/styles/mixins";
.note {
min-width: 0;
word-break: break-word;
padding: 0;
& > * {
@include row_shadow;
}
}
.footer {
font: $font_12_regular;
text-align: right;
opacity: 0.5;
}