Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "gitcom-front",
"version": "0.10.0",
"version": "0.11.0",
"private": true,
"dependencies": {
"@azure/ms-rest-js": "^2.0.1",
"@azure/ms-rest-js": "^2.0.5",
"@types/jest": "24.0.15",
"@types/node": "12.0.8",
"@types/react": "16.8.20",
"@types/react-dom": "16.8.4",
"@types/react-facebook-login": "^4.1.0",
"@types/react-router-dom": "^4.3.4",
"antd": "^3.19.5",
"antd": "^3.26.6",
"autorest": "^2.0.4283",
"copy-to-clipboard": "^3.2.0",
"moment": "^2.24.0",
Expand Down
Binary file added public/img/quickstart/screenshot_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/quickstart/screenshot_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 50 additions & 20 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,57 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<head>
<meta charset="utf-8"/>
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="description" content="Support open source and earn rewards, it's a new way to look at open source">
<meta name="keywords" content="open source, rewards, growth">
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<meta name="theme-color" content="#000000"/>
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"/>
<script src="https://momentjs.com/downloads/moment.min.js"></script>
<title>GitCom</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-153205738-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-153205738-1');
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<div id="fb-root"></div>
</body>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<div id="fb-root"></div>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-153205738-3"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-153205738-3');
</script>

<!-- Start of Async Drift Code -->
<script>
"use strict";

!function () {
var t = window.driftt = window.drift = window.driftt || [];
if (!t.init) {
if (t.invoked) return void (window.console && console.error && console.error("Drift snippet included twice."));
t.invoked = !0, t.methods = ["identify", "config", "track", "reset", "debug", "show", "ping", "page", "hide", "off", "on"],
t.factory = function (e) {
return function () {
var n = Array.prototype.slice.call(arguments);
return n.unshift(e), t.push(n), t;
};
}, t.methods.forEach(function (e) {
t[e] = t.factory(e);
}), t.load = function (t) {
var e = 3e5, n = Math.ceil(new Date() / e) * e, o = document.createElement("script");
o.type = "text/javascript", o.async = !0, o.crossorigin = "anonymous", o.src = "https://js.driftt.com/include/" + n + "/" + t + ".js";
var i = document.getElementsByTagName("script")[0];
i.parentNode.insertBefore(o, i);
};
}
}();
drift.SNIPPET_VERSION = '0.3.1';
drift.load('kmcg4ky4chmh');
</script>
<!-- End of Async Drift Code -->
</body>
</html>
5 changes: 5 additions & 0 deletions src/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import NotFoundLayout from "./layouts/404/NotFoundLayout";
import HelpLayout from "./layouts/help/HelpLayout";
import EditProjectPricingLayout from "./layouts/entity/project/pricing/edit/EditProjectPricingLayout";
import WithdrawalsLayout from "./layouts/account/withdrawals/WithdrawalsLayout";
import DeveloperQuickstartLayout from "./layouts/quickstart/developer/DeveloperQuickstartLayout";

class Routes extends React.Component {
render() {
Expand Down Expand Up @@ -52,6 +53,10 @@ class Routes extends React.Component {

<Route path="/external/:serviceType/repositories" exact component={ExternalRepoLayout}/>

{/* Quickstart pages */}

<Route path="/quickstart/developer" exact component={DeveloperQuickstartLayout}/>

{/* External auth routes */}

<Route path="/auth/external/github/login" exact component={LoginWithGitHubLayout}/>
Expand Down
5 changes: 5 additions & 0 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ p, b {
padding: 0 25px;
}

.image-rounded {
border-radius: 5px;
border: 2px solid gray;
}

@media only screen and (min-width: 767px) {
.desktop-zero-height {
height: 0;
Expand Down
11 changes: 10 additions & 1 deletion src/client/bindings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CurrencyType, CurrencyType1, CurrencyType3, EntityType} from "./models";
import {CurrencyType, CurrencyType1, CurrencyType3, EntityType, User} from "./models";

export class ProjectModel {
guid?: string;
Expand Down Expand Up @@ -156,3 +156,12 @@ export interface WithdrawalRequest {
paid?: boolean;
created_at?: string;
}

export interface Repository {
guid?: string;
creator?: User;
title?: string;
repo_url?: string;
origin_id?: string;
created_at?: string;
}
5 changes: 3 additions & 2 deletions src/components/entity/invoice/single/create/NewInvoice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class NewInvoice extends React.Component<IProps, IState> {
showInvoiceModal: false,

selectedCurrency: null,
currencyAmount: 0,
currencyAmount: this.props.defaultAmount,
isLoaded: false,
isButtonPressed: false,
invoice: null
Expand Down Expand Up @@ -134,6 +134,7 @@ class NewInvoice extends React.Component<IProps, IState> {
.then((result) =>
this.processPostInvoice(result._response))
.catch((error) => {
this.setState({isButtonPressed: false});
console.error(error);
this.handleApiError(error.response)
});
Expand Down Expand Up @@ -185,7 +186,7 @@ class NewInvoice extends React.Component<IProps, IState> {
footer={null}
>
<WarningBlock/>
{this.state.invoice ? <InvoiceContent invoice={this.state.invoice}/> : null}
{this.state.invoice ? <InvoiceContent invoice={this.state.invoice} showHelpLabel={true}/> : null}
</Modal>
<Modal
title={<b className="text-center">{this.props.modalLabel}</b>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ import {Button, Icon, notification, Row, Tag} from "antd";
import {handleApiError} from "../../../../../../classes/notification/errorHandler/errorHandler";
import copy from 'copy-to-clipboard';
import moment from "moment";
import {CurrencyType} from "../../../../../../client/models";

interface IProps {
invoice: InvoiceModel|null
invoice: InvoiceModel|null,
showHelpLabel: boolean
}

interface IState {
isLoaded: boolean,
invoice: InvoiceModel|null
invoice: InvoiceModel|null,
}

class InvoiceContent extends React.Component<IProps, IState> {
public static defaultProps = {
showHelpLabel: false,
invoice: null
};

Expand Down Expand Up @@ -65,6 +68,23 @@ class InvoiceContent extends React.Component<IProps, IState> {
});
}

getHelpLabel(currencyType: CurrencyType, amount: any = 0) {
switch (currencyType) {
case "Usd":
return `Please send ${amount} US$ to the PayPal email address provided below:`;
case "BitCoin":
case "Waves":
case "LiteCoin":
case "Ethereum":
return `Please send ${amount} ${currencyType} to the ${currencyType} address provided below:`;
case "Erc20Token":
return `Please send ${amount} Erc20 (Ethereum tokens) to the Ethereum address provided below:`;
case "WavesToken":
return `Please send ${amount} Erc20 (Ethereum tokens) to the Ethereum address provided below:`;
}
return "";
}

render() {
if (!this.state.isLoaded) {
return <Icon type="loading" style={{fontSize: "2em"}}/>;
Expand All @@ -91,6 +111,10 @@ class InvoiceContent extends React.Component<IProps, IState> {

return <div>
<Row className={"text-left"}>
{
this.props.showHelpLabel ?
<p>{this.getHelpLabel(invoice.currency_type!, invoice.amount!)}</p> : null
}
<b>Address: </b> {invoice.wallet!.address}
<Button
type="default" icon="copy" className="margin-sm-sides"
Expand Down
49 changes: 49 additions & 0 deletions src/components/external/repo/card/RepoCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from "react";
import {ProjectModel} from "../../../../client/bindings";
import {Button, Card, Icon, Row} from "antd";
import {handleApiError} from "../../../../classes/notification/errorHandler/errorHandler";

interface IProps {
project: ProjectModel,
}

interface IState {
isLoaded: boolean,
repository_url: string
}

class RepoCard extends React.Component<IProps, IState> {
constructor(props: IProps) {
super(props);
this.state = {
isLoaded: false,
repository_url: "#"
}
}

componentDidMount(): void {
window.App.apiClient.getRepo(this.props.project.repository_guid!)
.then((res) => {
let json = JSON.parse(res._response.bodyAsText);
console.log(json.data.repository);
this.setState({
isLoaded: true,
repository_url: json.data.repository.repo_url
});
})
.catch((error) => handleApiError(error.response));
}

render() {
return <Card>
<h3 className={"ant-typography"}><Icon type={"github"}/> Repository</h3>
<Row>
<a target="_blank" rel="noopener noreferrer" href={this.state.repository_url}>
<Button type={"default"}>View on GitHub</Button>
</a>
</Row>
</Card>
}
}

export default RepoCard;
26 changes: 25 additions & 1 deletion src/layouts/account/billing/BillingLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,29 @@ import WarningBlock from "../../../components/info/payment/WarningBlock/WarningB
import InvoiceCardsList from "../../../components/entity/invoice/many/Cards/InvoiceCardsList";
import {Row} from "antd";
import UserBalanceCard from "../../../components/entity/user_balance/single/card/UserBalanceCard";
import NewInvoice from "../../../components/entity/invoice/single/create/NewInvoice";

interface IProps {
}

interface IState {
isUserLoaded: boolean
}

class BillingLayout extends React.Component<IProps, IState> {
constructor(props: IProps) {
super(props);
this.state = {}
this.state = {
isUserLoaded: false
}
}

componentDidMount(): void {
setTimeout(() => {
this.setState({
isUserLoaded: window.App.authorizedUser !== null
});
},750);
}

render() {
Expand All @@ -25,6 +37,18 @@ class BillingLayout extends React.Component<IProps, IState> {

<UserBalanceCard/>

{
this.state.isUserLoaded ? <Row className="margin-sm-top">
<NewInvoice
modalLabel={"Deposit to my account"}
buttonLabel={"Deposit"}
defaultAmount={0.5}
entityGuid={window.App.authorizedUser!.guid!}
entityType={'User'}
/>
</Row> : null
}

<WarningBlock/>

<h4 className={"ant-typography"}>Active invoices</h4>
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/account/subscription/SubscriptionLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class SubscriptionLayout extends React.Component<IProps, IState> {
<UserSetting
settingName={"Subscription currency"}
settingKey={"subscription_currency"}
allowedValues={["BitCoin", "LiteCoin"]}
allowedValues={["Usd", "BitCoin", "Ethereum", "LiteCoin", "Waves"]}
type="select"
defaultValue={"string"}
/>
Expand Down
10 changes: 7 additions & 3 deletions src/layouts/app/AppLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Link } from 'react-router-dom';
import styles from './styles.module.css';
import {Icon, Layout, Menu, notification} from 'antd';
import {Button, Icon, Layout, Menu, notification} from 'antd';

const { Header, Footer } = Layout;

Expand All @@ -15,7 +15,11 @@ class AppLayout extends React.Component {
}

render() {
let loginOrHomeLink = <Menu.Item key="3"><Link to={"/login"}>Log in</Link></Menu.Item>;
let loginOrHomeLink = <Menu.Item key="3">
<Button type="primary">
<Link to={"/login"}>Sign in</Link>
</Button>
</Menu.Item>;

if (window.App.isAuthorized()) {
loginOrHomeLink = <Menu.Item key="3"><Link to={"/account/library"}><Icon type={"home"}/>Home</Link></Menu.Item>
Expand Down Expand Up @@ -47,7 +51,7 @@ class AppLayout extends React.Component {
{this.props.children}
</div>
<Footer style={{textAlign: 'center'}}>
GitCom <Icon type={"copyright"}/> 2019
GitCom <Icon type={"copyright"}/> 2019-2020
</Footer>
</Layout>
</div>
Expand Down
Loading