Skip to content

Commit f20b7e7

Browse files
authored
Merge pull request #41 from signum-network/develop
Develop
2 parents a426b13 + e0e7316 commit f20b7e7

File tree

22 files changed

+141
-40
lines changed

22 files changed

+141
-40
lines changed

react-pool/public/assets/locales/de/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,6 @@
138138
"languageName": "Deutsch",
139139
"chooseLanguage": "Wählen Sie eine Sprache",
140140
"noBlocksWon": "Es sind keine Blöcke gewonnen, holen Sie sie!",
141-
"processing": "Wird bearbeitet..."
141+
"processing": "Wird bearbeitet...",
142+
"graceDeadline": "Gnadenfristen"
142143
}

react-pool/public/assets/locales/en/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"nBlocksAverage": "Number of blocks for averages",
5454
"nBlocksToShowMiner": "Number of blocks to show a Miner",
5555
"maxDeadline": "Max Deadline",
56+
"graceDeadline": "Grace deadlines",
5657
"processLag": "Process Lag",
5758
"feeRecipient": "Fee Recipient",
5859
"poolFee": "Pool Fee",

react-pool/public/assets/locales/es/translation.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"poolPhysical": "Tamaño físico",
9393
"poolShare": "Pool Share",
9494
"poolSoloFee": "Tarifa para minero en \"Solo mining\"",
95-
"poolVersion": "Versión del pool",
95+
"poolVersion": "Versión de la pool",
9696
"price": "Precio",
9797
"processLag": "Process Lag",
9898
"rewardAndFees": "Recompensa + Tarifas",
@@ -138,5 +138,6 @@
138138
"languageName": "Español",
139139
"chooseLanguage": "Elija un idioma",
140140
"noBlocksWon": "No hay bloques ganados, ¡ve por ellos!",
141-
"processing": "Procesando..."
142-
}
141+
"processing": "Procesando...",
142+
"graceDeadline": "Deadlines fallidos sin penalización"
143+
}

react-pool/public/assets/locales/fr/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,6 @@
138138
"languageName": "Français",
139139
"chooseLanguage": "Choisissez une langue",
140140
"noBlocksWon": "Il n'y a pas de blocs gagnés, allez les chercher !",
141-
"processing": "Traitement..."
141+
"processing": "Traitement...",
142+
"graceDeadline": "Délais de grâce"
142143
}

react-pool/public/assets/locales/it/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,6 @@
138138
"languageName": "Italiano",
139139
"chooseLanguage": "Scegli una lingua",
140140
"noBlocksWon": "Non ci sono blocchi vinti, andate a prenderli!",
141-
"processing": "In lavorazione..."
141+
"processing": "In lavorazione...",
142+
"graceDeadline": "Scadenze di grazia"
142143
}

react-pool/public/assets/locales/kr/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"nBlocksAverage": "평균 블록 수",
5454
"nBlocksToShowMiner": "광부를 보여줄 블록 수",
5555
"maxDeadline": "최대 기한",
56+
"graceDeadline": "유예 마감",
5657
"processLag": "프로세스 지연",
5758
"feeRecipient": "수수료 수령인",
5859
"poolFee": "풀 요금",

react-pool/public/assets/locales/nl/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,6 @@
138138
"languageName": "Nederlands",
139139
"chooseLanguage": "Kies een taal",
140140
"noBlocksWon": "Er zijn geen blokken gewonnen, ga ze halen!",
141-
"processing": "Verwerken..."
141+
"processing": "Verwerken...",
142+
"graceDeadline": "Grace deadlines"
142143
}

react-pool/public/assets/locales/pl/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,6 @@
138138
"languageName": "Polskie",
139139
"chooseLanguage": "Wybierz język",
140140
"noBlocksWon": "Nie ma wygranych bloków, zdobądź je!",
141-
"processing": "Przetwarzanie..."
141+
"processing": "Przetwarzanie...",
142+
"graceDeadline": "Terminy łaski"
142143
}

react-pool/public/assets/locales/pt/translation.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,6 @@
138138
"languageName": "Português",
139139
"chooseLanguage": "Escolha um idioma",
140140
"noBlocksWon": "Não há blocos ganhos, vá pegá-los!",
141-
"processing": "Em processamento..."
142-
}
141+
"processing": "Em processamento...",
142+
"graceDeadline": "Deadlines perdidas sem penalização"
143+
}

react-pool/public/assets/locales/ru/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,6 @@
138138
"languageName": "русский",
139139
"chooseLanguage": "Выберите язык",
140140
"noBlocksWon": "Нет выигранных блоков, идите и возьмите их!",
141-
"processing": "Обработка..."
141+
"processing": "Обработка...",
142+
"graceDeadline": "Сроки отсрочки"
142143
}

react-pool/public/assets/locales/tr/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,6 @@
138138
"languageName": "Türk",
139139
"chooseLanguage": "Bir Dil Seçin",
140140
"noBlocksWon": "Kazanılan blok yok, git onları al!",
141-
"processing": "İşleme..."
141+
"processing": "İşleme...",
142+
"graceDeadline": "Ek süreler"
142143
}

react-pool/public/assets/locales/zh/translation.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"minerOptionsAlert": "如果你想要更改矿工设置,请发送<1>未加密信息</1>",
6767
"miners": "矿工",
6868
"minimumPayout": "最小起付额",
69-
"minimumPayoutParagraph": "通过发送以下文本消息将您的最低起付金额更改为100 SIGNA(接受任何高于{minimumPayoutCount}}的数值)</1>:",
69+
"minimumPayoutParagraph": "通过发送以下文本消息将您的最低起付金额更改为100 SIGNA(接受任何高于{{minimumPayoutCount}}的数值)</1>:",
7070
"minimumPayoutsAtOnce": "一次性最小支付笔数",
7171
"missingDetails": "缺少信息,请联系操作人员",
7272
"nBlocksAverage": "平均区块数量",
@@ -138,5 +138,6 @@
138138
"languageName": "普通话",
139139
"chooseLanguage": "选择语言",
140140
"noBlocksWon": "没有赢得块,去拿它们!",
141-
"processing": "加工..."
142-
}
141+
"processing": "加工...",
142+
"graceDeadline": "宽限期"
143+
}

react-pool/public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@
8282

8383
<!-- Open Graph / Facebook -->
8484
<meta property="og:type" content="website" />
85-
<meta property="og:url" content="%PUBLIC_URL%" />
8685
<meta property="og:title" content="{TITLE}" />
8786
<meta property="og:description" content="{SEODESCRIPTION}" />
8887
<meta property="og:image" content="{SEOIMGURL}" />
88+
<meta property="og:url" content="{PAGEURL}" />
8989

9090
<!-- Twitter -->
9191
<meta property="twitter:card" content="summary_large_image" />
92-
<meta property="twitter:url" content="%PUBLIC_URL%" />
9392
<meta property="twitter:title" content="{TITLE}" />
93+
<meta property="twitter:url" content="{PAGEURL}" />
9494

9595
<meta property="twitter:description" content="{SEODESCRIPTION}" />
9696
<meta property="twitter:image" content="{SEOIMGURL}" />

react-pool/src/Routes.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ const Routes = (props) => {
130130
}
131131
}, [initialized, location]);
132132

133+
// Listen to route changes
134+
useEffect(() => {
135+
window.scrollTo(0, 0);
136+
}, [location]);
137+
133138
return (
134139
<Fragment>
135140
{/* Miner modal */}

react-pool/src/components/UI/minersTable/index.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,19 @@ const StickyHeadTable = (props) => {
101101
format: (value) => value.toFixed(2),
102102
},
103103
{
104-
id: "Software",
105-
minWidth: 150,
104+
id: "shareModel",
105+
minWidth: 75,
106106
align: "center",
107-
format: (value) => value.toFixed(2),
108-
},
109-
{
110-
id: "Actions",
111-
minWidth: 150,
112-
align: "center",
113-
format: (value) => value.toFixed(2),
107+
format: (value) => value.toLocaleString("en-US"),
114108
},
109+
110+
// Optional actions button
111+
// {
112+
// id: "Actions",
113+
// minWidth: 150,
114+
// align: "center",
115+
// format: (value) => value.toFixed(2),
116+
// },
115117
];
116118

117119
// Mobile columns
@@ -129,7 +131,7 @@ const StickyHeadTable = (props) => {
129131
nativeColumns[2],
130132

131133
// View more
132-
nativeColumns[10],
134+
// nativeColumns[10],
133135
];
134136

135137
// Columns that website will use
@@ -263,6 +265,10 @@ const StickyHeadTable = (props) => {
263265
{cellValue}
264266
</Typography>
265267
);
268+
269+
// Check if column is share model
270+
} else if (column.id === "shareModel") {
271+
cellContent = row.data.sharePercent + "%";
266272
}
267273

268274
return (

react-pool/src/components/UI/outlinedTable/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ const OutLinedTable = (props) => {
5252
? item.onClick
5353
: null;
5454

55+
// Check if user has dynamic onClick, but in the value column
56+
const onClickValueAction =
57+
item.onClickValue &&
58+
item.onClickValue !== null &&
59+
item.onClickValue !== undefined
60+
? item.onClickValue
61+
: null;
62+
5563
return (
5664
<Grid container item className={styles.tableItem} key={key}>
5765
<Grid
@@ -68,10 +76,15 @@ const OutLinedTable = (props) => {
6876
<Typography component="span">{item.sTitle}</Typography>
6977
) : null}
7078
</Grid>
79+
7180
<Grid
7281
item
7382
className={styles.tableItemRightSide}
74-
style={{ width: props.sWidth }}
83+
style={{
84+
width: props.sWidth,
85+
cursor: onClickValueAction ? "pointer" : null,
86+
}}
87+
onClick={onClickValueAction}
7588
>
7689
<Typography>{item.value}</Typography>
7790
</Grid>

react-pool/src/pages/home/index.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
} from "../../utils/globalParameters";
4141

4242
import { thousands_separators } from "../../utils/functions/normal";
43+
import { openAccountInExplorer } from "../../utils/functions/blockchain";
4344

4445
// Components
4546
import MinersTable from "../../components/UI/minersTable/index";
@@ -225,7 +226,20 @@ const Home = (props) => {
225226
bookMarkedMiner.data.map((item) => {
226227
// Check if item exist
227228
if (item && item !== null && item !== undefined) {
228-
return dataToRender.push({ ...item, title: t(item.title) });
229+
// Key item
230+
const key = item.title;
231+
232+
// Properties to add
233+
let objectProperties = { ...item, title: t(key) };
234+
235+
// Check if items are username or address
236+
if (key === "username" || key === "minerAddress") {
237+
objectProperties.onClickValue = () => {
238+
openAccountInExplorer(item.id);
239+
};
240+
}
241+
242+
return dataToRender.push(objectProperties);
229243
}
230244
});
231245

react-pool/src/pages/pool-info/index.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ import MinerOptions from "../../components/pages/poolInfo/minerOption/index";
3333

3434
// Extra
3535
import { thousands_separators } from "../../utils/functions/normal";
36-
import { formatTime } from "../../utils/functions/blockchain";
36+
import {
37+
formatTime,
38+
openAccountInExplorer,
39+
} from "../../utils/functions/blockchain";
3740

3841
// Third-party
3942
import { isMobile } from "react-device-detect";
@@ -171,6 +174,9 @@ const PoolInfo = (props) => {
171174
title: t("poolAccount"),
172175
value: poolData.data.poolAccountRS,
173176
type: "info",
177+
onClickValue: () => {
178+
openAccountInExplorer(poolData.data.poolAccountId);
179+
},
174180
},
175181
{
176182
title: t("nBlocksAverage"),
@@ -187,6 +193,11 @@ const PoolInfo = (props) => {
187193
value: poolData.data.maxDeadline,
188194
type: "info",
189195
},
196+
{
197+
title: t("graceDeadline"),
198+
value: poolData.data.graceDeadlines || "",
199+
type: "info",
200+
},
190201

191202
{
192203
title: t("processLag"),
@@ -197,6 +208,9 @@ const PoolInfo = (props) => {
197208
title: t("feeRecipient"),
198209
value: poolData.data.feeRecipientRS,
199210
type: "info",
211+
onClickValue: () => {
212+
openAccountInExplorer(poolData.data.feeRecipientId);
213+
},
200214
},
201215
{
202216
title: t("poolFee"),
@@ -213,6 +227,9 @@ const PoolInfo = (props) => {
213227
title: t("donationRecipient"),
214228
value: poolData.data.donationRecipientRS,
215229
type: "info",
230+
onClickValue: () => {
231+
openAccountInExplorer(poolData.data.donationRecipientId);
232+
},
216233
},
217234
{
218235
title: t("defaultDonation"),

react-pool/src/utils/functions/blockchain.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Here will be functions related to the blockchain
2-
import { genesisBaseTarget } from "../globalParameters";
2+
import { genesisBaseTarget, EXPLORERToUse } from "../globalParameters";
33
import { thousands_separators, escapeHtml } from "./normal";
44

55
// Format capacity
@@ -76,3 +76,8 @@ export const formatMinerName = (
7676
export const getAccountExplorerLink = (explorer, id) => {
7777
return explorer + id;
7878
};
79+
80+
// Open explorer in a new tab
81+
export const openAccountInExplorer = (accountId) => {
82+
window.open(`${EXPLORERToUse}?action=account&account=${accountId}`, "_blank");
83+
};

react-pool/src/utils/redux/actions/basicInfo.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ export const fetchPoolInfo =
159159
false
160160
);
161161

162+
// Pool account ID
163+
responseData.poolAccountId = data.poolAccount;
164+
162165
// Number of blocks per average
163166
responseData.nAvg = thousands_separators(data.nAvg);
164167

@@ -168,6 +171,9 @@ export const fetchPoolInfo =
168171
// Max Deadline
169172
responseData.maxDeadline = thousands_separators(data.maxDeadline);
170173

174+
// Grace Deadline
175+
responseData.graceDeadlines = data.graceDeadlines;
176+
171177
// Process Lag
172178
responseData.processLag =
173179
thousands_separators(data.processLag) + ` ${t("blocks")}`;
@@ -181,6 +187,9 @@ export const fetchPoolInfo =
181187
false
182188
);
183189

190+
// Fee Recipient ID
191+
responseData.feeRecipientId = data.feeRecipient;
192+
184193
// Pool Fee
185194
responseData.poolFee =
186195
(parseFloat(data.poolFeePercentage) * 100).toFixed(2) + " %";
@@ -198,6 +207,9 @@ export const fetchPoolInfo =
198207
false
199208
);
200209

210+
// Donation Recipient ID
211+
responseData.donationRecipientId = data.donationRecipient;
212+
201213
// Donation percentage (configurable)
202214
responseData.donationPercent =
203215
parseFloat(data.donationPercent).toFixed(2) + " %";

react-pool/src/utils/redux/actions/miners.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,17 @@ export const selectBookmarkedMiner =
239239
response.name !== null &&
240240
response.name !== undefined &&
241241
response.name.trim() !== ""
242-
? { title: "username", value: response.name, type: "info" }
242+
? {
243+
title: "username",
244+
value: response.name,
245+
id: response.address,
246+
type: "info",
247+
}
243248
: null,
244249
{
245250
title: "minerAddress",
246251
value: response.addressRS,
252+
id: response.address,
247253
type: "info",
248254
},
249255
{

0 commit comments

Comments
 (0)