Skip to content

Commit faa2de2

Browse files
authored
Merge pull request #47 from gitcomteam/feature/42-functional-footer
Feature/42 functional footer
2 parents 74409fa + a61d075 commit faa2de2

File tree

17 files changed

+662
-69
lines changed

17 files changed

+662
-69
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
# Gitcom frontend
1+
# GitCom Frontend
2+
3+
![CircleCI](https://img.shields.io/circleci/build/github/gitcomteam/gitcom-front/master)
4+
<a href="https://discord.gg/gRxPXPn">
5+
<img src="https://img.shields.io/discord/658128774679756820?logo=discord" alt="chat on Discord">
6+
</a>
7+
8+
This is the main frontend application hosted at [gitcom.org](https://gitcom.org)
9+
10+
### Brief description
11+
This platform can help:
12+
1. users: it will provide an easy way for users to support independent developers via subscription or donations and get rewards in return
13+
2. developers: help to earn from their open source projects via multiple monetization plans such as open-core, subscription, donations and so on.
14+
More details on [GitCom landing page](https://start.gitcom.org)
15+
16+
### Tech stack: :hammer_and_wrench:
17+
Project is built using [Create react app](https://github.com/facebook/create-react-app) & Typescript
18+
19+
### Contribution:
20+
Thank you for considering contributing to this repo, feel free to open a PR with any improvement, feature or bugfix.
21+
All **bugfixes** should go into [release/patch](https://github.com/gitcomteam/gitcom-front/tree/release/patch) branch
22+
All **new features** should go into [release/minor](https://github.com/gitcomteam/gitcom-front/tree/release/minor) branch
23+
All **breaking changes** should be in [release/major](https://github.com/gitcomteam/gitcom-front/tree/release/major) branch
24+
25+
### Contribution rewards
26+
For each merged PR you will be rewarded with `contributor` badge and 2500 (or more) GitCom tokens which are tradeable on [Waves Decentralized exchange](https://waves.exchange/dex-demo?assetId2=BkuYDLDunSy7dvep7NgQcmiY4iyqTq3diHwdGPrFUCMC&assetId1=WAVES) (You will need to have a Waves wallet to be able to receive tokens)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gitcom-front",
3-
"version": "0.10.0",
3+
"version": "0.11.0",
44
"private": true,
55
"dependencies": {
66
"@azure/ms-rest-js": "^2.0.5",

public/img/bg/index.jpg

219 KB
Loading

src/app.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ p, b {
135135
border: 2px solid gray;
136136
}
137137

138+
.text-white {
139+
color: white !important;
140+
}
141+
138142
@media only screen and (min-width: 767px) {
139143
.desktop-zero-height {
140144
height: 0;

src/client/models/index.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,20 @@ export interface PostRegisterOKResponse {
278278
data?: PostRegisterOKResponseData;
279279
}
280280

281+
/**
282+
* An interface representing PostLazyRegisterOKResponseData.
283+
*/
284+
export interface PostLazyRegisterOKResponseData {
285+
token?: string;
286+
}
287+
288+
/**
289+
* An interface representing PostLazyRegisterOKResponse.
290+
*/
291+
export interface PostLazyRegisterOKResponse {
292+
data?: PostLazyRegisterOKResponseData;
293+
}
294+
281295
/**
282296
* An interface representing PostConfirmEmailOKResponseData.
283297
*/
@@ -984,6 +998,20 @@ export interface PostWithdrawalRequestCreatedResponse {
984998
data?: PostWithdrawalRequestCreatedResponseData;
985999
}
9861000

1001+
/**
1002+
* An interface representing PostSubscribeToMailingListOKResponseData.
1003+
*/
1004+
export interface PostSubscribeToMailingListOKResponseData {
1005+
status?: string;
1006+
}
1007+
1008+
/**
1009+
* An interface representing PostSubscribeToMailingListOKResponse.
1010+
*/
1011+
export interface PostSubscribeToMailingListOKResponse {
1012+
data?: PostSubscribeToMailingListOKResponseData;
1013+
}
1014+
9871015
/**
9881016
* An interface representing SupportHubApiOptions.
9891017
*/
@@ -1230,6 +1258,26 @@ export type PostRegisterResponse = PostRegisterOKResponse & {
12301258
};
12311259
};
12321260

1261+
/**
1262+
* Contains response data for the postLazyRegister operation.
1263+
*/
1264+
export type PostLazyRegisterResponse = PostLazyRegisterOKResponse & {
1265+
/**
1266+
* The underlying HTTP response.
1267+
*/
1268+
_response: msRest.HttpResponse & {
1269+
/**
1270+
* The response body as text (string format)
1271+
*/
1272+
bodyAsText: string;
1273+
1274+
/**
1275+
* The response body as parsed JSON or XML
1276+
*/
1277+
parsedBody: PostLazyRegisterOKResponse;
1278+
};
1279+
};
1280+
12331281
/**
12341282
* Contains response data for the postConfirmEmail operation.
12351283
*/
@@ -2169,3 +2217,23 @@ export type PostWithdrawalRequestResponse = PostWithdrawalRequestCreatedResponse
21692217
parsedBody: PostWithdrawalRequestCreatedResponse;
21702218
};
21712219
};
2220+
2221+
/**
2222+
* Contains response data for the postSubscribeToMailingList operation.
2223+
*/
2224+
export type PostSubscribeToMailingListResponse = PostSubscribeToMailingListOKResponse & {
2225+
/**
2226+
* The underlying HTTP response.
2227+
*/
2228+
_response: msRest.HttpResponse & {
2229+
/**
2230+
* The response body as text (string format)
2231+
*/
2232+
bodyAsText: string;
2233+
2234+
/**
2235+
* The response body as parsed JSON or XML
2236+
*/
2237+
parsedBody: PostSubscribeToMailingListOKResponse;
2238+
};
2239+
};

src/client/models/mappers.ts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,39 @@ export const PostRegisterOKResponse: msRest.CompositeMapper = {
874874
}
875875
};
876876

877+
export const PostLazyRegisterOKResponseData: msRest.CompositeMapper = {
878+
serializedName: "PostLazyRegisterOKResponse_data",
879+
type: {
880+
name: "Composite",
881+
className: "PostLazyRegisterOKResponseData",
882+
modelProperties: {
883+
token: {
884+
serializedName: "token",
885+
type: {
886+
name: "String"
887+
}
888+
}
889+
}
890+
}
891+
};
892+
893+
export const PostLazyRegisterOKResponse: msRest.CompositeMapper = {
894+
serializedName: "PostLazyRegisterOKResponse",
895+
type: {
896+
name: "Composite",
897+
className: "PostLazyRegisterOKResponse",
898+
modelProperties: {
899+
data: {
900+
serializedName: "data",
901+
type: {
902+
name: "Composite",
903+
className: "PostLazyRegisterOKResponseData"
904+
}
905+
}
906+
}
907+
}
908+
};
909+
877910
export const PostConfirmEmailOKResponseData: msRest.CompositeMapper = {
878911
serializedName: "PostConfirmEmailOKResponse_data",
879912
type: {
@@ -2685,3 +2718,36 @@ export const PostWithdrawalRequestCreatedResponse: msRest.CompositeMapper = {
26852718
}
26862719
}
26872720
};
2721+
2722+
export const PostSubscribeToMailingListOKResponseData: msRest.CompositeMapper = {
2723+
serializedName: "PostSubscribeToMailingListOKResponse_data",
2724+
type: {
2725+
name: "Composite",
2726+
className: "PostSubscribeToMailingListOKResponseData",
2727+
modelProperties: {
2728+
status: {
2729+
serializedName: "status",
2730+
type: {
2731+
name: "String"
2732+
}
2733+
}
2734+
}
2735+
}
2736+
};
2737+
2738+
export const PostSubscribeToMailingListOKResponse: msRest.CompositeMapper = {
2739+
serializedName: "PostSubscribeToMailingListOKResponse",
2740+
type: {
2741+
name: "Composite",
2742+
className: "PostSubscribeToMailingListOKResponse",
2743+
modelProperties: {
2744+
data: {
2745+
serializedName: "data",
2746+
type: {
2747+
name: "Composite",
2748+
className: "PostSubscribeToMailingListOKResponseData"
2749+
}
2750+
}
2751+
}
2752+
}
2753+
};

src/client/supportHubApi.ts

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,33 @@ class SupportHubApi extends SupportHubApiContext {
7979
callback) as Promise<Models.PostRegisterResponse>;
8080
}
8181

82+
/**
83+
* @param email
84+
* @param [options] The optional parameters
85+
* @returns Promise<Models.PostLazyRegisterResponse>
86+
*/
87+
postLazyRegister(email: string, options?: msRest.RequestOptionsBase): Promise<Models.PostLazyRegisterResponse>;
88+
/**
89+
* @param email
90+
* @param callback The callback
91+
*/
92+
postLazyRegister(email: string, callback: msRest.ServiceCallback<Models.PostLazyRegisterOKResponse>): void;
93+
/**
94+
* @param email
95+
* @param options The optional parameters
96+
* @param callback The callback
97+
*/
98+
postLazyRegister(email: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.PostLazyRegisterOKResponse>): void;
99+
postLazyRegister(email: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.PostLazyRegisterOKResponse>, callback?: msRest.ServiceCallback<Models.PostLazyRegisterOKResponse>): Promise<Models.PostLazyRegisterResponse> {
100+
return this.sendOperationRequest(
101+
{
102+
email,
103+
options
104+
},
105+
postLazyRegisterOperationSpec,
106+
callback) as Promise<Models.PostLazyRegisterResponse>;
107+
}
108+
82109
/**
83110
* @param confirmationKey
84111
* @param [options] The optional parameters
@@ -1461,6 +1488,33 @@ class SupportHubApi extends SupportHubApiContext {
14611488
postWithdrawalRequestOperationSpec,
14621489
callback) as Promise<Models.PostWithdrawalRequestResponse>;
14631490
}
1491+
1492+
/**
1493+
* @param email
1494+
* @param [options] The optional parameters
1495+
* @returns Promise<Models.PostSubscribeToMailingListResponse>
1496+
*/
1497+
postSubscribeToMailingList(email: string, options?: msRest.RequestOptionsBase): Promise<Models.PostSubscribeToMailingListResponse>;
1498+
/**
1499+
* @param email
1500+
* @param callback The callback
1501+
*/
1502+
postSubscribeToMailingList(email: string, callback: msRest.ServiceCallback<Models.PostSubscribeToMailingListOKResponse>): void;
1503+
/**
1504+
* @param email
1505+
* @param options The optional parameters
1506+
* @param callback The callback
1507+
*/
1508+
postSubscribeToMailingList(email: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.PostSubscribeToMailingListOKResponse>): void;
1509+
postSubscribeToMailingList(email: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.PostSubscribeToMailingListOKResponse>, callback?: msRest.ServiceCallback<Models.PostSubscribeToMailingListOKResponse>): Promise<Models.PostSubscribeToMailingListResponse> {
1510+
return this.sendOperationRequest(
1511+
{
1512+
email,
1513+
options
1514+
},
1515+
postSubscribeToMailingListOperationSpec,
1516+
callback) as Promise<Models.PostSubscribeToMailingListResponse>;
1517+
}
14641518
}
14651519

14661520
// Operation Specifications
@@ -1499,6 +1553,21 @@ const postRegisterOperationSpec: msRest.OperationSpec = {
14991553
serializer
15001554
};
15011555

1556+
const postLazyRegisterOperationSpec: msRest.OperationSpec = {
1557+
httpMethod: "POST",
1558+
path: "api/v1/lazy_register",
1559+
queryParameters: [
1560+
Parameters.email1
1561+
],
1562+
responses: {
1563+
200: {
1564+
bodyMapper: Mappers.PostLazyRegisterOKResponse
1565+
},
1566+
default: {}
1567+
},
1568+
serializer
1569+
};
1570+
15021571
const postConfirmEmailOperationSpec: msRest.OperationSpec = {
15031572
httpMethod: "POST",
15041573
path: "api/v1/register/confirm_email",
@@ -2233,6 +2302,21 @@ const postWithdrawalRequestOperationSpec: msRest.OperationSpec = {
22332302
serializer
22342303
};
22352304

2305+
const postSubscribeToMailingListOperationSpec: msRest.OperationSpec = {
2306+
httpMethod: "POST",
2307+
path: "api/v1/mailing_list/subscribe",
2308+
queryParameters: [
2309+
Parameters.email1
2310+
],
2311+
responses: {
2312+
200: {
2313+
bodyMapper: Mappers.PostSubscribeToMailingListOKResponse
2314+
},
2315+
default: {}
2316+
},
2317+
serializer
2318+
};
2319+
22362320
export {
22372321
SupportHubApi,
22382322
SupportHubApiContext,

src/client/supportHubApiContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class SupportHubApiContext extends msRest.ServiceClient {
3636

3737
super(undefined, options);
3838

39-
this.baseUri = options.baseUri || this.baseUri || "http://api.gitcom.com/api/v1";
39+
this.baseUri = options.baseUri || this.baseUri || "http://api.gitcom.org/api/v1";
4040
this.requestContentType = "application/json; charset=utf-8";
4141
this.entityType = entityType;
4242
if (options.currencyType !== null && options.currencyType !== undefined) {
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import React from "react";
2+
import {Input, Row, Button, notification, Icon} from "antd";
3+
4+
interface IProps {
5+
}
6+
7+
interface IState {
8+
email: string
9+
}
10+
11+
class SubscribeToMailingList extends React.Component<IProps, IState> {
12+
constructor(props: IProps) {
13+
super(props);
14+
this.state = {
15+
email: ''
16+
}
17+
}
18+
19+
updateEmail(newEmail: string) {
20+
this.setState({
21+
email: newEmail
22+
});
23+
console.log(this.state);
24+
}
25+
26+
submitForm() {
27+
let email = this.state.email;
28+
29+
if (email.split('@').length === 1 || email.split('.').length === 1) {
30+
notification['warning']({
31+
message: 'This email is invalid, please check your email and try again'
32+
});
33+
return;
34+
}
35+
36+
window.App.apiClient.postSubscribeToMailingList(email).then(() => {
37+
notification['success']({
38+
message: "You've just subscribed! Thank you :)"
39+
})
40+
});
41+
}
42+
43+
render() {
44+
return <div>
45+
<Row>
46+
<Input
47+
prefix={<Icon type="mail" style={{color: 'rgba(0,0,0,.25)'}}/>}
48+
onChange={(e) => {this.updateEmail(e.target.value)}}
49+
placeholder={'Your email'}
50+
/>
51+
<Button
52+
className={"margin-sm-top"}
53+
type={"primary"}
54+
onClick={() => this.submitForm()}
55+
>Subscribe</Button>
56+
</Row>
57+
</div>
58+
}
59+
}
60+
61+
export default SubscribeToMailingList;

0 commit comments

Comments
 (0)