11import  React ,  {  useState ,  useEffect ,  memo ,  useMemo  }  from  'react' ; 
22import  styled  from  'styled-components' ; 
33import  {  FontAwesomeIcon  }  from  '@fortawesome/react-fontawesome' ; 
4- import  {  faPlus  }  from  '@fortawesome/free-solid-svg-icons' ; 
4+ import  {  faImages ,   faPlus  }  from  '@fortawesome/free-solid-svg-icons' ; 
55import  {  Button  }  from  'antd' ; 
66import  {  useSelector ,  useDispatch  }  from  'react-redux' ; 
77import  {  ipcRenderer  }  from  'electron' ; 
@@ -21,14 +21,20 @@ import { updateLastUpdateVersion } from '../../../common/reducers/actions';
2121import  {  _getInstances ,  _getInstancesPath ,  _getTempPath  }  from  '../../../common/utils/selectors' ; 
2222
2323import  {  useDebouncedCallback  }  from  'use-debounce' ; 
24- import  {  ACCOUNT_MICROSOFT  }  from  '../../../common/utils/constants' ; 
24+ import  {  ACCOUNT_ELYBY ,   ACCOUNT_MICROSOFT ,   ACCOUNT_OFFLINE ,   ACCOUNT_OXAUTH  }  from  '../../../common/utils/constants' ; 
2525
2626const  AddInstanceIcon  =  styled ( Button ) ` 
2727  position: fixed; 
2828  bottom: 20px; 
2929  left: 20px; 
3030` ; 
3131
32+ const  ShowScreenshotsIcon  =  styled ( Button ) ` 
33+   position: fixed; 
34+   bottom: 20px; 
35+   left: 80px; 
36+ ` ; 
37+ 
3238const  AccountContainer  =  styled ( Button ) ` 
3339  position: fixed; 
3440  bottom: 20px; 
@@ -55,6 +61,8 @@ const Home = () => {
5561  const  [ annoucement ,  setAnnoucement ]  =  useState ( null ) ; 
5662
5763  useEffect ( ( )  =>  { 
64+     const  discordRPCDetails  =  `На главной` ; 
65+     ipcRenderer . invoke ( 'update-discord-rpc' ,  discordRPCDetails ) ; 
5866    const  init  =  async  ( )  =>  { 
5967		// setInstalling(false); 
6068		// setInitinstall(false); 
@@ -79,23 +87,6 @@ const Home = () => {
7987  useEffect ( ( )  =>  { 
8088    extractFace ( account . skin ) . then ( setProfileImage ) . catch ( console . error ) ; 
8189  } ,  [ account ] ) ; 
82-   
83-   const  getInstances  =  ( instances ,  sortOrder )  =>  { 
84-   // Data normalization for missing fields 
85-   const  inst  =  instances . map ( instance  =>  { 
86-     return  { 
87-       ...instance , 
88-       timePlayed : instance . timePlayed  ||  0 , 
89-       lastPlayed : instance . lastPlayed  ||  0 
90-     } ; 
91-   } ) ; 
92- 
93-   switch  ( sortOrder )  { 
94-     default :
95-       return  inst ; 
96-   } 
97-   } ; 
98- 
9990
10091  return  ( 
10192    < div > 
@@ -112,16 +103,26 @@ const Home = () => {
112103          { annoucement } 
113104        </ div > 
114105      )  : null } 
115-       < Instances   
116-       css = { ` 
117-         bottom: 20px; 
118-         left: 20px;` 
119-       } /> 
106+       < Instances 
107+          css = { ` 
108+            bottom: 20px; 
109+            left: 20px;` 
110+          } /> 
120111      < AddInstanceIcon  type = "primary"  onClick = { ( )  =>  openAddInstanceModal ( 0 ) } > 
121112        < FontAwesomeIcon  icon = { faPlus }  /> 
122113      </ AddInstanceIcon > 
123-       < AccountContainer  type = "primary"  onClick = { openAccountModal } > 
124-         { profileImage  &&  account . accountType  ===  ACCOUNT_MICROSOFT  ? ( 
114+       < ShowScreenshotsIcon  type = "primary"  onClick = { ( )  =>  dispatch ( openModal ( 'ScreenshotManager' ) ) } > 
115+         < FontAwesomeIcon  icon = { faImages }  /> 
116+       </ ShowScreenshotsIcon > 
117+       < AccountContainer 
118+         type = "primary" 
119+         onClick = { openAccountModal } 
120+         css = { ` 
121+           background-color: ${ account . accountType  ==  ACCOUNT_OFFLINE  ? ( `#545454` )  : account . accountType  ==  ACCOUNT_OXAUTH  ? ( `#3c6a5b` )  : account . accountType  ==  ACCOUNT_ELYBY  ? ( `#187c41` )  : ( `#830d0d` ) }  ; 
122+           border-color: ${ account . accountType  ==  ACCOUNT_OFFLINE  ? ( `#545454` )  : account . accountType  ==  ACCOUNT_OXAUTH  ? ( `#3c6a5b` )  : account . accountType  ==  ACCOUNT_ELYBY  ? ( `#187c41` )  : ( `#830d0d` ) }  ; 
123+         ` } 
124+       > 
125+         { profileImage  &&  account . accountType  !==  ACCOUNT_OFFLINE  ? ( 
125126          < img 
126127            src = { `data:image/jpeg;base64,${ profileImage }  ` } 
127128            css = { ` 
0 commit comments