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

Removed Commented-Out Code #3

Merged
merged 1 commit into from
Sep 30, 2019
Merged
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
67 changes: 0 additions & 67 deletions src/components/identity/AddIdentity.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import React from 'react'
import { Clipboard, TouchableOpacity } from 'react-native'

//import GDStore from '../../lib/undux/GDStore'
import { SaveButton, Section, Text, Wrapper } from '../common'
import InputRounded from '../common/form/InputRounded'
import { useScreenState } from '../appNavigation/stackNavigation'
Expand All @@ -11,78 +10,12 @@ import { withStyles } from '../../lib/styles'
const TITLE = 'Add Identity'

const AddIdentity = ({ screenProps, theme, styles }) => {
//initialize identity value for first time from storedidentity
// useEffect(() => {
// setIdentity(storeIdentity)
// }, [isEqual(identity, {}) && storedIdentity])

// const updateIdentity = async () => {
// store.set('identity')(identity)
// }

// useEffect(() => {
// if (isEqual(storedIdentity, {})) {
// updateIdentity()
// }
// }, [])

// const validate = useCallback(
// debounce(async (identity, storedIdentity, setIsPristine, setErrors, setIsValid) => {
// if (identity && identity.validate) {
// try {
// const pristine = isEqualWith(storedIdentity, identity, (x, y) => {
// if (typeof x === 'function') {
// return true
// }
// if (['string', 'number'].includes(typeof x)) {
// return y && x.toString() === y.toString()
// }
// return undefined
// })
// const { isValid, errors } = identity.validate()

// const { isValid: isValidIndex, errors: errorsIndex } = await userStorage.validateIdentity(
// filterObject(identity)
// )
// const valid = isValid && isValidIndex

// setErrors(merge(errors, errorsIndex))
// setIsValid(valid)
// setIsPristine(pristine)

// return valid
// } catch (e) {
// log.error('validate identity failed', e, e.message)
// showErrorDialog('Unexpected error while validating identity', e)
// return false
// }
// }
// return false
// }, 500),
// []
// )

//const store = GDStore.useStore()

//const identity = store.get('identity')
const [screenState] = useScreenState(screenProps)

const { name } = screenState
const verifyText = 'I am verifying my GoodDollar identity.'

// const handleIdentityChange = newUsername => {
// identity[name] = { username: newUsername }
// }

// const handleSaveButton = () => {
// store.set('identity')(identity)
// return identity[name].username
// }

// const onIdentitySaved = () => {
// screenProps.pop()
// return identity[name].username
// }
return (
<Wrapper>
<Section grow style={styles.section}>
Expand Down
4 changes: 0 additions & 4 deletions src/components/identity/AddIdentityMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import { displayNames } from './identities'

const TITLE = 'Add Identity'

// function filterObject(obj) {
// return pickBy(obj, (v, k) => v !== undefined && v !== '')
// }

const arrayDiff = (a, b) => {
return a.filter(x => !b.includes(x))
}
Expand Down
5 changes: 0 additions & 5 deletions src/components/identity/GenericSocial.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
import React from 'react'
import { Clipboard, TouchableOpacity } from 'react-native'

//import GDStore from '../../lib/undux/GDStore'
import { SaveButton, Section, Text, Wrapper } from '../common'
import InputRounded from '../common/form/InputRounded'

// import InputText from '../common/form/InputText'
import { useScreenState } from '../appNavigation/stackNavigation'
import { withStyles } from '../../lib/styles'
import { displayNames, postNames } from './identities'

import ShareButton from './ShareButton'
GenericSocial

const TITLE = 'Add Identity'

Expand Down
3 changes: 3 additions & 0 deletions src/components/identity/ShareButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ class ShareButton extends Component {

if (result.action === Share.sharedAction) {
if (result.activityType) {
// TODO:
// shared with activity type of result.activityType
} else {
// TODO:
// shared
// NOTHING
}
} else if (result.action === Share.dismissedAction) {
// TODO:
// dismissed
}
} catch (error) {
Expand Down
2 changes: 0 additions & 2 deletions src/components/profile/EditProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import React, { useCallback, useEffect, useState } from 'react'
import debounce from 'lodash/debounce'
import isEqualWith from 'lodash/isEqualWith'
import isEqual from 'lodash/isEqual'

import merge from 'lodash/merge'
import pickBy from 'lodash/pickBy'

//import IdentityDataTable from '../identity/IdentityDataTable'
import userStorage from '../../lib/gundb/UserStorage'
import logger from '../../lib/logger/pino-logger'
import GDStore from '../../lib/undux/GDStore'
Expand Down