mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 11:06:29 +00:00
initial commit for new hats app
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
'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;
|
||||
@@ -0,0 +1,19 @@
|
||||
'use client';
|
||||
import { ProgressProvider } from '@bprogress/next/app';
|
||||
|
||||
const ProgressBarProviders = ({ children }: { children: React.ReactNode }) => {
|
||||
return (
|
||||
<>
|
||||
<ProgressProvider
|
||||
height="4px"
|
||||
color="#EA512C"
|
||||
options={{ showSpinner: true }}
|
||||
shallowRouting
|
||||
>
|
||||
{children}
|
||||
</ProgressProvider>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default ProgressBarProviders;
|
||||
@@ -0,0 +1,23 @@
|
||||
'use client'
|
||||
|
||||
import { ReactNode } from 'react';
|
||||
import { type Session } from 'next-auth';
|
||||
import { SessionProvider as Provider } from 'next-auth/react'
|
||||
|
||||
type Props = {
|
||||
children: ReactNode,
|
||||
session: Session | null
|
||||
basePath?: string
|
||||
};
|
||||
|
||||
const SessionProvider: React.FC<Props> = ({ children, session }) => {
|
||||
return (
|
||||
<>
|
||||
<Provider session={session}>
|
||||
{children}
|
||||
</Provider>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default SessionProvider;
|
||||
@@ -0,0 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import { ThemeProvider as NextThemesProvider, ThemeProviderProps } from "next-themes"
|
||||
|
||||
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
|
||||
return <NextThemesProvider {...props}>{children}</NextThemesProvider>
|
||||
}
|
||||
Reference in New Issue
Block a user