-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tickets: Add cspp into ticket purchase (#2773)
- Loading branch information
Showing
28 changed files
with
521 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { FormattedMessage as T } from "react-intl"; | ||
import { TextInput, NumericInput } from "inputs"; | ||
import { classNames } from "pi-ui"; | ||
import style from "./PrivacyForm.module.css"; | ||
import { usePrivacyForm } from "./hooks"; | ||
|
||
const PrivacyForm = ({ | ||
className | ||
}) => { | ||
const { | ||
mixedAccountName, | ||
changeAccountName, | ||
csppServer, | ||
csppPort, | ||
mixedAccountBranch | ||
} = usePrivacyForm(); | ||
|
||
return ( | ||
<div className={className ? className : null}> | ||
<div className={classNames(style.isRow, style.row)}> | ||
<div className={classNames(style.isRow, style.item)}> | ||
<div className={""}> | ||
<T id="privacy.mixing.account" m="Mixing Account" />: | ||
</div> | ||
<TextInput required disabled value={mixedAccountName} /> | ||
</div> | ||
<div className={style.item}> | ||
<div className={style.isRow}> | ||
<div className={""}> | ||
<T id="privacy.mixing.account.branch" m="Account Branch" />: | ||
</div> | ||
<NumericInput value={mixedAccountBranch} disabled /> | ||
</div> | ||
</div> | ||
</div> | ||
<div className={classNames(style.isRow, style.row)}> | ||
<div className={classNames(style.isRow, style.item)}> | ||
<div className={""}> | ||
<T id="privacy.change.account" m="Change Account" />: | ||
</div> | ||
<TextInput required disabled value={changeAccountName} /> | ||
</div> | ||
</div> | ||
<div className={classNames(style.isRow, style.row)}> | ||
<div className={classNames(style.isRow, style.item)}> | ||
<div className={""}> | ||
<T id="privacy.mixing.server" m="Shuffle Server" />: | ||
</div> | ||
<TextInput required disabled value={csppServer} /> | ||
</div> | ||
<div className={classNames(style.isRow, style.item)}> | ||
<div className={""}> | ||
<T id="privacy.mixing.server.port" m="Shuffle Port" />: | ||
</div> | ||
<TextInput required disabled value={csppPort} /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PrivacyForm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.error { | ||
color: var(--error-text-color); | ||
} | ||
|
||
.isRow { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
|
||
.bold { | ||
font-weight: 700; | ||
} | ||
.select { | ||
width: 300px; | ||
} | ||
.item { | ||
padding: 10px; | ||
} | ||
.item.error { | ||
color: red; | ||
} | ||
.area { | ||
margin-left: auto; | ||
} | ||
.row { | ||
margin-bottom: 10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useSelector } from "react-redux"; | ||
import * as sel from "selectors"; | ||
|
||
export function usePrivacyForm() { | ||
const mixedAccount = useSelector(sel.getMixedAccount); | ||
const changeAccount = useSelector(sel.getChangeAccount); | ||
const csppServer = useSelector(sel.getCsppServer); | ||
const csppPort = useSelector(sel.getCsppPort); | ||
const mixedAccountBranch = useSelector(sel.getMixedAccountBranch); | ||
|
||
const accounts = useSelector(sel.sortedAccounts); | ||
|
||
const getAccountName = (n) => { | ||
const account = accounts.find(({ accountNumber }) => accountNumber === n); | ||
return account ? account.accountName : null; | ||
}; | ||
|
||
const mixedAccountName = getAccountName(mixedAccount); | ||
const changeAccountName = getAccountName(changeAccount); | ||
|
||
return { | ||
mixedAccountName, | ||
changeAccountName, | ||
csppServer, | ||
csppPort, | ||
mixedAccountBranch | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.