forked from nervosnetwork/ckb-explorer-frontend
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: Remove useAppState and the global state it contains, implem…
…ent in other ways (#103) * refactor: remove statistics and app.tipBlockNumber from AppState * refactor: remove primaryColor, secondaryColor, and chartColor from State.App * refactor: remove language from State.App * refactor: remove toast from State.App * refactor: remove app from AppState * refactor: remove maintenanceAlertVisible from State.Components * refactor: remove headerSearchBarVisible from State.Components * refactor: remove the last global state mobileMenuVisible * feat: remove MaintenanceMsg in the Alert component * feat: stop using the reorgStartedAt property
- Loading branch information
1 parent
b0d73bb
commit 8d19adc
Showing
83 changed files
with
426 additions
and
1,032 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,18 +1,12 @@ | ||
import { ReactNode } from 'react' | ||
import styled from 'styled-components' | ||
import { useAppState } from '../../contexts/providers' | ||
import MobileMenu from '../Header/MobileMenu' | ||
|
||
const ContentPanel = styled.div` | ||
width: 100%; | ||
overflow-x: hidden; | ||
flex: 1; | ||
margin-top: var(--navbar-height); | ||
background: #ededed; | ||
` | ||
export default ({ children, style }: { children: ReactNode; style?: any }) => { | ||
const { | ||
components: { mobileMenuVisible }, | ||
} = useAppState() | ||
return <ContentPanel style={style}>{mobileMenuVisible ? <MobileMenu /> : children}</ContentPanel> | ||
return <ContentPanel style={style}>{children}</ContentPanel> | ||
} |
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.