mirror of
https://github.com/Lifeforge-app/lifeforge.git
synced 2026-06-28 06:46:24 +00:00
fix: minor ui fixes
This commit is contained in:
@@ -65,7 +65,7 @@ const getLocale = forge
|
||||
query: z.object({
|
||||
lang: z.string(),
|
||||
namespace: z.enum(ALLOWED_NAMESPACE),
|
||||
subnamespace: z.string()
|
||||
subnamespace: z.string().regex(/^[a-zA-Z][a-zA-Z0-9-]*$/)
|
||||
})
|
||||
},
|
||||
output: {
|
||||
|
||||
@@ -80,7 +80,8 @@ export const contract = {
|
||||
]
|
||||
},
|
||||
"subnamespace": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"pattern": "^[a-zA-Z][a-zA-Z0-9-]*$"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
@@ -80,7 +80,8 @@ export const contract = {
|
||||
]
|
||||
},
|
||||
"subnamespace": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"pattern": "^[a-zA-Z][a-zA-Z0-9-]*$"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
@@ -80,7 +80,8 @@ export const contract = {
|
||||
]
|
||||
},
|
||||
"subnamespace": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"pattern": "^[a-zA-Z][a-zA-Z0-9-]*$"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { Flex } from '@/components/primitives'
|
||||
import { Flex, type FlexProps } from '@/components/primitives'
|
||||
import { usePersonalization } from '@/providers'
|
||||
|
||||
import { TagChip } from '../TagChip'
|
||||
|
||||
interface HeaderFilterProps<
|
||||
T extends Record<string, string | string[] | null>
|
||||
> {
|
||||
> extends Omit<FlexProps<'div'>, 'onChange'> {
|
||||
/** The filterable items available for selection. */
|
||||
availableFilters: Record<
|
||||
keyof T,
|
||||
@@ -51,7 +51,8 @@ interface HeaderFilterProps<
|
||||
export function TagsFilter<T extends Record<string, string | string[] | null>>({
|
||||
availableFilters: items,
|
||||
values,
|
||||
onChange
|
||||
onChange,
|
||||
...rest
|
||||
}: HeaderFilterProps<T>) {
|
||||
const { derivedThemeColor } = usePersonalization()
|
||||
|
||||
@@ -60,7 +61,7 @@ export function TagsFilter<T extends Record<string, string | string[] | null>>({
|
||||
}
|
||||
|
||||
return (
|
||||
<Flex align="center" gap="sm" wrap="wrap">
|
||||
<Flex align="center" gap="sm" wrap="wrap" {...rest}>
|
||||
{Object.entries(items).map(
|
||||
([query, { data, isColored }]) =>
|
||||
values[query] &&
|
||||
|
||||
@@ -89,6 +89,7 @@ function _Header({
|
||||
dark: 'bg-800',
|
||||
darkHover: 'bg-700'
|
||||
}}
|
||||
flex="1"
|
||||
renderContent={value => value || 'All Categories'}
|
||||
value={selectedCategory}
|
||||
onChange={value => setSelectedCategory(value)}
|
||||
|
||||
@@ -54,7 +54,11 @@ export function SidebarItemContent({
|
||||
<Box asChild minWidth="0" width="100%">
|
||||
<Text truncate as="div">
|
||||
{typeof label === 'string' && namespace !== false
|
||||
? t([`${namespace}:sidebar.${_.camelCase(label)}`, label])
|
||||
? t([
|
||||
`${namespace}:sidebar.${_.camelCase(label)}`,
|
||||
`sidebar.${_.camelCase(label)}`,
|
||||
label
|
||||
])
|
||||
: label}{' '}
|
||||
{number !== undefined && hasSubsection && (
|
||||
<Text
|
||||
|
||||
Reference in New Issue
Block a user