diff --git a/components/trade/AdvancedTradeForm.tsx b/components/trade/AdvancedTradeForm.tsx
index 7829b5b5..d4970a3e 100644
--- a/components/trade/AdvancedTradeForm.tsx
+++ b/components/trade/AdvancedTradeForm.tsx
@@ -56,7 +56,6 @@ import { useWallet } from '@solana/wallet-adapter-react'
import { useEnhancedWallet } from '@components/wallet/EnhancedWalletProvider'
import { isMangoError } from 'types'
import InlineNotification from '@components/shared/InlineNotification'
-import { useTheme } from 'next-themes'
const set = mangoStore.getState().set
@@ -81,6 +80,7 @@ const AdvancedTradeForm = () => {
const { t } = useTranslation(['common', 'trade'])
const { mangoAccount } = useMangoAccount()
const tradeForm = mangoStore((s) => s.tradeForm)
+ const themeData = mangoStore((s) => s.themeData)
const [placingOrder, setPlacingOrder] = useState(false)
const [tradeFormSizeUi] = useLocalStorageState(SIZE_INPUT_UI_KEY, 'slider')
const [savedCheckboxSettings, setSavedCheckboxSettings] =
@@ -101,7 +101,6 @@ const AdvancedTradeForm = () => {
quoteSymbol,
serumOrPerpMarket,
} = useSelectedMarket()
- const { theme } = useTheme()
const setTradeType = useCallback((tradeType: 'Limit' | 'Market') => {
set((s) => {
@@ -712,12 +711,12 @@ const AdvancedTradeForm = () => {
? ''
: tradeForm.side === 'buy'
? `bg-th-up-dark md:hover:bg-th-up-dark ${
- theme === 'Bonk'
- ? 'bonk-buy-button'
+ themeData.buttonStyle === 'raised'
+ ? 'raised-buy-button'
: 'text-white md:hover:brightness-90'
}`
: `bg-th-down-dark text-white ${
- theme === 'Bonk'
+ themeData.buttonStyle === 'raised'
? ''
: 'md:hover:bg-th-down-dark md:hover:brightness-90'
}`
diff --git a/components/trade/TradingViewChart.tsx b/components/trade/TradingViewChart.tsx
index d9193859..20bb8f7b 100644
--- a/components/trade/TradingViewChart.tsx
+++ b/components/trade/TradingViewChart.tsx
@@ -83,6 +83,7 @@ const TradingViewChart = () => {
showOrderLinesLocalStorage
)
const tradeExecutions = mangoStore((s) => s.tradingView.tradeExecutions)
+ const themeData = mangoStore((s) => s.themeData)
const { data: combinedTradeHistory, isLoading: loadingTradeHistory } =
useTradeHistory()
const [showTradeExecutions, toggleShowTradeExecutions] = useState(false)
@@ -576,12 +577,9 @@ const TradingViewChart = () => {
autosize: defaultProps.autosize,
studies_overrides: defaultProps.studiesOverrides,
theme:
- theme === 'Light' ||
- theme === 'Banana' ||
- theme === 'Lychee' ||
- theme === 'Bonk'
+ theme === 'Light' || theme === 'Banana' || theme === 'Lychee'
? 'Light'
- : 'Dark',
+ : themeData.tvChartTheme,
custom_css_url: '/styles/tradingview.css',
loading_screen: {
backgroundColor: COLORS.BKG1[theme],
diff --git a/store/mangoStore.ts b/store/mangoStore.ts
index 0d29eb7c..b8708852 100644
--- a/store/mangoStore.ts
+++ b/store/mangoStore.ts
@@ -58,17 +58,30 @@ import {
TourSettings,
ProfileDetails,
MangoTokenStatsItem,
+ ThemeData,
} from 'types'
import spotBalancesUpdater from './spotBalancesUpdater'
import { PerpMarket } from '@blockworks-foundation/mango-v4/'
import perpPositionsUpdater from './perpPositionsUpdater'
import { DEFAULT_PRIORITY_FEE } from '@components/settings/RpcSettings'
import {
- EntityId,
IExecutionLineAdapter,
IOrderLineAdapter,
} from '@public/charting_library/charting_library'
+export const DEFAULT_THEME_DATA: ThemeData = {
+ buttonStyle: 'flat',
+ logoPath: '/logos/logo-mark.svg',
+ platformName: 'Mango',
+ rainAnimationImagePath: '',
+ sideImagePath: '',
+ sideTilePath: '',
+ topTilePath: '',
+ tvChartTheme: 'Dark',
+ tvImagePath: '',
+ useGradientBg: false,
+}
+
const GROUP = new PublicKey('78b8f4cGCwmZ9ysPFMWLaLTkkaYnUjwMJYStWe5RTSSX')
const ENDPOINTS = [
@@ -209,6 +222,7 @@ export type MangoStore = {
amountOut: string
}
set: (x: (x: MangoStore) => void) => void
+ themeData: ThemeData
tokenStats: {
initialLoad: boolean
loading: boolean
@@ -364,6 +378,7 @@ const mangoStore = create()(
amountIn: '',
amountOut: '',
},
+ themeData: DEFAULT_THEME_DATA,
tokenStats: {
initialLoad: false,
loading: true,
diff --git a/styles/globals.css b/styles/globals.css
index 95aae407..9beb148a 100644
--- a/styles/globals.css
+++ b/styles/globals.css
@@ -679,38 +679,38 @@ input[type='range']::-webkit-slider-runnable-track {
@apply absolute h-screen w-full;
}
-/* bonk button */
+/* raised button */
-.bonk-button {
+.raised-button {
@apply relative flex items-center justify-center bg-th-button text-th-fgd-1 transition-none;
box-shadow: 0 6px var(--button-hover);
}
-.bonk-button:hover {
+.raised-button:hover {
background-color: var(--button);
box-shadow: 0 4px var(--button-hover);
top: 2px;
}
-.bonk-button:active {
+.raised-button:active {
box-shadow: 0 0 var(--button-hover);
top: 6px;
}
-/* bonk buy button */
+/* raised buy button */
-.bonk-buy-button {
+.raised-buy-button {
@apply relative flex items-center justify-center bg-th-up text-th-active transition-none;
box-shadow: 0 6px var(--up-dark);
}
-.bonk-buy-button:hover {
+.raised-buy-button:hover {
background-color: var(--up) !important;
box-shadow: 0 4px var(--up-dark);
top: 2px;
}
-.bonk-buy-button:active {
+.raised-buy-button:active {
box-shadow: 0 0 var(--up-dark);
top: 6px;
}
diff --git a/types/index.ts b/types/index.ts
index e63f7c07..bfaad526 100644
--- a/types/index.ts
+++ b/types/index.ts
@@ -360,6 +360,19 @@ export interface TradeForm {
reduceOnly: boolean
}
+export interface ThemeData {
+ buttonStyle: 'flat' | 'raised'
+ logoPath: string
+ platformName: string
+ rainAnimationImagePath: string
+ sideImagePath: string
+ sideTilePath: string
+ topTilePath: string
+ tvChartTheme: 'Light' | 'Dark'
+ tvImagePath: string
+ useGradientBg: boolean
+}
+
export interface MangoError extends Error {
txid: string
}