Skip to content

Commit

Permalink
Add App theme to URL parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Mar 12, 2024
1 parent 6fbbea1 commit e756290
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/xgen/components/edit/Frame/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getLocale } from '@umijs/max'
import { local, session } from '@yaoapp/storex'

import type { InputProps } from 'antd'
import type { Component } from '@/types'
import type { App, Component } from '@/types'
import { Else, If, Then } from 'react-if'
import { useEffect, useRef, useState } from 'react'

Expand Down Expand Up @@ -41,6 +41,11 @@ const Frame = window.$app.memo((props: IFrameIProps) => {
return token || ''
}

const getTheme = (): App.Theme => {
const theme = (local.xgen_theme || 'light') as App.Theme
return theme
}

const parseUrl = (url: string, params?: Record<string, string>, data?: Record<string, any>) => {
if (url == '') return ''

Expand All @@ -62,6 +67,7 @@ const Frame = window.$app.memo((props: IFrameIProps) => {
}
new_params.append('__token', token)
new_params.append('__locale', getLocale())
new_params.append('__theme', getTheme())
new_params.append('__value', value || '')
new_params.append('__bind', bind || '')
new_params.append('__label', label || '')
Expand Down

0 comments on commit e756290

Please sign in to comment.