u
This commit is contained in:
1 parent
572011017a
commit
ff3ee944d5
4 files changed
+215
-98
No files matched your search
@@ -1,29 +1,34 @@
|
||||
import { useRouter } from 'expo-router'
|
||||
import { Text, View } from 'react-native'
|
||||
import { ScrollView } from 'react-native-gesture-handler'
|
||||
import { AButton, ACell, ACellGroup } from '@/components/common/ao'
|
||||
import EmptyState from '@/components/common/EmptyStatus'
|
||||
import { Grid, GridItem } from '@/components/ui/grid'
|
||||
import { useMoneyCategoryStore } from '@/store/moneyCategory'
|
||||
import { useSpaceStore } from '@/store/space'
|
||||
|
||||
export default function Demo() {
|
||||
const moneyCategoryStore = useMoneyCategoryStore()
|
||||
const router = useRouter()
|
||||
const spaceStore = useSpaceStore()
|
||||
|
||||
function getCategories() {
|
||||
console.log(moneyCategoryStore.categories)
|
||||
}
|
||||
|
||||
async function resetCategory() {
|
||||
moneyCategoryStore.setCategories([])
|
||||
await moneyCategoryStore.init()
|
||||
function NoSpaceTip() {
|
||||
return (
|
||||
<EmptyState
|
||||
description="还没有加入空间,选择一个加入或自己创建一个,开始聊天!"
|
||||
footer={
|
||||
<AButton size="sm">创建 / 加入 空间</AButton>
|
||||
}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<ScrollView>
|
||||
<Grid className="gap-4 p-4" _extra={{ className: 'grid-cols-12' }}>
|
||||
<GridItem className="bg-background-50 p-6 rounded-md" _extra={{ className: 'col-span-3' }} />
|
||||
<GridItem className="bg-background-50 p-6 rounded-md" _extra={{ className: 'col-span-3' }} />
|
||||
<GridItem className="bg-background-50 p-6 rounded-md" _extra={{ className: 'col-span-3' }} />
|
||||
<GridItem className="bg-background-50 p-6 rounded-md" _extra={{ className: 'col-span-3' }} />
|
||||
</Grid>
|
||||
</ScrollView>
|
||||
<View className="flex-1">
|
||||
{
|
||||
spaceStore.inSpace()
|
||||
? (<View></View>)
|
||||
: <NoSpaceTip />
|
||||
}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -28,8 +28,8 @@ function isWhiteListed(url: string) {
|
||||
}
|
||||
|
||||
const alovaInstance = createAlova({
|
||||
baseURL: 'http://192.168.5.6:8086/app',
|
||||
// baseURL: 'http://192.168.1.137:8086/app',
|
||||
// baseURL: 'http://192.168.5.6:8086/app',
|
||||
baseURL: 'http://192.168.1.137:8086/app',
|
||||
requestAdapter: axiosRequestAdapter(),
|
||||
timeout: 5000,
|
||||
cacheFor: null,
|
||||
|
||||
@@ -4,6 +4,7 @@ interface SpaceState {
|
||||
userSpace: UserSpace | null
|
||||
setUserSpace: (space: UserSpace | null) => void
|
||||
clear: () => void
|
||||
inSpace: () => boolean
|
||||
}
|
||||
|
||||
export const useSpaceStore = create<SpaceState>((set, get) => ({
|
||||
@@ -14,4 +15,8 @@ export const useSpaceStore = create<SpaceState>((set, get) => ({
|
||||
userSpace: null,
|
||||
})
|
||||
},
|
||||
inSpace: () => {
|
||||
const userSpace = get().userSpace
|
||||
return userSpace !== null && userSpace.id !== 0
|
||||
},
|
||||
}))
|
||||
Reference in new issue
Block a user