mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 10:46:29 +00:00
41 lines
1.7 KiB
TypeScript
41 lines
1.7 KiB
TypeScript
'use client'
|
|
|
|
import { FC, ReactNode } from 'react';
|
|
import { ConfigProvider, theme as antdTheme } from "antd";
|
|
import { useTheme } from 'next-themes';
|
|
import { Plus_Jakarta_Sans } from 'next/font/google'
|
|
// import { StyleProvider } from '@ant-design/cssinjs';
|
|
|
|
const jakarta = Plus_Jakarta_Sans({ subsets: ['latin'] })
|
|
|
|
type Props = {
|
|
children: ReactNode
|
|
};
|
|
|
|
const AntdConfigProvider: FC<Props> = ({ children }) => {
|
|
const { systemTheme, theme } = useTheme()
|
|
const { defaultAlgorithm, darkAlgorithm } = antdTheme;
|
|
|
|
return (
|
|
<ConfigProvider
|
|
theme={{
|
|
algorithm: theme === 'dark' ? darkAlgorithm : theme === 'system' && systemTheme === 'dark' ? darkAlgorithm : defaultAlgorithm,
|
|
"token": {
|
|
"colorPrimary": 'rgb(113 113 122)',
|
|
// colorBgContainer: theme === 'dark' ? 'rgb(24, 24, 27)' : theme === 'system' && systemTheme === 'dark' ? 'rgb(24, 24, 27)' : '#ffffff',
|
|
colorBgContainer: theme === 'dark' ? 'rgb(9, 9, 11)' : theme === 'system' && systemTheme === 'dark' ? 'rgb(9, 9, 11)' : '#ffffff',
|
|
// colorTextPlaceholder: 'rgb(113, 113, 122)',
|
|
colorTextPlaceholder: 'rgb(161, 161, 170)',
|
|
colorBorder: theme === 'dark' ? 'rgb(39 39 42)' : theme === 'system' && systemTheme === 'dark' ? 'rgb(39 39 42)' : 'rgb(212 212 216)',
|
|
borderRadius: 7,
|
|
fontFamily: jakarta.style.fontFamily
|
|
}
|
|
}} componentSize='large'>
|
|
{/* <StyleProvider hashPriority="high"> */}
|
|
{children}
|
|
{/* </StyleProvider> */}
|
|
</ConfigProvider>
|
|
);
|
|
}
|
|
|
|
export default AntdConfigProvider; |