import { EthAddress } from "@joincivil/typescript-types" ; import { StateWithNewsroom } from "./reducers" ; import { uiActions } from "./actionCreators" ; import { CmsUserData , UserData } from "./types" ; export const getUserObject = ( state , address ) : UserData => { const userData = state . newsroomUi . get ( uiActions . GET_CMS_USER_DATA_FOR_ADDRESS ) && state . newsroomUsers . get ( address ) ; return makeUserObject ( address , userData ) ; } ; export const makeUserObject = ( address , userData ? ) : UserData => { return { rosterData : { ethAddress : address , name : userData && userData . displayName , avatarUrl : userData && userData . avatarUrl , bio : userData && userData . bio , } , isCmsUser : ! ! userData , username : userData && userData . username , } ; } ;