mirror of
https://github.com/D4M13N-D3V/neroshitron.git
synced 2025-03-14 10:05:04 +00:00
fix:remove tamagui
This commit is contained in:
parent
acc0e0d846
commit
c58a57c31a
@ -1,16 +1,10 @@
|
|||||||
const { withTamagui } = require('@tamagui/next-plugin')
|
|
||||||
|
|
||||||
module.exports = function (name, { defaultConfig }) {
|
module.exports = function (name, { defaultConfig }) {
|
||||||
let config = {
|
let config = {
|
||||||
...defaultConfig,
|
...defaultConfig,
|
||||||
// ...your configuration
|
// ...your configuration
|
||||||
}
|
}
|
||||||
const tamaguiPlugin = withTamagui({
|
|
||||||
config: './tamagui.config.ts',
|
|
||||||
components: ['tamagui'],
|
|
||||||
})
|
|
||||||
return {
|
return {
|
||||||
...config,
|
...config
|
||||||
...tamaguiPlugin(config),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
13847
package-lock.json
generated
13847
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,13 +1,9 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tamagui/config": "^1.98.2",
|
|
||||||
"@tamagui/next-plugin": "^1.98.2",
|
|
||||||
"@tamagui/next-theme": "^1.98.2",
|
|
||||||
"next": "^14.2.3",
|
"next": "^14.2.3",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-native-web": "^0.19.11",
|
"react-native-web": "^0.19.11"
|
||||||
"tamagui": "^1.98.2"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
@ -16,6 +12,7 @@
|
|||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/node": "20.12.12",
|
||||||
"@types/react": "18.3.2",
|
"@types/react": "18.3.2",
|
||||||
"typescript": "5.4.5"
|
"typescript": "5.4.5"
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// Optional: add the reset to get more consistent styles across browsers
|
// Optional: add the reset to get more consistent styles across browsers
|
||||||
|
|
||||||
import '@tamagui/core/reset.css'
|
|
||||||
import { NextThemeProvider, useRootTheme } from '@tamagui/next-theme'
|
|
||||||
|
|
||||||
import { AppProps } from 'next/app'
|
import { AppProps } from 'next/app'
|
||||||
|
|
||||||
@ -9,26 +7,8 @@ import Head from 'next/head'
|
|||||||
|
|
||||||
import React, { useMemo } from 'react'
|
import React, { useMemo } from 'react'
|
||||||
|
|
||||||
import { TamaguiProvider, createTamagui } from 'tamagui'
|
|
||||||
import { config } from '@tamagui/config/v3'
|
|
||||||
|
|
||||||
const tamaguiConfig = createTamagui(config)
|
|
||||||
|
|
||||||
// you usually export this from a tamagui.config.ts file:
|
|
||||||
|
|
||||||
// import tamaguiConfig from '../tamagui.config'
|
|
||||||
// make TypeScript type everything based on your config
|
|
||||||
|
|
||||||
type Conf = typeof tamaguiConfig
|
|
||||||
|
|
||||||
declare module '@tamagui/core' {
|
|
||||||
|
|
||||||
interface TamaguiCustomConfig extends Conf {}
|
|
||||||
|
|
||||||
}
|
|
||||||
export default function App({ Component, pageProps }: AppProps) {
|
export default function App({ Component, pageProps }: AppProps) {
|
||||||
|
|
||||||
const [theme, setTheme] = useRootTheme()
|
|
||||||
// memo to avoid re-render on dark/light change
|
// memo to avoid re-render on dark/light change
|
||||||
|
|
||||||
const contents = useMemo(() => {
|
const contents = useMemo(() => {
|
||||||
@ -37,9 +17,7 @@ export default function App({ Component, pageProps }: AppProps) {
|
|||||||
|
|
||||||
}, [pageProps])
|
}, [pageProps])
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
<NextThemeProvider onChangeTheme={setTheme as any}>
|
|
||||||
|
|
||||||
<Head>
|
<Head>
|
||||||
|
|
||||||
<script
|
<script
|
||||||
@ -50,20 +28,8 @@ export default function App({ Component, pageProps }: AppProps) {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
</Head>
|
</Head>
|
||||||
|
|
||||||
<TamaguiProvider
|
|
||||||
config={tamaguiConfig}
|
|
||||||
disableInjectCSS
|
|
||||||
disableRootThemeClass
|
|
||||||
defaultTheme={theme}
|
|
||||||
>
|
|
||||||
|
|
||||||
{contents}
|
{contents}
|
||||||
|
</>
|
||||||
</TamaguiProvider>
|
|
||||||
|
|
||||||
</NextThemeProvider>
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,12 +12,7 @@ import NextDocument, {
|
|||||||
|
|
||||||
} from 'next/document'
|
} from 'next/document'
|
||||||
|
|
||||||
import { StyleSheet } from 'react-native'
|
|
||||||
|
|
||||||
import { config } from '@tamagui/config/v3'
|
|
||||||
import { createTamagui } from 'tamagui'
|
|
||||||
|
|
||||||
const tamaguiConfig = createTamagui(config)
|
|
||||||
|
|
||||||
// you usually export this from a tamagui.config.ts file:
|
// you usually export this from a tamagui.config.ts file:
|
||||||
|
|
||||||
@ -29,7 +24,6 @@ import NextDocument, {
|
|||||||
const page = await renderPage()
|
const page = await renderPage()
|
||||||
// @ts-ignore RN doesn't have this type
|
// @ts-ignore RN doesn't have this type
|
||||||
|
|
||||||
const rnwStyle = StyleSheet.getSheet()
|
|
||||||
return {
|
return {
|
||||||
|
|
||||||
...page,
|
...page,
|
||||||
@ -38,16 +32,7 @@ import NextDocument, {
|
|||||||
|
|
||||||
<>
|
<>
|
||||||
|
|
||||||
<style
|
|
||||||
id={rnwStyle.id}
|
|
||||||
dangerouslySetInnerHTML={{ __html: rnwStyle.textContent }}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<style
|
|
||||||
dangerouslySetInnerHTML={{
|
|
||||||
__html: tamaguiConfig.getCSS(),
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
</>
|
</>
|
||||||
|
|
||||||
|
@ -1,18 +1,6 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
|
||||||
import { Button, useIsomorphicLayoutEffect } from 'tamagui'
|
|
||||||
|
|
||||||
import { useThemeSetting } from '@tamagui/next-theme'
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
|
return (<h1>Test</h1>)
|
||||||
const themeSetting = useThemeSetting()
|
|
||||||
|
|
||||||
const [clientTheme, setClientTheme] = useState<string>('dark')
|
|
||||||
useIsomorphicLayoutEffect(() => {
|
|
||||||
|
|
||||||
setClientTheme(themeSetting.current || 'dark')
|
|
||||||
|
|
||||||
}, [themeSetting.current, themeSetting.resolvedTheme])
|
|
||||||
return <Button onPress={themeSetting.toggle}>Change theme: {clientTheme}</Button>
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user