-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
1,170 additions
and
490 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { useDevMode } from "utils/localStorage" | ||
import SettingsSelectorToggle from "components/layout/SettingsSelectorToggle" | ||
import { FlexColumn, GasAdjustment } from "components/layout" | ||
import { TooltipIcon } from "components/display" | ||
import { DevModeTooltip } from "./DevModeTooltips" | ||
|
||
const AdvancedSettings = () => { | ||
const { devMode, changeDevMode } = useDevMode() | ||
const options = [ | ||
{ value: "devMode", selected: devMode, label: "Developer Mode" }, | ||
] | ||
|
||
return ( | ||
<FlexColumn gap={10}> | ||
<SettingsSelectorToggle | ||
onChange={changeDevMode} | ||
extra={<TooltipIcon content={<DevModeTooltip />} />} | ||
options={options} | ||
/> | ||
<GasAdjustment /> | ||
</FlexColumn> | ||
) | ||
} | ||
|
||
export default AdvancedSettings |
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,27 @@ | ||
import { useTranslation } from "react-i18next" | ||
|
||
export const DevModeTooltip = () => { | ||
const { t } = useTranslation() | ||
|
||
return ( | ||
<article> | ||
<h1>{t("Developer mode enables the following")}:</h1> | ||
<ul> | ||
<li>{t("Contracts page")}</li> | ||
<li>{t("Copy token addresses from your wallet")}</li> | ||
</ul> | ||
</article> | ||
) | ||
} | ||
export const GasAdjustmentTooltip = () => { | ||
const { t } = useTranslation() | ||
return ( | ||
<article> | ||
<p> | ||
{t( | ||
"Set a gas adjustment coefficient in case none is specified by the chain" | ||
)} | ||
</p> | ||
</article> | ||
) | ||
} |
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,60 @@ | ||
import WithSearchInput from "pages/custom/WithSearchInput" | ||
import { useDisplayChains, useSelectedDisplayChain } from "utils/localStorage" | ||
import SettingsSelectorToggle from "components/layout/SettingsSelectorToggle" | ||
import { useNetwork } from "data/wallet" | ||
import { ChainButton } from "components/general" | ||
|
||
import { isTerraChain } from "utils/chain" | ||
|
||
const DisplayChainsSetting = () => { | ||
const { displayChains, changeDisplayChains } = useDisplayChains() | ||
const { selectedDisplayChain, changeSelectedDisplayChain } = | ||
useSelectedDisplayChain() | ||
const network = useNetwork() | ||
|
||
const onChange = (value: string) => { | ||
const newDisplayChains = displayChains.includes(value) | ||
? displayChains.filter((chainID) => chainID !== value) | ||
: [...displayChains, value] | ||
changeDisplayChains(newDisplayChains) | ||
if (value === selectedDisplayChain) { | ||
changeSelectedDisplayChain(undefined) | ||
} | ||
} | ||
|
||
return ( | ||
<WithSearchInput | ||
placeholder="Search for chains..." | ||
extra={<ChainButton />} | ||
gap={8} | ||
> | ||
{(input) => ( | ||
<SettingsSelectorToggle | ||
onChange={onChange} | ||
options={Object.keys(network) | ||
.filter( | ||
(chainID) => | ||
network[chainID].name | ||
.toLowerCase() | ||
.includes(input.toLowerCase()) || | ||
chainID.toLowerCase().includes(input.toLowerCase()) | ||
) | ||
.map((chainID) => ({ | ||
value: chainID, | ||
selected: displayChains.includes(chainID), | ||
label: network[chainID].name, | ||
icon: network[chainID].icon, | ||
})) | ||
.sort((a, b) => { | ||
if (isTerraChain(a.value) !== isTerraChain(b.value)) | ||
return isTerraChain(a.value) ? -1 : 1 | ||
if (a.selected !== b.selected) return a.selected ? -1 : 1 | ||
return 0 | ||
})} | ||
/> | ||
)} | ||
</WithSearchInput> | ||
) | ||
} | ||
|
||
export default DisplayChainsSetting |
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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
.back { | ||
position: absolute; | ||
left: 40px; | ||
transform: translate(0, 50%); | ||
|
||
svg path { | ||
fill: var(--text); | ||
} | ||
top: 40px; | ||
} | ||
.extra { | ||
position: absolute; | ||
right: 40px; | ||
top: 40px; | ||
} | ||
|
||
.button__container { | ||
width: 100%; | ||
} | ||
|
||
.advanced { | ||
margin-top: 30px; | ||
} |
Oops, something went wrong.