-
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 (#203)
## 🐛 Issue <!-- Link to the issue in Github or Basecamp this PR is addressing. If there is no related issue or related pull request, consider briefly describing the problem or enhancement being addressed. --> You can't login on micro service. We will need login for user commenting. ## ✏️ Solution <!-- Describe your changes, and why you're making them. If there's something novel or complex about your approach, you can call it out here. --> Add an AppHeader and Profile button. ## 🔬 To Test <!-- With only the context in this description, how would a developer from outside Apollos setup and validate your change? --> 1. `cd micro-service && yarn dev` 2. navigate to a content item (or don't - this shows on the error home page) ## 📸 Screenshots <div class='graphite__hidden'> <div>🎥 Video uploaded on Graphite:</div> <a href="https://app.graphite.dev/media/video/Iqv8SYVwCDX0dUbjBiDz/1cccf6b1-d5b4-4465-aafe-9a46bf185006.mp4"> <img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/Iqv8SYVwCDX0dUbjBiDz/1cccf6b1-d5b4-4465-aafe-9a46bf185006.mp4"> </a> </div> <video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/Iqv8SYVwCDX0dUbjBiDz/1cccf6b1-d5b4-4465-aafe-9a46bf185006.mp4">login.mp4</video> <!-- | Before | After | | --- | --- | | _attach image_ | _attach image_ | | _attach image_ | _attach image_ | -->
- Loading branch information
1 parent
101467f
commit e806697
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