Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Configure/Configure.js
Show All 27 Lines | import { | ||||
ThemedDollarOutlined, | ThemedDollarOutlined, | ||||
ThemedSettingOutlined, | ThemedSettingOutlined, | ||||
} from '@components/Common/CustomIcons'; | } from '@components/Common/CustomIcons'; | ||||
import { ReactComponent as Trashcan } from '@assets/trashcan.svg'; | import { ReactComponent as Trashcan } from '@assets/trashcan.svg'; | ||||
import { ReactComponent as Edit } from '@assets/edit.svg'; | import { ReactComponent as Edit } from '@assets/edit.svg'; | ||||
import { Event } from '@utils/GoogleAnalytics'; | import { Event } from '@utils/GoogleAnalytics'; | ||||
import ApiError from '@components/Common/ApiError'; | import ApiError from '@components/Common/ApiError'; | ||||
import { formatSavedBalance } from '@utils/formatting'; | import { formatSavedBalance } from '@utils/formatting'; | ||||
import PropTypes from 'prop-types'; | |||||
const { Panel } = Collapse; | const { Panel } = Collapse; | ||||
const SettingsLink = styled.a` | const SettingsLink = styled.a` | ||||
text-decoration: underline; | text-decoration: underline; | ||||
color: ${props => props.theme.primary}; | color: ${props => props.theme.primary}; | ||||
:visited { | :visited { | ||||
text-decoration: underline; | text-decoration: underline; | ||||
▲ Show 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | .ant-switch { | ||||
color: ${props => props.theme.generalSettings.background}; | color: ${props => props.theme.generalSettings.background}; | ||||
} | } | ||||
} | } | ||||
.ant-switch-checked { | .ant-switch-checked { | ||||
background-color: ${props => props.theme.primary}; | background-color: ${props => props.theme.primary}; | ||||
} | } | ||||
`; | `; | ||||
const Configure = () => { | const Configure = ({ toggleTheme, theme }) => { | ||||
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 { | const { | ||||
addNewSavedWallet, | addNewSavedWallet, | ||||
activateWallet, | activateWallet, | ||||
renameWallet, | renameWallet, | ||||
▲ Show 20 Lines • Show All 480 Lines • ▼ Show 20 Lines | return ( | ||||
// checked={false} | // checked={false} | ||||
onChange={handleAppLockToggle} | onChange={handleAppLockToggle} | ||||
/> | /> | ||||
) : ( | ) : ( | ||||
<Tag color="warning" icon={<ExclamationCircleFilled />}> | <Tag color="warning" icon={<ExclamationCircleFilled />}> | ||||
Not Supported | Not Supported | ||||
</Tag> | </Tag> | ||||
)} | )} | ||||
Theme: | |||||
<Switch | |||||
checkedChildren="light" | |||||
unCheckedChildren="dark" | |||||
defaultChecked={theme === 'light' ? true : false} | |||||
style={{ backgroundColor: 'darkblue', color: 'white' }} | |||||
onClick={toggleTheme} | |||||
/> | |||||
</GeneralSettingsItem> | </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> | ||||
); | ); | ||||
}; | }; | ||||
Configure.propTypes = { | |||||
toggleTheme: PropTypes.func, | |||||
theme: PropTypes.string, | |||||
}; | |||||
export default Configure; | export default Configure; |