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

View File

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