-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AppHeader and Login to MicroService
- Loading branch information
1 parent
101467f
commit f3fa8e3
Showing
7 changed files
with
109 additions
and
50 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,46 @@ | ||
import Wordmark from '../Wordmark'; | ||
import { useCurrentChurch } from '../../hooks'; | ||
import { Box, Avatar } from '../../ui-kit'; | ||
import { User } from '@phosphor-icons/react'; | ||
|
||
import SearchStyles from '../Searchbar/Search.styles'; | ||
|
||
import ProfileButton from '../Profile/ProfileButton'; | ||
|
||
function ChurchLogo(props) { | ||
const { currentChurch } = useCurrentChurch(); | ||
|
||
return <Wordmark source={currentChurch?.wordmarkLightUrl} padding={10} {...props} />; | ||
} | ||
|
||
const AppHeader = () => ( | ||
<> | ||
<Box | ||
py={8} | ||
px={16} | ||
height={58} | ||
alignItems="center" | ||
backgroundColor="fill.paper" | ||
borderBottom="1px solid" | ||
borderColor="text.quaternary" | ||
position="fixed" | ||
display="flex" | ||
flexDirection="row" | ||
justifyContent="space-between" | ||
boxShadow="small" | ||
top={0} | ||
left={0} | ||
right={0} | ||
zIndex={999} | ||
> | ||
<Box> | ||
<ChurchLogo size="30px" /> | ||
</Box> | ||
|
||
<ProfileButton /> | ||
</Box> | ||
<Box height={58} /> | ||
</> | ||
); | ||
|
||
export default AppHeader; |
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,3 @@ | ||
import AppHeader from './AppHeader'; | ||
|
||
export default AppHeader; |
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
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,40 @@ | ||
import { Box, Avatar } from '../../ui-kit'; | ||
import { User } from '@phosphor-icons/react'; | ||
import { useCurrentUser } from '../../hooks'; | ||
import { useState } from 'react'; | ||
import Profile from './Profile'; | ||
|
||
const ProfileButton = (props) => { | ||
const [showProfile, setShowProfile] = useState(false); | ||
const { currentUser } = useCurrentUser(); | ||
|
||
const handleOpenProfile = () => { | ||
setShowProfile(true); | ||
}; | ||
|
||
return ( | ||
<Box position="relative"> | ||
<Box onClick={handleOpenProfile} cursor="pointer"> | ||
{currentUser?.profile?.photo?.uri ? ( | ||
<Avatar src={currentUser?.profile?.photo?.uri} width={30} alt="avatar" /> | ||
) : ( | ||
<Box | ||
borderRadius="100%" | ||
backgroundColor="fill.system" | ||
height={30} | ||
width={30} | ||
alignItems="center" | ||
justifyContent="center" | ||
display="flex" | ||
color="text.secondary" | ||
> | ||
<User size={16} weight="bold" /> | ||
</Box> | ||
)} | ||
</Box> | ||
{showProfile ? <Profile handleCloseProfile={() => setShowProfile(false)} /> : null} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default ProfileButton; |
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