Revize ac59aec1
Přidáno uživatelem Dominik Poch před asi 3 roky(ů)
webapp/components/annotation/annotationPanel.tsx | ||
---|---|---|
1 |
/** |
|
2 |
* Creates a panel in the annotation screen that contains a list of annotations. |
|
3 |
* @returns Panel with a list of annotations. |
|
4 |
*/ |
|
5 |
function AnnotationPanel() { |
|
6 |
return ( |
|
7 |
<div> |
|
8 |
<p>Panel with a list of annotations</p> |
|
9 |
</div> |
|
10 |
); |
|
11 |
} |
|
12 |
|
|
13 |
export default AnnotationPanel; |
webapp/components/annotation/documentAnnotationView.tsx | ||
---|---|---|
1 |
/** |
|
2 |
* Creates an annotation view of a document. |
|
3 |
* @returns The annotation view. |
|
4 |
*/ |
|
5 |
function DocumentAnnotationView() { |
|
6 |
return ( |
|
7 |
<div> |
|
8 |
<p>Main view with a rendered document</p> |
|
9 |
</div> |
|
10 |
); |
|
11 |
} |
|
12 |
|
|
13 |
export default DocumentAnnotationView; |
webapp/components/annotation/tagPanel.tsx | ||
---|---|---|
1 |
/** |
|
2 |
* Creates a panel in the annotation screen that contains a list of tag. |
|
3 |
* @returns Panel with a list of tags. |
|
4 |
*/ |
|
5 |
function TagPanel() { |
|
6 |
return ( |
|
7 |
<div> |
|
8 |
<p>Panel with a list of tags</p> |
|
9 |
</div> |
|
10 |
); |
|
11 |
} |
|
12 |
|
|
13 |
export default TagPanel; |
webapp/components/navigation/userNavBar.tsx | ||
---|---|---|
1 |
/** |
|
2 |
* Creates a navigation bar of a normal user (annotator). |
|
3 |
* @returns Navigation bar of a user. |
|
4 |
*/ |
|
5 |
function UserNavBar() { |
|
6 |
return ( |
|
7 |
<div> |
|
8 |
<p>Navigation bar of a normal user.</p> |
|
9 |
</div> |
|
10 |
); |
|
11 |
} |
|
12 |
|
|
13 |
export default UserNavBar; |
webapp/layouts/annotationLayout.tsx | ||
---|---|---|
1 |
import { Layout } from 'antd'; |
|
2 |
import AnnotationPanel from '../components/annotation/annotationPanel'; |
|
3 |
import DocumentAnnotationView from '../components/annotation/documentAnnotationView'; |
|
4 |
import TagPanel from '../components/annotation/tagPanel'; |
|
5 |
import 'antd/dist/antd.css'; |
|
6 |
import styles from '/styles/annotation.module.scss'; |
|
7 |
import UserNavBar from '../components/navigation/userNavBar'; |
|
8 |
|
|
9 |
const { Header, Content, Footer, Sider } = Layout; |
|
10 |
|
|
11 |
/** |
|
12 |
* Creates a layout of a document annotation screen. It contains a panel with a list of tags and a panel with a list of annotations. |
|
13 |
* @returns Annotation layout. |
|
14 |
*/ |
|
15 |
function AnnotationLayout() { |
|
16 |
return ( |
|
17 |
<Layout> |
|
18 |
<Header> |
|
19 |
<UserNavBar /> |
|
20 |
</Header> |
|
21 |
<Layout hasSider> |
|
22 |
<Sider className={styles.leftSidePanel}> |
|
23 |
<TagPanel /> |
|
24 |
</Sider> |
|
25 |
<Content className={styles.mainView}> |
|
26 |
<DocumentAnnotationView /> |
|
27 |
</Content> |
|
28 |
<Sider className={styles.rightSidePanel}> |
|
29 |
<AnnotationPanel /> |
|
30 |
</Sider> |
|
31 |
</Layout> |
|
32 |
<Footer></Footer> |
|
33 |
</Layout> |
|
34 |
); |
|
35 |
} |
|
36 |
|
|
37 |
export default AnnotationLayout; |
webapp/pages/annotation.tsx | ||
---|---|---|
1 |
import AnnotationLayout from '../layouts/annotationLayout'; |
|
2 |
|
|
3 |
/** |
|
4 |
* Creates an annotation screen. |
|
5 |
* @returns The annotation screen. |
|
6 |
*/ |
|
7 |
function Annotation() { |
|
8 |
return <AnnotationLayout />; |
|
9 |
} |
|
10 |
|
|
11 |
export default Annotation; |
webapp/styles/annotation.module.scss | ||
---|---|---|
1 |
%lightBackground { |
|
2 |
background: white; |
|
3 |
} |
|
4 |
|
|
5 |
%sidePanel { |
|
6 |
@extend %lightBackground; |
|
7 |
overflow: auto; |
|
8 |
height: 100vh; |
|
9 |
position: sticky; |
|
10 |
top: 0; |
|
11 |
} |
|
12 |
|
|
13 |
.leftSidePanel { |
|
14 |
@extend %sidePanel; |
|
15 |
left: 0; |
|
16 |
} |
|
17 |
|
|
18 |
.rightSidePanel { |
|
19 |
@extend %sidePanel; |
|
20 |
right: 0; |
|
21 |
} |
|
22 |
|
|
23 |
.mainView { |
|
24 |
@extend %lightBackground; |
|
25 |
margin: 20px; |
|
26 |
} |
Také k dispozici: Unified diff
Created a layout of the annotation screen
Created a layout with empty panels. They will be done in other branches.