-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9021 from metehanozyurt/issue-8842
fixed: Web - Desktop Attachments - Cannot attach a photo when the NEW ( green plus) button is pressed
- Loading branch information
Showing
4 changed files
with
148 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React from 'react'; | ||
import {withNavigation} from '@react-navigation/compat'; | ||
import {withOnyx} from 'react-native-onyx'; | ||
import compose from '../../../../libs/compose'; | ||
import withWindowDimensions from '../../../../components/withWindowDimensions'; | ||
import withLocalize from '../../../../components/withLocalize'; | ||
import ONYXKEYS from '../../../../ONYXKEYS'; | ||
import {sidebarPropTypes, sidebarDefaultProps} from './sidebarPropTypes'; | ||
import BaseSidebarScreen from './BaseSidebarScreen'; | ||
|
||
const SidebarScreen = (props) => { | ||
let baseSidebarScreen = null; | ||
|
||
/** | ||
* Method create event listener | ||
*/ | ||
const createDragoverListener = () => { | ||
document.addEventListener('dragover', baseSidebarScreen.hideCreateMenu); | ||
}; | ||
|
||
/** | ||
* Method remove event listener. | ||
*/ | ||
const removeDragoverListener = () => { | ||
document.removeEventListener('dragover', baseSidebarScreen.hideCreateMenu); | ||
}; | ||
return ( | ||
<BaseSidebarScreen | ||
ref={el => baseSidebarScreen = el} | ||
onShowCreateMenu={createDragoverListener} | ||
onHideCreateMenu={removeDragoverListener} | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
/> | ||
); | ||
}; | ||
|
||
SidebarScreen.propTypes = sidebarPropTypes; | ||
SidebarScreen.defaultProps = sidebarDefaultProps; | ||
SidebarScreen.displayName = 'SidebarScreen'; | ||
|
||
export default compose( | ||
withNavigation, | ||
withLocalize, | ||
withWindowDimensions, | ||
withOnyx({ | ||
allPolicies: { | ||
key: ONYXKEYS.COLLECTION.POLICY, | ||
}, | ||
betas: { | ||
key: ONYXKEYS.BETAS, | ||
}, | ||
isCreatingWorkspace: { | ||
key: ONYXKEYS.IS_CREATING_WORKSPACE, | ||
}, | ||
}), | ||
)(SidebarScreen); |
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,33 @@ | ||
import React from 'react'; | ||
import {withNavigation} from '@react-navigation/compat'; | ||
import {withOnyx} from 'react-native-onyx'; | ||
import compose from '../../../../libs/compose'; | ||
import withWindowDimensions from '../../../../components/withWindowDimensions'; | ||
import withLocalize from '../../../../components/withLocalize'; | ||
import ONYXKEYS from '../../../../ONYXKEYS'; | ||
import {sidebarPropTypes, sidebarDefaultProps} from './sidebarPropTypes'; | ||
import BaseSidebarScreen from './BaseSidebarScreen'; | ||
|
||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
const SidebarScreen = props => <BaseSidebarScreen {...props} />; | ||
|
||
SidebarScreen.propTypes = sidebarPropTypes; | ||
SidebarScreen.defaultProps = sidebarDefaultProps; | ||
SidebarScreen.displayName = 'SidebarScreen'; | ||
|
||
export default compose( | ||
withNavigation, | ||
withLocalize, | ||
withWindowDimensions, | ||
withOnyx({ | ||
allPolicies: { | ||
key: ONYXKEYS.COLLECTION.POLICY, | ||
}, | ||
betas: { | ||
key: ONYXKEYS.BETAS, | ||
}, | ||
isCreatingWorkspace: { | ||
key: ONYXKEYS.IS_CREATING_WORKSPACE, | ||
}, | ||
}), | ||
)(SidebarScreen); |
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,28 @@ | ||
import PropTypes from 'prop-types'; | ||
import {windowDimensionsPropTypes} from '../../../../components/withWindowDimensions'; | ||
import {withLocalizePropTypes} from '../../../../components/withLocalize'; | ||
|
||
const sidebarPropTypes = { | ||
|
||
/** The list of policies the user has access to. */ | ||
allPolicies: PropTypes.shape({ | ||
/** The policy name */ | ||
name: PropTypes.string, | ||
}).isRequired, | ||
|
||
/* Beta features list */ | ||
betas: PropTypes.arrayOf(PropTypes.string).isRequired, | ||
|
||
/* Is workspace is being created by the user? */ | ||
isCreatingWorkspace: PropTypes.bool, | ||
|
||
...windowDimensionsPropTypes, | ||
|
||
...withLocalizePropTypes, | ||
}; | ||
|
||
const sidebarDefaultProps = { | ||
isCreatingWorkspace: false, | ||
}; | ||
|
||
export {sidebarPropTypes, sidebarDefaultProps}; |