Skip to content

Commit 6d53c90

Browse files
committed
modify button color based on project
1 parent 169d3c3 commit 6d53c90

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/containers/wallet/card-readonly.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default function ReadOnly({
5454
const [state, actions] = useAccount(baseUrl, config);
5555
const [profilesState, profilesActions] = useProfiles(config);
5656

57-
useThemeUpdater(community);
57+
useThemeUpdater(community, cardColor);
5858

5959
useEffect(() => {
6060
actions.getAccount(accountAddress);

src/hooks/theme.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import { ConfigCommunity } from "@citizenwallet/sdk";
22
import { useSafeEffect } from "@/hooks/useSafeEffect";
33

4-
export const useThemeUpdater = (community?: ConfigCommunity) => {
4+
export const useThemeUpdater = (
5+
community?: ConfigCommunity,
6+
colorOverride?: string
7+
) => {
58
useSafeEffect(() => {
69
if (community?.theme) {
710
document.documentElement.style.setProperty(
811
"--primary",
9-
community.theme.primary
12+
colorOverride ?? community.theme.primary
1013
);
1114
}
12-
}, [community]);
15+
}, [community, colorOverride]);
1316
};

0 commit comments

Comments
 (0)