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 }) {
|
||||
const { post, onGoHome } = props;
|
||||
function PostPage(props: { post: PostCard }) {
|
||||
const { post } = props;
|
||||
const postBody = stripLeadingTitleHeading(post.body, post.title);
|
||||
|
||||
return (
|
||||
<section className="thread-view">
|
||||
<button type="button" className="back-link" onClick={onGoHome}>
|
||||
Back to home
|
||||
</button>
|
||||
|
||||
<article className="panel">
|
||||
<header className="thread-header">
|
||||
<h1>{post.title}</h1>
|
||||
|
|
@ -865,8 +861,8 @@ function HomeView(props: {
|
|||
);
|
||||
}
|
||||
|
||||
function SignInPage(props: { auth: AuthState; onGoHome: () => void }) {
|
||||
const { auth, onGoHome } = props;
|
||||
function SignInPage(props: { auth: AuthState }) {
|
||||
const { auth } = props;
|
||||
const query = new URLSearchParams(window.location.search);
|
||||
const error = query.get("error");
|
||||
const returnTo = query.get("return_to") || "/";
|
||||
|
|
@ -877,10 +873,6 @@ function SignInPage(props: { auth: AuthState; onGoHome: () => void }) {
|
|||
|
||||
return (
|
||||
<section className="signin-page">
|
||||
<button type="button" className="back-link" onClick={onGoHome}>
|
||||
Back
|
||||
</button>
|
||||
|
||||
<article className="panel signin-panel">
|
||||
<header className="thread-header">
|
||||
<h1>Sign in</h1>
|
||||
|
|
@ -1091,14 +1083,11 @@ function PostRouteView(
|
|||
return (
|
||||
<section className="page-message">
|
||||
<h1>Post not found.</h1>
|
||||
<button type="button" className="back-link" onClick={props.onGoHome}>
|
||||
Back to home
|
||||
</button>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
return <PostPage post={selectedPost} onGoHome={props.onGoHome} />;
|
||||
return <PostPage post={selectedPost} />;
|
||||
}
|
||||
|
||||
function LessonRouteView(
|
||||
|
|
@ -1198,7 +1187,7 @@ function DiscussionRouteView(props: AppContentProps & { discussionId: number })
|
|||
|
||||
function AppContent(props: AppContentProps) {
|
||||
if (isSignInRoute(props.pathname)) {
|
||||
return <SignInPage auth={props.data.auth} onGoHome={props.onGoHome} />;
|
||||
return <SignInPage auth={props.data.auth} />;
|
||||
}
|
||||
|
||||
if (isActivityRoute(props.pathname)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue