Remove redundant home return buttons
This commit is contained in:
parent
0a9b052beb
commit
a7b0352d3c
1 changed files with 6 additions and 17 deletions
|
|
@ -679,16 +679,12 @@ function LessonPage(props: {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function PostPage(props: { post: PostCard; onGoHome: () => void }) {
|
function PostPage(props: { post: PostCard }) {
|
||||||
const { post, onGoHome } = props;
|
const { post } = props;
|
||||||
const postBody = stripLeadingTitleHeading(post.body, post.title);
|
const postBody = stripLeadingTitleHeading(post.body, post.title);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="thread-view">
|
<section className="thread-view">
|
||||||
<button type="button" className="back-link" onClick={onGoHome}>
|
|
||||||
Back to home
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<article className="panel">
|
<article className="panel">
|
||||||
<header className="thread-header">
|
<header className="thread-header">
|
||||||
<h1>{post.title}</h1>
|
<h1>{post.title}</h1>
|
||||||
|
|
@ -865,8 +861,8 @@ function HomeView(props: {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function SignInPage(props: { auth: AuthState; onGoHome: () => void }) {
|
function SignInPage(props: { auth: AuthState }) {
|
||||||
const { auth, onGoHome } = props;
|
const { auth } = props;
|
||||||
const query = new URLSearchParams(window.location.search);
|
const query = new URLSearchParams(window.location.search);
|
||||||
const error = query.get("error");
|
const error = query.get("error");
|
||||||
const returnTo = query.get("return_to") || "/";
|
const returnTo = query.get("return_to") || "/";
|
||||||
|
|
@ -877,10 +873,6 @@ function SignInPage(props: { auth: AuthState; onGoHome: () => void }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="signin-page">
|
<section className="signin-page">
|
||||||
<button type="button" className="back-link" onClick={onGoHome}>
|
|
||||||
Back
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<article className="panel signin-panel">
|
<article className="panel signin-panel">
|
||||||
<header className="thread-header">
|
<header className="thread-header">
|
||||||
<h1>Sign in</h1>
|
<h1>Sign in</h1>
|
||||||
|
|
@ -1091,14 +1083,11 @@ function PostRouteView(
|
||||||
return (
|
return (
|
||||||
<section className="page-message">
|
<section className="page-message">
|
||||||
<h1>Post not found.</h1>
|
<h1>Post not found.</h1>
|
||||||
<button type="button" className="back-link" onClick={props.onGoHome}>
|
|
||||||
Back to home
|
|
||||||
</button>
|
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return <PostPage post={selectedPost} onGoHome={props.onGoHome} />;
|
return <PostPage post={selectedPost} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
function LessonRouteView(
|
function LessonRouteView(
|
||||||
|
|
@ -1198,7 +1187,7 @@ function DiscussionRouteView(props: AppContentProps & { discussionId: number })
|
||||||
|
|
||||||
function AppContent(props: AppContentProps) {
|
function AppContent(props: AppContentProps) {
|
||||||
if (isSignInRoute(props.pathname)) {
|
if (isSignInRoute(props.pathname)) {
|
||||||
return <SignInPage auth={props.data.auth} onGoHome={props.onGoHome} />;
|
return <SignInPage auth={props.data.auth} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isActivityRoute(props.pathname)) {
|
if (isActivityRoute(props.pathname)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue