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

added notes menu

This commit is contained in:
Fedor Katurov 2022-04-04 15:51:05 +07:00
parent fce11163aa
commit 57f37723fa
14 changed files with 203 additions and 105 deletions

View file

@ -2,6 +2,7 @@ import React, { FC } from 'react';
import Masonry from 'react-masonry-css';
import { Columns } from '~/components/containers/Columns';
import { InfiniteScroll } from '~/components/containers/InfiniteScroll';
import { LabNoResults } from '~/components/lab/LabNoResults';
import { LabNode } from '~/components/lab/LabNode';
@ -35,11 +36,7 @@ const LabGrid: FC<IProps> = () => {
if (isLoading) {
return (
<Masonry
className={styles.wrap}
breakpointCols={breakpointCols}
columnClassName={styles.column}
>
<Columns>
<LoadingNode />
<LoadingNode />
<LoadingNode />
@ -49,7 +46,7 @@ const LabGrid: FC<IProps> = () => {
<LoadingNode />
<LoadingNode />
<LoadingNode />
</Masonry>
</Columns>
);
}
@ -59,11 +56,7 @@ const LabGrid: FC<IProps> = () => {
return (
<InfiniteScroll hasMore={hasMore} loadMore={loadMore}>
<Masonry
className={styles.wrap}
breakpointCols={breakpointCols}
columnClassName={styles.column}
>
<Columns>
{nodes.map(node => (
<LabNode
node={node.node}
@ -72,7 +65,7 @@ const LabGrid: FC<IProps> = () => {
commentCount={node.comment_count}
/>
))}
</Masonry>
</Columns>
</InfiniteScroll>
);
};

View file

@ -1,26 +0,0 @@
@import "src/styles/variables.scss";
div.wrap {
display: flex;
width: 100%;
margin-right: 0;
@include tablet {
padding: 0 $gap * 0.5;
}
}
.column {
background-clip: padding-box;
box-sizing: border-box;
padding: 0 $gap * 0.5;
margin-top: -$gap * 0.5;
@include tablet {
padding: 0;
}
& > div {
margin-bottom: $gap;
}
}

View file

@ -3,6 +3,7 @@ import React, { useState, VFC } from 'react';
import Masonry from 'react-masonry-css';
import { Card } from '~/components/containers/Card';
import { Columns } from '~/components/containers/Columns';
import { Filler } from '~/components/containers/Filler';
import { Group } from '~/components/containers/Group';
import { Markdown } from '~/components/containers/Markdown';
@ -20,11 +21,6 @@ import styles from './styles.module.scss';
interface SettingsNotesProps {}
const breakpointCols = {
default: 2,
1280: 1,
};
const SettingsNotes: VFC<SettingsNotesProps> = () => {
const [text, setText] = useState('');
const { notes } = useGetNotes('');
@ -44,11 +40,7 @@ const SettingsNotes: VFC<SettingsNotesProps> = () => {
</Group>
</Padder>
<Masonry
className={styles.wrap}
breakpointCols={breakpointCols}
columnClassName={styles.column}
>
<Columns>
<Card>
<Group>
<Textarea handler={setText} value={text} />
@ -63,7 +55,7 @@ const SettingsNotes: VFC<SettingsNotesProps> = () => {
{notes.map(note => (
<NoteCard key={note.id} content={note.content} createdAt={note.created_at} />
))}
</Masonry>
</Columns>
</div>
);
};

View file

@ -1,27 +0,0 @@
@import "src/styles/variables";
@import "src/styles/mixins";
div.wrap {
display: flex;
width: 100%;
margin-right: 0;
padding: $gap $gap * 0.5;
@include tablet {
padding: 0 $gap * 0.5;
}
}
.column {
background-clip: padding-box;
box-sizing: border-box;
padding: 0 $gap * 0.5;
@include tablet {
padding: 0;
}
& > div {
margin-bottom: $gap;
}
}