Skip to content
This repository was archived by the owner on May 11, 2020. It is now read-only.

Commit 0c0e283

Browse files
author
Yurii Tokarskyi
committed
Added links to LemonUnit page and project GitHub page
1 parent f0a65cd commit 0c0e283

File tree

7 files changed

+94
-4
lines changed

7 files changed

+94
-4
lines changed

public/lemonunit-logo.png

6.36 KB
Loading

src/App.css

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
.Editor {
88
width: 100vw;
9-
height: calc(100vh - 64px);
9+
height: calc(100vh - 64px - 30px);
1010
overflow: auto;
1111
}
1212

@@ -43,4 +43,38 @@
4343
.ConfigBar .ConfigBarWidgetLabel {
4444
padding-right: 10px;
4545
color: #777;
46+
}
47+
48+
.Footer {
49+
height: 30px;
50+
line-height: 30px;
51+
padding: 0 10px;
52+
background: #fff;
53+
font-size: 13px;
54+
border-top: 1px solid #e8e8e8;
55+
}
56+
57+
.GitHubIcon {
58+
color: #ccc;
59+
font-size: 20px;
60+
}
61+
62+
.GitHubIcon:hover {
63+
color: #333;
64+
}
65+
66+
.LemonUnitIcon {
67+
position: relative;
68+
}
69+
70+
.LemonUnitIcon img {
71+
top: -1px;
72+
position: relative;
73+
height: 24px;
74+
opacity: 0.4;
75+
transition: opacity 0.4s ease-out;
76+
}
77+
78+
.LemonUnitIcon:hover img {
79+
opacity: 1;
4680
}

src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React, { Component } from "react";
22

33
import { Navigation } from "./components/Navigation";
4+
import { Footer } from "./components/Footer";
5+
46
import { SourceItems } from "./editors/types";
57
import { CSVEditor } from "./editors/CSVEditor";
68
import { JSONEditor } from "./editors/JSONEditor";
@@ -55,6 +57,7 @@ export class App extends Component<AppProps, AppState> {
5557
source={this.state.source}
5658
/>
5759
</main>
60+
<Footer />
5861
</div>
5962
)
6063
}

src/components/Footer.tsx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import React, { Component } from "react";
2+
import { Icon, Row, Col } from "antd";
3+
4+
interface Props { }
5+
interface State { }
6+
7+
export const FOOTER_HEIGHT = 30;
8+
9+
export class Footer extends Component<Props, State> {
10+
renderGithubLink = () => {
11+
return (
12+
<a
13+
href="https://github.com/LemonUnit/csv-editor-online"
14+
target="_blank"
15+
className="GitHubIcon"
16+
title="Go to CSV Editor Online page on GitHub"
17+
>
18+
<Icon type="github" />
19+
</a>
20+
21+
);
22+
}
23+
24+
renderLemonUnitLink = () => {
25+
return (
26+
<a
27+
href="https://lemonunit.com/"
28+
target="_blank"
29+
className="LemonUnitIcon"
30+
title="Go to LemonUnit home page"
31+
>
32+
<img src="lemonunit-logo.png" alt="LemonUnit logo" />
33+
</a>
34+
);
35+
}
36+
37+
render() {
38+
return (
39+
<footer className="Footer">
40+
<Row>
41+
<Col span={12}>
42+
{this.renderLemonUnitLink()}
43+
</Col>
44+
<Col span={12} style={{ textAlign: 'right' }}>
45+
{this.renderGithubLink()}
46+
</Col>
47+
</Row>
48+
</footer>
49+
)
50+
}
51+
}

src/components/Navigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from "react";
2-
import { Layout, Menu } from "antd";
2+
import { Layout, Menu, Icon } from "antd";
33

44
import { EditorMode } from "../App";
55

src/editors/CSVEditor.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import "brace/mode/json";
1111

1212
import { EditorProps } from "./types";
1313
import { NAVIGATION_HEIGHT, CONFIG_BAR_HEIGHT } from "../components/Navigation";
14+
import { FOOTER_HEIGHT } from "../components/Footer";
1415

1516
enum CSVDelimiter {
1617
SEMICOLON = ";",
@@ -54,7 +55,7 @@ export class CSVEditor extends Component<Props, State> {
5455
}
5556

5657
updateEditorHeight = () => this.setState({
57-
editorHeight: window.innerHeight - NAVIGATION_HEIGHT - CONFIG_BAR_HEIGHT
58+
editorHeight: window.innerHeight - NAVIGATION_HEIGHT - FOOTER_HEIGHT - CONFIG_BAR_HEIGHT
5859
})
5960

6061
parseSourceItemsToCsv = () => this.setState({

src/editors/JSONEditor.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import "brace/mode/json";
77

88
import { EditorProps } from "./types";
99
import { NAVIGATION_HEIGHT } from "../components/Navigation";
10+
import { FOOTER_HEIGHT } from "../components/Footer";
1011

1112
interface Props extends EditorProps { }
1213

@@ -37,7 +38,7 @@ export class JSONEditor extends Component<Props, State> {
3738
}
3839

3940
updateEditorHeight = () => this.setState({
40-
editorHeight: window.innerHeight - NAVIGATION_HEIGHT
41+
editorHeight: window.innerHeight - FOOTER_HEIGHT - NAVIGATION_HEIGHT
4142
})
4243

4344
parseSourceItemsToJson = () => this.setState({

0 commit comments

Comments
 (0)