Skip to content

Commit

Permalink
various small fixes for problems with loading the faucet on a externa…
Browse files Browse the repository at this point in the history
…l site, include bootstrap js in bundle
  • Loading branch information
pk910 committed May 28, 2024
1 parent 13bff9b commit fecea13
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 13 deletions.
1 change: 1 addition & 0 deletions faucet-client/src/common/FaucetContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ export interface IFaucetContext {

showDialog(dialogProps: IFaucetDialogProps): number;
hideDialog(dialogId: number): void;
getContainer(): HTMLElement;

}
4 changes: 3 additions & 1 deletion faucet-client/src/components/FaucetPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ html.powfaucet, html.powfaucet body {

@import "../../node_modules/bootstrap/scss/functions";
@import "../../node_modules/bootstrap/scss/variables";
@import "../../node_modules/bootstrap/scss/variables-dark";
@import "../../node_modules/bootstrap/scss/maps";
@import "../../node_modules/bootstrap/scss/mixins";
@import "../../node_modules/bootstrap/scss/utilities";
Expand All @@ -37,7 +38,6 @@ html.powfaucet, html.powfaucet body {
@import "../../node_modules/bootstrap/scss/grid";
@import "../../node_modules/bootstrap/scss/tables";
@import "../../node_modules/bootstrap/scss/forms";

@import "../../node_modules/bootstrap/scss/buttons";
@import "../../node_modules/bootstrap/scss/transitions";
@import "../../node_modules/bootstrap/scss/dropdown";
Expand All @@ -51,6 +51,8 @@ html.powfaucet, html.powfaucet body {
@import "../../node_modules/bootstrap/scss/close";
@import "../../node_modules/bootstrap/scss/placeholders";
@import "../../node_modules/bootstrap/scss/helpers";
@import "../../node_modules/bootstrap/scss/utilities/api";

}

.faucet-loading .loading-spinner {
Expand Down
1 change: 1 addition & 0 deletions faucet-client/src/components/FaucetPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export class FaucetPage extends React.PureComponent<IFaucetPageProps, IFaucetPag
hideNotification: (notificationId: number) => this.hideNotification(notificationId),
showDialog: (dialogProps: IFaucetDialogProps) => this.showDialog(dialogProps),
hideDialog: (dialogId: number) => this.hideDialog(dialogId),
getContainer: () => this.faucetContainerElement,
};

this.state = {
Expand Down
1 change: 1 addition & 0 deletions faucet-client/src/components/claim/ClaimPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ export class ClaimPage extends React.PureComponent<IClaimPageProps, IClaimPageSt
<div className='col'>
<OverlayTrigger
placement="auto"
container={this.props.pageContext.getContainer()}
overlay={
<Tooltip>
{((this.state.sessionStatus.claimIdx || 0) - (this.state.claimNotification?.processedIdx || 0) - 1)} claims will be processed before yours.
Expand Down
3 changes: 3 additions & 0 deletions faucet-client/src/components/frontpage/zupass/ZupassLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class ZupassLogin extends React.PureComponent<IZupassLoginProps, IZupassL
{this.props.faucetConfig.modules.zupass.infoHtml ?
<OverlayTrigger
placement="bottom"
container={this.props.faucetContext.getContainer()}
overlay={this.renderInfoHtml()}
>
<span className="zupass-info-icon">
Expand Down Expand Up @@ -121,6 +122,7 @@ export class ZupassLogin extends React.PureComponent<IZupassLoginProps, IZupassL
{this.props.faucetConfig.modules.zupass.infoHtml ?
<OverlayTrigger
placement="bottom"
container={this.props.faucetContext.getContainer()}
overlay={this.renderInfoHtml()}
>
<span className="zupass-info-icon">
Expand All @@ -142,6 +144,7 @@ export class ZupassLogin extends React.PureComponent<IZupassLoginProps, IZupassL
<OverlayTrigger
placement="bottom"
delay={{ show: 250, hide: 400 }}
container={this.props.faucetContext.getContainer()}
overlay={(props) => this.renderZupassTicketInfo(this.state.authInfo, props)}
>
<span className="auth-ident-truncated">{this.state.authInfo.attendeeId}</span>
Expand Down
1 change: 1 addition & 0 deletions faucet-client/src/components/mining/PoWMinerStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export class PoWMinerStatus extends React.PureComponent<IPoWMinerStatusProps, IP
<div className='pow-progress-actions'>
<OverlayTrigger
placement="bottom"
container={this.props.pageContext.getContainer()}
overlay={
<Tooltip>
Stop animation for better performance
Expand Down
3 changes: 3 additions & 0 deletions faucet-client/src/components/passport/PassportInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export class PassportInfo extends React.PureComponent<IPassportInfoProps, IPassp
(Reward Factor: {this.state.passportInfo.score.factor || 1}
<OverlayTrigger
placement="bottom"
container={this.props.pageContext.getContainer()}
overlay={
<Tooltip>
{this.renderFactorInfo()}
Expand Down Expand Up @@ -250,6 +251,7 @@ export class PassportInfo extends React.PureComponent<IPassportInfoProps, IPassp
{stamp.expiration <= now ?
<OverlayTrigger
placement="bottom"
container={this.props.pageContext.getContainer()}
overlay={
<Tooltip>
This stamp has been expired. Please refresh it on passport.gitcoin.co
Expand All @@ -262,6 +264,7 @@ export class PassportInfo extends React.PureComponent<IPassportInfoProps, IPassp
{stamp.duplicate ?
<OverlayTrigger
placement="bottom"
container={this.props.pageContext.getContainer()}
overlay={
<Tooltip>
This stamp has already been used in the passport for {stamp.duplicate}
Expand Down
1 change: 1 addition & 0 deletions faucet-client/src/components/shared/FaucetDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { ReactElement } from 'react';
import { Button, Modal } from 'react-bootstrap';
import 'bootstrap/js/dist/modal';

export interface IFaucetDialogProps {
title: string;
Expand Down
7 changes: 4 additions & 3 deletions faucet-client/src/components/status/FaucetStatus.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@
min-width: 50px;
}

.faucet-page .status-sessions td, .pow-faucet .status-sessions th {
.faucet-page .faucet-status .status-sessions td,
.faucet-page .faucet-status .status-sessions th {
padding: 0 12px;
}

.faucet-page .status-general {
.faucet-page .faucet-status .status-general {
max-width: none;
}

.faucet-page .status-general .status-title {
.faucet-page .faucet-status .status-general .status-title {
display: inline-block;
width: 180px;
}
4 changes: 4 additions & 0 deletions faucet-client/src/components/status/FaucetStatusPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ export class FaucetStatusPage extends React.PureComponent<IFaucetStatusPageProps
<OverlayTrigger
placement="auto"
delay={{ show: 250, hide: 400 }}
container={this.props.pageContext.getContainer()}
overlay={(props) => this.renderRestrictionInfo(session, props)}
>
<span key="limit" className={["badge", restrClass].join(" ")}>{session.restr.reward} %</span>
Expand All @@ -305,6 +306,7 @@ export class FaucetStatusPage extends React.PureComponent<IFaucetStatusPageProps
<OverlayTrigger
placement="auto"
delay={{ show: 250, hide: 400 }}
container={this.props.pageContext.getContainer()}
overlay={(props) => this.renderFactorInfo(session, props)}
>
<span key="factor" className={["badge", "bg-info"].join(" ")}>x{Math.round(totalFactor * 100) / 100}</span>
Expand All @@ -319,6 +321,7 @@ export class FaucetStatusPage extends React.PureComponent<IFaucetStatusPageProps
<OverlayTrigger
placement="right"
delay={{ show: 250, hide: 400 }}
container={this.props.pageContext.getContainer()}
overlay={(props) => this.renderSessionIpInfo(session, props)}
>
<span className='ipaddr'>
Expand Down Expand Up @@ -491,6 +494,7 @@ export class FaucetStatusPage extends React.PureComponent<IFaucetStatusPageProps
claimStatus = <OverlayTrigger
placement="left"
delay={{ show: 250, hide: 400 }}
container={this.props.pageContext.getContainer()}
overlay={(props) => this.renderClaimFailInfo(claim, props)}
>
<span className="badge bg-danger">Failed</span>
Expand Down
1 change: 1 addition & 0 deletions faucet-client/src/components/status/QueueStatusPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class QueueStatusPage extends React.PureComponent<IQueueStatusPageProps,
claimStatus = <OverlayTrigger
placement="left"
delay={{ show: 250, hide: 400 }}
container={this.props.pageContext.getContainer()}
overlay={(props) => this.renderClaimFailInfo(claim, props)}
>
<span className="badge bg-danger">Failed</span>
Expand Down
1 change: 0 additions & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
</div>
</div>
<a href="https://github.com/pk910/PoWFaucet" class="github-fork-ribbon fixed" title="Fork me on GitHub" data-ribbon="Fork me on GitHub" target="_blank">Fork me on GitHub</a>
<script src="/js/bootstrap.bundle.min.js"></script>
<script src="/js/powfaucet.js"></script>
</body>
</html>
7 changes: 0 additions & 7 deletions static/js/bootstrap.bundle.min.js

This file was deleted.

1 change: 0 additions & 1 deletion static/js/bootstrap.bundle.min.js.map

This file was deleted.

0 comments on commit fecea13

Please sign in to comment.