diff --git a/.gitignore b/.gitignore
index 99bfe65..10c5ff3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
node_modules
dist
.vscode
-npm-debug.log
\ No newline at end of file
+npm-debug.log
+yarn-error.log
\ No newline at end of file
diff --git a/dist/index.html b/dist/index.html
index 21b0a9f..188405f 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -1,4 +1,3 @@
-
@@ -11,6 +10,6 @@
-
+
\ No newline at end of file
diff --git a/package.json b/package.json
index 364ad4e..7a4117e 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"serve": "webpack-dev-server --output-public-path=dist --history-api-fallback",
- "build": "webpack"
+ "build": "webpack --optimize-minimize"
},
"author": "",
"license": "ISC",
@@ -20,6 +20,7 @@
"re-base": "^3.2.1",
"react": "^16.2.0",
"react-dom": "^16.2.0",
+ "react-markdown": "^3.1.3",
"react-redux": "^5.0.6",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
diff --git a/src/components/Conditional.tsx b/src/components/Conditional.tsx
index 875ed4c..1ccab85 100644
--- a/src/components/Conditional.tsx
+++ b/src/components/Conditional.tsx
@@ -2,7 +2,7 @@ import * as React from "react";
export class Conditional extends React.Component<{render:boolean}, any>{
render(){
- var toRender = this.props.render? this.props.children : null;
+ let toRender = this.props.render? this.props.children : null;
return {toRender}
}
}
\ No newline at end of file
diff --git a/src/components/Hello.tsx b/src/components/Hello.tsx
deleted file mode 100644
index e191454..0000000
--- a/src/components/Hello.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import * as React from "react";
-require('../styles/main.css');
-export interface HelloProps { compiler: string; framework: string; }
-
-// 'HelloProps' describes the shape of props.
-// State is never set so we use the '{}' type.
-export class Hello extends React.Component {
- render() {
- return (
-
-
Hello from {this.props.compiler} and {this.props.framework}!
-
- );
-
- }
-}
\ No newline at end of file
diff --git a/src/components/Home.tsx b/src/components/Home.tsx
new file mode 100644
index 0000000..04c62c4
--- /dev/null
+++ b/src/components/Home.tsx
@@ -0,0 +1,9 @@
+import { LoginState } from '../models/LoginState';
+import * as React from 'react';
+
+export class Home extends React.Component{
+
+ render(){
+ return
Hi, welcome to minbin a simple pastebin. Please login to get started!
+ }
+}
\ No newline at end of file
diff --git a/src/components/ListItem.tsx b/src/components/ListItem.tsx
new file mode 100644
index 0000000..25c0aaf
--- /dev/null
+++ b/src/components/ListItem.tsx
@@ -0,0 +1,15 @@
+import { Viewer } from './Viewer';
+import { getLanguage } from '../util/doc';
+import * as React from 'react';
+import {Document} from "../models/Document"
+import { Link } from "react-router-dom";
+export class ListItem extends React.PureComponent<{doc: Document, uid: string, docId: string}>{
+ render(){
+ return
+
+ {this.props.doc.Title || 'Untitled'}
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/components/NavBar.tsx b/src/components/NavBar.tsx
index eae0e57..0317f26 100644
--- a/src/components/NavBar.tsx
+++ b/src/components/NavBar.tsx
@@ -1,20 +1,30 @@
-import * as React from "react";
+import { LoginState } from '../models/LoginState';
+import * as React from 'react';
import { TabContent, TabPane, Nav, NavItem, NavLink, Card, Button, CardTitle, CardText, Row, Col, NavbarBrand, Navbar } from 'reactstrap';
+import { LoginContainer } from '../containers/Login';
+import { Link } from 'react-router-dom';
-export class NavBar extends React.Component {
+export class NavBar extends React.Component<{loginState: LoginState}, any> {
constructor(props: any) {
super(props);
}
render() {
+ let newButton = this.props.loginState.isLoggedIn ? (
+
+ + New
+
+ ) : null;
return (
minbin
+
diff --git a/src/components/Viewer.tsx b/src/components/Viewer.tsx
index 8c24393..c0c5f2a 100644
--- a/src/components/Viewer.tsx
+++ b/src/components/Viewer.tsx
@@ -1,35 +1,21 @@
-///
+///
import * as React from "react";
import { Row, Col, Card, CardText } from "reactstrap";
import SyntaxHighlighter from 'react-syntax-highlighter';
import googlecode from "react-syntax-highlighter/styles/hljs/googlecode";
-let exampleText = `
-void Main()
-{
- let next5Friday13 = DateTime.Today
- .Recurse(a=>a.AddDays(1))
- .Where(a=>a.Day == 13 && a.DayOfWeek == DayOfWeek.Friday).Take(5);
-
-}
-public static class Extension
-{
- public static IEnumerable Recurse(this T obj, Func action)
- {
- let local = obj;
- while(true)
- {
- local = action(local);
- yield return local;
- }
- }
-}
-`
-export interface ViewerProps {doc?: string, language?: string}
+
+export interface ViewerProps {doc?: string, language?: string, maxHeight?: string}
export class Viewer extends React.Component{
render(){
+ let style : React.CSSProperties = { paddingTop: "10px" };
+ if(this.props.maxHeight){
+ style.maxHeight = this.props.maxHeight
+ }
return(
-
- {this.props.doc || ''}
- );
+
+
+ {this.props.doc || ''}
+
+ );
}
}
\ No newline at end of file
diff --git a/src/containers/AppContainer.tsx b/src/containers/AppContainer.tsx
index c7b98ae..2acfd6b 100644
--- a/src/containers/AppContainer.tsx
+++ b/src/containers/AppContainer.tsx
@@ -1,3 +1,4 @@
+import { HomeContainer } from './HomeContainer';
import { LoginState } from '../models/LoginState';
import { Edit } from './Edit';
import { LoginContainer } from './Login';
@@ -18,15 +19,13 @@ const mapStateToProps = (state : AppState) : AppState =>
class appContainer extends React.Component{
render(){
return