@@ -117,10 +117,6 @@ const useStyles = (themeId: number) => {
117117 sidebarIcon : sidebarIconStyle ,
118118 folderButton : folderButtonStyle ,
119119 folderButtonText : folderButtonTextStyle ,
120- conflictFolderButtonText : {
121- ...folderButtonTextStyle ,
122- color : theme . colorError ,
123- } ,
124120 folderButtonSelected : {
125121 ...folderButtonStyle ,
126122 backgroundColor : theme . selectedColor ,
@@ -197,6 +193,12 @@ const FolderItem: React.FC<FolderItemProps> = props => {
197193 paddingRight : 10 ,
198194 backgroundColor : props . selected ? theme . selectedColor : undefined ,
199195 } ,
196+ conflictFolderButtonText : {
197+ color : theme . colorError ,
198+ } ,
199+ conflictFolderButtonSelectedText : {
200+ color : theme . colorErrorSelected ,
201+ } ,
200202 } ) ;
201203 } , [ props . selected , props . depth , props . themeId ] ) ;
202204 const baseStyles = props . styles ;
@@ -268,7 +270,18 @@ const FolderItem: React.FC<FolderItemProps> = props => {
268270 // depth is specified with an accessibilityLabel:
269271 const folderDepthDescription = props . depth > 0 ? _ ( '(level %d)' , props . depth ) : '' ;
270272 const accessibilityLabel = `${ folderTitle } ${ folderDepthDescription } ` . trim ( ) ;
271- const folderButtonTextStyle = props . folder . id === Folder . conflictFolderId ( ) ? baseStyles . conflictFolderButtonText : baseStyles . folderButtonText ;
273+ const isConflictFolder = props . folder . id === Folder . conflictFolderId ( ) ;
274+ const textStyle = useMemo ( ( ) => {
275+ const result : TextStyle [ ] = [ baseStyles . folderButtonText ] ;
276+ if ( isConflictFolder ) {
277+ result . push ( styles . conflictFolderButtonText ) ;
278+ if ( props . selected ) {
279+ result . push ( styles . conflictFolderButtonSelectedText ) ;
280+ }
281+ }
282+ return result ;
283+ } , [ styles , props . selected , isConflictFolder , baseStyles . folderButtonText ] ) ;
284+
272285 return (
273286 < View key = { props . folder . id } style = { styles . buttonWrapper } >
274287 < TouchableRipple
@@ -284,7 +297,7 @@ const FolderItem: React.FC<FolderItemProps> = props => {
284297 { renderFolderIcon ( props . folder . id , folderIcon ) }
285298 < Text
286299 numberOfLines = { 1 }
287- style = { folderButtonTextStyle }
300+ style = { textStyle }
288301 accessibilityLabel = { accessibilityLabel }
289302 >
290303 { folderTitle }
0 commit comments