Skip to content
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

dApp: Sidebar component removal #913

Merged
merged 6 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions dapp/src/DApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { AcreSdkProvider } from "./acre-react/contexts"
import GlobalStyles from "./components/GlobalStyles"
import {
DocsDrawerContextProvider,
SidebarContextProvider,
WalletConnectionAlertContextProvider,
} from "./contexts"
import { useInitApp } from "./hooks"
Expand Down Expand Up @@ -67,15 +66,13 @@ function DAppProviders() {
<QueryClientProvider client={queryClient}>
<AcreSdkProvider>
<DocsDrawerContextProvider>
<SidebarContextProvider>
<WalletConnectionAlertContextProvider>
<ReduxProvider store={store}>
<PostHogProvider>
<DApp />
</PostHogProvider>
</ReduxProvider>
</WalletConnectionAlertContextProvider>
</SidebarContextProvider>
<WalletConnectionAlertContextProvider>
<ReduxProvider store={store}>
<PostHogProvider>
<DApp />
</PostHogProvider>
</ReduxProvider>
</WalletConnectionAlertContextProvider>
</DocsDrawerContextProvider>
</AcreSdkProvider>
</QueryClientProvider>
Expand Down
2 changes: 0 additions & 2 deletions dapp/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { usePostHogPageViewCapture } from "#/hooks/posthog"
import DocsDrawer from "./DocsDrawer"
import Header from "./Header"
import ModalRoot from "./ModalRoot"
import Sidebar from "./Sidebar"
import MobileModeBanner from "./MobileModeBanner"
import Footer from "./Footer"

Expand Down Expand Up @@ -51,7 +50,6 @@ function Layout() {
>
<Outlet />

<Sidebar />
<DocsDrawer />
<ModalRoot />
</Flex>
Expand Down
11 changes: 2 additions & 9 deletions dapp/src/components/ModalRoot/withBaseModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ComponentType, useCallback } from "react"
import { Modal, ModalContent, ModalOverlay, ModalProps } from "@chakra-ui/react"
import { BaseModalProps } from "#/types"
import { useAppNavigate, useSidebar } from "#/hooks"
import { useAppNavigate } from "#/hooks"

const MODAL_BASE_SIZE = "lg"

Expand All @@ -12,7 +12,6 @@ function withBaseModal<T extends BaseModalProps>(
return function ModalBase(props: T) {
const { closeModal, closeOnEsc, navigateToOnClose } = props

const { isOpen: isSidebarOpen } = useSidebar()
const navigate = useAppNavigate()

const handleCloseModal = useCallback(() => {
Expand All @@ -33,13 +32,7 @@ function withBaseModal<T extends BaseModalProps>(
{...modalProps}
>
<ModalOverlay zIndex="modalOverlay" />
<ModalContent
zIndex="modalContent"
mr={{
base: isSidebarOpen ? "var(--chakra-sizes-sidebar_width)" : 0,
xl: 0,
}}
>
<ModalContent>
<WrappedModalContent {...props} closeModal={handleCloseModal} />
</ModalContent>
</Modal>
Expand Down
70 changes: 0 additions & 70 deletions dapp/src/components/Sidebar.tsx

This file was deleted.

49 changes: 0 additions & 49 deletions dapp/src/contexts/SidebarContext.tsx

This file was deleted.

1 change: 0 additions & 1 deletion dapp/src/contexts/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from "./DocsDrawerContext"
export * from "./SidebarContext"
export * from "./StakeFlowContext"
export * from "./PaginationContext"
export * from "./WalletConnectionAlertContext"
2 changes: 0 additions & 2 deletions dapp/src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export * from "./store"
export * from "./sdk"
export * from "./orangeKit"
export * from "./useDetectThemeMode"
export * from "./useSidebar"
export * from "./useDocsDrawer"
export * from "./useTransactionDetails"
export * from "./useStakeFlowContext"
Expand Down Expand Up @@ -34,7 +33,6 @@ export { default as useTriggerConnectWalletModal } from "./useTriggerConnectWall
export { default as useLastUsedBtcAddress } from "./useLastUsedBtcAddress"
export { default as useAcrePoints } from "./useAcrePoints"
export { default as useSignMessageAndCreateSession } from "./useSignMessageAndCreateSession"
export { default as useScrollbarVisibility } from "./useScrollbarVisibility"
export { default as useAccessCode } from "./useAccessCode"
export { default as useFormField } from "./useFormField"
export { default as useDepositBTCTransaction } from "./useDepositBTCTransaction"
Expand Down
32 changes: 0 additions & 32 deletions dapp/src/hooks/useScrollbarVisibility.ts

This file was deleted.

12 changes: 0 additions & 12 deletions dapp/src/hooks/useSidebar.ts

This file was deleted.

38 changes: 0 additions & 38 deletions dapp/src/theme/Sidebar.ts

This file was deleted.

2 changes: 0 additions & 2 deletions dapp/src/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { modalTheme } from "./Modal"
import { cardTheme } from "./Card"
import { tooltipTheme } from "./Tooltip"
import { headingTheme } from "./Heading"
import { sidebarTheme } from "./Sidebar"
import { currencyBalanceTheme } from "./CurrencyBalance"
import { tokenBalanceInputTheme } from "./TokenBalanceInput"
import { inputTheme } from "./Input"
Expand Down Expand Up @@ -61,7 +60,6 @@ const defaultTheme = {
Input: inputTheme,
Link: linkTheme,
Modal: modalTheme,
Sidebar: sidebarTheme,
Spinner: spinnerTheme,
Tag: tagTheme,
TokenBalanceInput: tokenBalanceInputTheme,
Expand Down
3 changes: 0 additions & 3 deletions dapp/src/theme/utils/semanticTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ export const semanticTokens = {
modal_shift: "9.75rem", // 156px
dashboard_card_padding: 5,
},
sizes: {
sidebar_width: 80,
},
}
2 changes: 0 additions & 2 deletions dapp/src/theme/utils/zIndices.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
export const zIndices = {
sidebar: 1450,
drawer: 1470,
mobileBanner: 1500,
header: 1400,
footer: 1380,
modalContent: 1410,
modalOverlay: 1390,
}
Loading