fix: remove "Don't fork the repo"-Button - fixes #5723 (#5872)

This commit is contained in:
Andi Pabst 2021-10-15 15:45:47 +02:00 committed by GitHub
parent ed3814af66
commit 05d89230dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 4 deletions

View File

@ -16,8 +16,9 @@ const ForkApprovalContainer = styled.div`
`;
const ForkButtonsContainer = styled.div`
display: flex;
flex-flow: row nowrap;
flex-flow: column nowrap;
justify-content: space-around;
align-items: center;
`;
export default class GitHubAuthenticationPage extends React.Component {
@ -109,7 +110,7 @@ export default class GitHubAuthenticationPage extends React.Component {
if (requestingFork) {
const { approveFork, refuseFork } = this.state;
return {
renderPageContent: ({ LoginButton }) => (
renderPageContent: ({ LoginButton, TextButton, showAbortButton }) => (
<ForkApprovalContainer>
<p>
Open Authoring is enabled: we need to use a fork on your github account. (If a fork
@ -117,7 +118,9 @@ export default class GitHubAuthenticationPage extends React.Component {
</p>
<ForkButtonsContainer>
<LoginButton onClick={approveFork}>Fork the repo</LoginButton>
<LoginButton onClick={refuseFork}>Don&#39;t fork the repo</LoginButton>
{showAbortButton && (
<TextButton onClick={refuseFork}>Don&#39;t fork the repo</TextButton>
)}
</ForkButtonsContainer>
</ForkApprovalContainer>
),

View File

@ -62,6 +62,17 @@ const LoginButton = styled.button`
position: relative;
`;
const TextButton = styled.button`
${buttons.button};
${buttons.default};
${buttons.grayText};
margin-top: 40px;
display: flex;
align-items: center;
position: relative;
`;
function AuthenticationPage({
onLogin,
loginDisabled,
@ -76,7 +87,9 @@ function AuthenticationPage({
<StyledAuthenticationPage>
{renderPageLogo(logoUrl)}
{loginErrorMessage ? <p>{loginErrorMessage}</p> : null}
{!renderPageContent ? null : renderPageContent({ LoginButton })}
{!renderPageContent
? null
: renderPageContent({ LoginButton, TextButton, showAbortButton: !siteUrl })}
{!renderButtonContent ? null : (
<LoginButton disabled={loginDisabled} onClick={onLogin}>
{renderButtonContent()}