Skip to content

Commit

Permalink
Merge branch 'v2' into posthog-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulMcInnis committed Dec 12, 2024
2 parents 385c855 + 7f09cee commit b293d32
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
url = https://github.com/berachain/berancer-sdk.git
[submodule "secrets"]
path = secrets
url = https://github.com/berachain/internal-dapps-env.git
url = git@github.com:berachain/internal-dapps-env.git
7 changes: 6 additions & 1 deletion apps/hub/src/app/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ export default function Providers({ children }: PropsWithChildren<any>) {
<BeraWagmi>
<BeraJsProvider configOverride={undefined}>
<BlockTimeProvider>
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem>
<ThemeProvider
attribute="class"
defaultTheme="dark"
forcedTheme="dark"
themes={["dark"]}
>
{children}
</ThemeProvider>
</BlockTimeProvider>
Expand Down
2 changes: 1 addition & 1 deletion apps/hub/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function RootLayout(props: { children: React.ReactNode }) {
<Toaster position="bottom-right" />
</div>
<div className="z-10 flex-1">
<Header navItems={navItems} appName={hubName} />
<Header navItems={navItems} appName={hubName} hideTheme />
<MainWithBanners
// mt-8 should probably be removed
className="mt-8"
Expand Down
2 changes: 1 addition & 1 deletion apps/hub/src/components/hero-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const HeroCards: React.FC = () => {
width={2100}
height={100}
/>
<div className="z-1 grid w-full auto-rows-[330px] grid-cols-1 justify-around gap-6 md:grid-cols-2 lg:grid-cols-4">
<div className="z-1 grid w-full auto-rows-[330px] grid-cols-1 justify-around gap-6 md:grid-cols-2 xl:grid-cols-4">
{cards.map((card, index) => (
<HeroCard key={index} {...card} />
))}
Expand Down
8 changes: 7 additions & 1 deletion packages/shared-ui/src/connect-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ export const ConnectButton = ({
isNavItem = false,
isHoney = false,
isPopover = true,
disableThemeToggle = false,
}: {
className?: string;
isNavItem?: boolean;
isHoney?: boolean;
isPopover?: boolean;
disableThemeToggle?: boolean;
}) => {
const { isConnected, isWrongNetwork, isReady } = useBeraJs();
return (
Expand All @@ -58,7 +60,11 @@ export const ConnectButton = ({
<SwitchNetworkBtn className={className} />
)}
{isReady && (
<ConnectedWalletPopover isPopover={isPopover} isHoney={isHoney} />
<ConnectedWalletPopover
isPopover={isPopover}
isHoney={isHoney}
disableThemeToggle={disableThemeToggle}
/>
)}
</>
);
Expand Down
8 changes: 7 additions & 1 deletion packages/shared-ui/src/connected-wallet-popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ import { WalletBalanceInUs } from "./wallet-balance-in-us";
export default function ConnectedWalletPopover({
isHoney = false,
isPopover = true,
disableThemeToggle = false,
}: {
isHoney?: boolean;
isPopover?: boolean;
disableThemeToggle?: boolean;
}) {
const [openPopover, setOpenPopover] = React.useState(false);
const [openModal, setOpenModal] = React.useState(false);
Expand Down Expand Up @@ -140,7 +142,11 @@ export default function ConnectedWalletPopover({
</Tabs>
</>
) : (
<Setting goback={() => setSetting(false)} isHoney={isHoney} />
<Setting
goback={() => setSetting(false)}
isHoney={isHoney}
disableThemeToggle={disableThemeToggle}
/>
)}
</>
);
Expand Down
6 changes: 5 additions & 1 deletion packages/shared-ui/src/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ export function Header({
</Link> */}
{isReady && <BGTStatusBtn isHub={appName === hubName} />}
{!hideConnectBtn && (
<ConnectButton isNavItem={true} isHoney={isHoney} />
<ConnectButton
isNavItem={true}
isHoney={isHoney}
disableThemeToggle={hideTheme}
/>
)}
<MobileDropdown navItems={isHoney ? mobileNavItems : navItems} />
</div>
Expand Down
4 changes: 3 additions & 1 deletion packages/shared-ui/src/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ export enum TRANSACTION_MODE {
export const Setting = ({
goback,
isHoney,
disableThemeToggle,
}: {
goback: () => void;
isHoney: boolean;
disableThemeToggle?: boolean;
}) => {
const [slippageMode, setSlippageMode] = useLocalStorage<SLIPPAGE_MODE>(
SLIPPAGE_TOLERANCE_TYPE,
Expand Down Expand Up @@ -64,7 +66,7 @@ export const Setting = ({
<div
className={cn(
"flex flex-col gap-2 text-sm font-medium",
isHoney && "pointer-events-none opacity-50",
(isHoney || disableThemeToggle) && "pointer-events-none opacity-50",
)}
>
Theme
Expand Down

0 comments on commit b293d32

Please sign in to comment.