Skip to content

Commit

Permalink
Remove Sidebar component
Browse files Browse the repository at this point in the history
  • Loading branch information
kpyszkowski committed Dec 3, 2024
1 parent 1bfe0fc commit f90c9a5
Show file tree
Hide file tree
Showing 13 changed files with 7 additions and 244 deletions.
1 change: 0 additions & 1 deletion dapp/.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ VITE_GELATO_RELAY_API_KEY="htaJCy_XHj8WsE3w53WBMurfySDtjLP_TrNPPa6IPIc_" # this
VITE_SUBGRAPH_API_KEY=""

# Feature flags
VITE_FEATURE_FLAG_GAMIFICATION_ENABLED="false"
VITE_FEATURE_FLAG_WITHDRAWALS_ENABLED="false"
VITE_FEATURE_FLAG_OKX_WALLET_ENABLED="false"
VITE_FEATURE_FLAG_XVERSE_WALLET_ENABLED="false"
Expand Down
13 changes: 5 additions & 8 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 @@ -66,13 +65,11 @@ function DAppProviders() {
<QueryClientProvider client={queryClient}>
<AcreSdkProvider>
<DocsDrawerContextProvider>
<SidebarContextProvider>
<WalletConnectionAlertContextProvider>
<ReduxProvider store={store}>
<DApp />
</ReduxProvider>
</WalletConnectionAlertContextProvider>
</SidebarContextProvider>
<WalletConnectionAlertContextProvider>
<ReduxProvider store={store}>
<DApp />
</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 @@ -6,7 +6,6 @@ import { DappMode } from "#/types"
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 @@ -46,7 +45,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 zIndex="modalContent">
<WrappedModalContent {...props} closeModal={handleCloseModal} />
</ModalContent>
</Modal>
Expand Down
117 changes: 0 additions & 117 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"
1 change: 0 additions & 1 deletion 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
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,
},
}
1 change: 0 additions & 1 deletion dapp/src/theme/utils/zIndices.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export const zIndices = {
sidebar: 1450,
drawer: 1470,
mobileBanner: 1500,
header: 1400,
Expand Down

0 comments on commit f90c9a5

Please sign in to comment.