Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Configure/Configure.js
Show First 20 Lines • Show All 425 Lines • ▼ Show 20 Lines | .ant-switch-checked { | ||||
background-color: ${props => props.theme.eCashBlue}; | background-color: ${props => props.theme.eCashBlue}; | ||||
svg { | svg { | ||||
fill: ${props => props.theme.contrast}; | fill: ${props => props.theme.contrast}; | ||||
} | } | ||||
} | } | ||||
.SendConfirm { | .SendConfirm { | ||||
color: ${props => props.theme.lightWhite}; | color: ${props => props.theme.lightWhite}; | ||||
} | } | ||||
.ShowMessages { | |||||
color: ${props => props.theme.lightWhite}; | |||||
} | |||||
`; | `; | ||||
const Configure = () => { | const Configure = () => { | ||||
const ContextValue = React.useContext(WalletContext); | const ContextValue = React.useContext(WalletContext); | ||||
const authentication = React.useContext(AuthenticationContext); | const authentication = React.useContext(AuthenticationContext); | ||||
const { wallet, apiError } = ContextValue; | const { wallet, apiError } = ContextValue; | ||||
const location = useLocation(); | const location = useLocation(); | ||||
▲ Show 20 Lines • Show All 462 Lines • ▼ Show 20 Lines | const renameContactByName = async contactObj => { | ||||
); | ); | ||||
} | } | ||||
}; | }; | ||||
const handleSendModalToggle = checkedState => { | const handleSendModalToggle = checkedState => { | ||||
changeCashtabSettings('sendModal', checkedState); | changeCashtabSettings('sendModal', checkedState); | ||||
}; | }; | ||||
const handleUnknownSenderMsg = checkedState => { | |||||
changeCashtabSettings('showMessages', checkedState); | |||||
}; | |||||
const getContactNameByAddress = contactAddress => { | const getContactNameByAddress = contactAddress => { | ||||
if (!contactAddress) { | if (!contactAddress) { | ||||
return; | return; | ||||
} | } | ||||
// filter contact from local contact list array | // filter contact from local contact list array | ||||
const filteredContactList = contactListArray.filter( | const filteredContactList = contactListArray.filter( | ||||
element => element.address === contactAddress, | element => element.address === contactAddress, | ||||
▲ Show 20 Lines • Show All 872 Lines • ▼ Show 20 Lines | return ( | ||||
checkedChildren={<CheckOutlined />} | checkedChildren={<CheckOutlined />} | ||||
unCheckedChildren={<CloseOutlined />} | unCheckedChildren={<CloseOutlined />} | ||||
checked={ | checked={ | ||||
cashtabSettings ? cashtabSettings.sendModal : false | cashtabSettings ? cashtabSettings.sendModal : false | ||||
} | } | ||||
onChange={handleSendModalToggle} | onChange={handleSendModalToggle} | ||||
/> | /> | ||||
</GeneralSettingsItem> | </GeneralSettingsItem> | ||||
<GeneralSettingsItem> | |||||
<div className="ShowMessages"> | |||||
<LockFilled /> Hide messages from unknown sender | |||||
</div> | |||||
<Switch | |||||
size="small" | |||||
checkedChildren={<CheckOutlined />} | |||||
unCheckedChildren={<CloseOutlined />} | |||||
checked={ | |||||
cashtabSettings | |||||
? cashtabSettings.showMessages | |||||
: false | |||||
} | |||||
onChange={handleUnknownSenderMsg} | |||||
/> | |||||
</GeneralSettingsItem> | |||||
<StyledSpacer />[ | <StyledSpacer />[ | ||||
<SettingsLink | <SettingsLink | ||||
type="link" | type="link" | ||||
href="https://docs.cashtab.com/docs/" | href="https://docs.cashtab.com/docs/" | ||||
target="_blank" | target="_blank" | ||||
rel="noreferrer" | rel="noreferrer" | ||||
> | > | ||||
Documentation | Documentation | ||||
</SettingsLink> | </SettingsLink> | ||||
] | ] | ||||
</StyledConfigure> | </StyledConfigure> | ||||
</SidePaddingCtn> | </SidePaddingCtn> | ||||
); | ); | ||||
}; | }; | ||||
export default Configure; | export default Configure; |