This repository has been archived by the owner on Jan 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #336 from ecency/development
fixes to production
- Loading branch information
Showing
76 changed files
with
1,703 additions
and
963 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,64 @@ | ||
import React, { Component } from "react"; | ||
import React, {Component} from "react"; | ||
|
||
import {History} from "history"; | ||
|
||
import {Link} from "react-router-dom"; | ||
|
||
import { Link } from "react-router-dom"; | ||
import Meta from "../meta"; | ||
|
||
const logoCircle = require("../../img/logo-circle.svg"); | ||
|
||
export default class NotFound extends Component { | ||
render() { | ||
const metaProps = { | ||
title: "404", | ||
interface Props { | ||
history: History; | ||
} | ||
|
||
export class NotFound extends Component<Props> { | ||
goBack = () => { | ||
const {history} = this.props; | ||
|
||
history.goBack(); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Meta {...metaProps} /> | ||
<div className="not-found-404"> | ||
<img src={logoCircle} className="logo" /> | ||
<h1>This page doesn't exist.</h1> | ||
<p className="links"> | ||
<Link to="/">Home</Link> | ||
<Link to="/created">New posts</Link> | ||
<Link to="/hot">Hot posts</Link> | ||
<Link to="/trending">Trending posts</Link> | ||
</p> | ||
</div> | ||
</> | ||
); | ||
} | ||
render() { | ||
const metaProps = { | ||
title: "404", | ||
}; | ||
|
||
const {history} = this.props; | ||
|
||
// @ts-ignore make ide happy. code compiles without error. | ||
const entries = history.entries || {} | ||
// @ts-ignore | ||
const index = history.index || 0; | ||
|
||
const canGoBack = !!entries[index - 1]; | ||
|
||
return ( | ||
<> | ||
<Meta {...metaProps} /> | ||
<div className="not-found-404"> | ||
<img src={logoCircle} className="logo" alt="Ecency"/> | ||
<h1>This page doesn't exist.</h1> | ||
<p className="links"> | ||
{canGoBack && <a href="#" onClick={(e) => { | ||
e.preventDefault(); | ||
this.goBack(); | ||
}}>Back</a>} | ||
<Link to="/">Home</Link> | ||
<Link to="/created">New posts</Link> | ||
<Link to="/hot">Hot posts</Link> | ||
<Link to="/trending">Trending posts</Link> | ||
</p> | ||
</div> | ||
</> | ||
); | ||
} | ||
} | ||
|
||
export default (p: Props) => { | ||
const props = { | ||
history: p.history | ||
} | ||
|
||
return <NotFound {...props}/> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.