Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-added help-center #54

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
19 changes: 13 additions & 6 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { HashRouter as Router, Route, Redirect } from "react-router-dom";
import { HashRouter as Router, Route } from "react-router-dom";
import { Flex, useColorMode } from "@chakra-ui/core";
import { Helmet } from "react-helmet";
import amplitude from "amplitude-js";
Expand All @@ -18,9 +18,9 @@ import { currency } from "./constants";
import Loader from "./Loader";
import getValidatorInfo from "./getValidatorInfo";

import Testing from "./components/Testing";
import getNominatorInfo from "./getNominatorInfo.js";
import TxStatus from "./components/ConfirmationPage/TxStatus.js";
import getNominatorInfo from "./getNominatorInfo";
import TxStatus from "./components/ConfirmationPage/TxStatus";
import HelpCenter from "./components/HelpCenter.jsx";

const AMPLITUDE_KEY = "1f1699160a46dec6cc7514c14cb5c968";

Expand Down Expand Up @@ -65,7 +65,7 @@ function App() {

const handleTxBlock = block => {
setTxBlock(block);
}
};

const handleSubmit = bool => {
setSubmitted(bool);
Expand Down Expand Up @@ -211,9 +211,16 @@ function App() {
<ProtectedRoute
path='/status'
component={() => (
<TxStatus txStatus={txStatus} txBlock={txBlock} isSubmitted={submitted} />
<TxStatus
txStatus={txStatus}
txBlock={txBlock}
isSubmitted={submitted}
/>
)}
/>
<Route path='/help-center'>
<HelpCenter />
</Route>
</Flex>
</Router>
</AmplitudeProvider>
Expand Down
181 changes: 104 additions & 77 deletions src/components/FAQs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,82 +11,109 @@ import {
} from '@chakra-ui/core'

const data = [
{
id: 1,
question: 'Why stake?',
answer: `10% inflation/year when the network launches\n 50% targeted active staking\n ~20% annual return`,
link: {
url:
'https://wiki.polkadot.network/docs/en/learn-staking#why-stake',
content: 'Learn more about why stake',
isExternal: true,
},
},
{
id: 2,
question: 'What is Polkadot?',
answer:
'Polkadot is a protocol that allows independent blockchains to exchange information.',
link: {
url:
'https://wiki.polkadot.network/docs/en/learn-introduction#what-is-polkadot',
content: 'Learn more about Polkadot',
isExternal: true,
},
},
{
id: 3,
question: 'How does staking work in polkadot and what is NPoS?',
answer:
'Polkadot uses NPoS (Nominated Proof-of-Stake) as its mechanism for selecting the validator set. It is designed with the roles of validators and nominators, to maximize chain security.',
link: {
url:
'https://wiki.polkadot.network/docs/en/learn-staking#how-does-staking-work-in-polkadot',
content: 'Learn more about staking',
isExternal: true,
},
},
{
id: 4,
question: 'What are nominators?',
answer:
'Nominators secure the relay chain by selecting good validators and staking DOTs.',
link: {
url: 'https://wiki.polkadot.network/docs/en/maintain-nominator',
content: 'Learn more about nominators',
isExternal: true,
},
},
{
id: 5,
question: 'What are validators?',
answer:
'Validators secure the relay chain by staking DOTs, validating proofs from collators and participating in consensus with other validators.',
link: {
url: 'https://wiki.polkadot.network/docs/en/maintain-validator',
content: 'Learn more about validators',
isExternal: true,
},
},
{
id: 6,
question: 'How to stake?',
answer:
"In order to stake DOTs, the first step is to create stash and controller accounts. Next bond the DOTs of the stash account. Select the controller. Now you're ready to stake DOTs as a nominator!",
link: {
url:
'https://wiki.polkadot.network/docs/en/maintain-guides-how-to-nominate-alexander',
content: 'Learn more about how to stake',
isExternal: true,
},
},
{
id: 7,
question: 'What does Polkadot Reward Calculator do?',
answer:
'Polkadot Reward Calculator presents the Daily Earning Potential for each validator in a graphical format which makes it easy to visualize which validator would yield the highest return if the same amount is staked.',
},
]
{
id: 1,
question: "Why stake?",
answer: `10% inflation/year when the network launches\n 50% targeted active staking\n ~20% annual return`,
link: {
url: "https://wiki.polkadot.network/docs/en/learn-staking#why-stake",
content: "Learn more about why stake",
isExternal: true
}
},
{
id: 2,
question: "What is Polkadot?",
answer:
"Polkadot is a protocol that allows independent blockchains to exchange information.",
link: {
url:
"https://wiki.polkadot.network/docs/en/learn-introduction#what-is-polkadot",
content: "Learn more about Polkadot",
isExternal: true
}
},
{
id: 4,
question: "What is Kusama?",
answer:
'Kusama is a "canary network" for Polkadot, an early unaudited release of the code that is available first and holds real economic value.',
link: {
url: "https://wiki.polkadot.network/docs/en/kusama-index",
content: "Learn more about Kusama",
isExternal: true
}
},
{
id: 3,
question: "How does staking work in polkadot and what is NPoS?",
answer:
"Polkadot uses NPoS (Nominated Proof-of-Stake) as its mechanism for selecting the validator set. It is designed with the roles of validators and nominators, to maximize chain security.",
link: {
url:
"https://wiki.polkadot.network/docs/en/learn-staking#how-does-staking-work-in-polkadot",
content: "Learn more about staking",
isExternal: true
}
},
{
id: 4,
question: "What are nominators?",
answer:
"Nominators secure the relay chain by selecting good validators and staking KSM/DOTs.",
link: {
url: "https://wiki.polkadot.network/docs/en/maintain-nominator",
content: "Learn more about nominators",
isExternal: true
}
},
{
id: 5,
question: "What are validators?",
answer:
"Validators secure the relay chain by staking KSM/DOTs, validating proofs from collators and participating in consensus with other validators.",
link: {
url: "https://wiki.polkadot.network/docs/en/maintain-validator",
content: "Learn more about validators",
isExternal: true
}
},
{
id: 6,
question: "How to stake?",
answer:
"In order to stake KSM/DOTs, the first step is to create stash and controller accounts. Next bond the KSM/DOTs of the stash account. Select the controller. Now you're ready to stake KSM/DOTs as a nominator!",
link: {
url:
"https://wiki.polkadot.network/docs/en/maintain-guides-how-to-nominate-alexander",
content: "Learn more about how to stake",
isExternal: true
}
},
{
id: 7,
question: "How are rewards calculated?",
answer:
"We take into account user's budget along with on-chain information about the validators like commission, total stake and previous era points to calculate expected earnings.",
link: {
url:
"https://github.com/buidl-labs/YieldScan/wiki/Rewards-Calculation-Logic",
content: "View rewards calculation logic wiki",
isExternal: true
}
},
{
id: 8,
question: "How do you calculate the risk score for validators?",
answer:
"We on chain information about the validators like Own stake, Other stake, Number of backers, Number of slashes and Active validation time → no of eras validated to determine risk scores for validators.",
link: {
url: "https://github.com/buidl-labs/YieldScan/wiki/Risk-Score-Logic",
content: "View risk score logic wiki",
isExternal: true
}
}
];

class FAQs extends React.Component {
render() {
Expand All @@ -109,7 +136,7 @@ class FAQs extends React.Component {
href={data.link.url}
color="teal.500"
isExternal={
data.link.isExternal ? true : false
!!data.link.isExternal
}
>
{data.link.content}
Expand Down
10 changes: 5 additions & 5 deletions src/components/HelpCenter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import {
// Button,
Link as ChakraLink,
} from '@chakra-ui/core'
import FAQs from './FAQs'
import HowToStake from './guides/HowToStake'
import LogEvent from './LogEvent'
import Helmet from 'react-helmet'
import Footer from './Footer'
import FAQs from './FAQs.jsx'
import HowToStake from './guides/HowToStake.jsx'
import LogEvent from './LogEvent'
import Footer from './Footer.jsx'

export default function HelpCenter() {
return (
Expand Down Expand Up @@ -81,7 +81,7 @@ export default function HelpCenter() {
Can't find what you're looking for?
</Text>
<ChakraLink
href="mailto:[email protected]"
href="mailto:[email protected]"
color="teal.500"
>
Contact Us
Expand Down
4 changes: 2 additions & 2 deletions src/components/NavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ export default () => {
Returns Calculator
</Link>
</Box>
{/* <Box mr={8}>
<Box mr={8}>
<Link
as={NavLink}
className="nav-link"
to="/help-center"
>
Help Center
</Link>
</Box> */}
</Box>
<IconButton
aria-label={
colorMode === "light"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReturnsCalculator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const ReturnsCalculator = (props: ReturnsCalculatorProps) => {
maxW='960px'
>
<Heading mt={16} mb={!suggestionsFound ? 4 : 12}>
Calculate your staking returns on Kusama
Calculate your returns on Kusama
</Heading>
{!suggestionsFound ? (
<Alert status='error' mb={12}>
Expand Down
Loading