forked from humanprotocol/human-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(human-app): footer and navbar width and padding adjustments #6
Merged
rozekmichal
merged 12 commits into
fix/layout-improvments
from
fix/human-app-improvements-18-09-2024
Sep 23, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8c4aacd
fix(human-app): footer and navbar width and padding adjustments
rozekmichal 0490ed1
fix(human-app): homepage cancel button position adjusted
rozekmichal 69ebeff
fix(human-app): max width for inputs specified
rozekmichal 1ce841a
feat(human-app): home page state moved to context and reused in every…
rozekmichal 584d9fd
fix(human-app): page card max width adjusted
rozekmichal 6cd0a8f
fix(human-app): styles for some pages to adjust the align
rozekmichal 15ac9de
fix(human-app): styles for page card to fulfill expectations for mobi…
rozekmichal 47a8471
feat(human-app): captcha order changed in form
rozekmichal 41f0e1a
chore(human-app): active styles for menu item link
rozekmichal c9f03af
feat(human-app): captcha order changed in sign up and sign in forms
rozekmichal 3c97187
feat(human-app): active styles for menu item link
rozekmichal c2ea9c6
fix(human-app): improvements after review
rozekmichal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
45 changes: 45 additions & 0 deletions
45
packages/apps/human-app/frontend/src/contexts/homepage-state.tsx
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,45 @@ | ||
import React, { createContext, useState, useContext } from 'react'; | ||
import { useLocation } from 'react-router-dom'; | ||
import { routerPaths } from '@/router/router-paths'; | ||
|
||
export type HomePageStateType = 'welcome' | 'chooseSignUpAccountType'; | ||
|
||
interface HomePageStageContextProps { | ||
pageView: HomePageStateType; | ||
setPageView: (step: HomePageStateType) => void; | ||
isMainPage: boolean; | ||
} | ||
|
||
export const HomePageStateContext = | ||
createContext<HomePageStageContextProps | null>(null); | ||
|
||
export function HomePageStateProvider({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
const [pageView, setPageView] = useState<HomePageStateType>('welcome'); | ||
|
||
const location = useLocation(); | ||
const isMainPage = | ||
location.pathname === routerPaths.homePage && pageView === 'welcome'; | ||
|
||
return ( | ||
<HomePageStateContext.Provider | ||
value={{ pageView, setPageView, isMainPage }} | ||
> | ||
{children} | ||
</HomePageStateContext.Provider> | ||
); | ||
} | ||
|
||
// eslint-disable-next-line react-refresh/only-export-components | ||
export const useHomePageState = () => { | ||
const context = useContext(HomePageStateContext); | ||
if (!context) { | ||
throw new Error( | ||
'useHomePageState must be used within a HomePageStageProvider' | ||
); | ||
} | ||
return context; | ||
}; |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that
ListItemButton
hasselected
props, use itThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done