File tree Expand file tree Collapse file tree 4 files changed +16
-7
lines changed
Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -366,6 +366,7 @@ export function LowLevelChatHistory(
366366 < WrappedMiniActions
367367 className = "actions"
368368 actions = { projectActions }
369+ themeVariant = "elevo"
369370 onActionClick = { ( e ) => {
370371 onProjectActionClick ( { action : e . detail , project } ) ;
371372 } }
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export const WrappedEasyopsAvatar = wrapBrick<
3939> ( "eo-easyops-avatar" ) ;
4040export const WrappedMiniActions = wrapBrick <
4141 EoMiniActions ,
42- EoMiniActionsProps ,
42+ EoMiniActionsProps & { themeVariant ?: "default" | "elevo" } ,
4343 EoMiniActionsEvents ,
4444 EoMiniActionsEventsMapping
4545> ( "eo-mini-actions" , {
Original file line number Diff line number Diff line change 1- import React from "react" ;
1+ import React , { useMemo } from "react" ;
22import { createDecorators } from "@next-core/element" ;
33import { ReactNextElement , wrapBrick } from "@next-core/react-element" ;
44import "@next-core/theme" ;
@@ -54,11 +54,19 @@ class ShowCase extends ReactNextElement implements ShowCaseProps {
5454}
5555
5656function ShowCaseComponent ( { caseTitle, summary, url } : ShowCaseProps ) {
57+ const bgClass = useMemo ( ( ) => {
58+ // Get a deterministic class based on the caseTitle
59+ if ( ! caseTitle ) return bgClasses [ 0 ] ;
60+ let hash = 0 ;
61+ for ( let i = 0 ; i < caseTitle . length ; i ++ ) {
62+ hash = caseTitle . charCodeAt ( i ) + ( ( hash << 5 ) - hash ) ;
63+ }
64+ const index = Math . abs ( hash ) % bgClasses . length ;
65+ return bgClasses [ index ] ;
66+ } , [ caseTitle ] ) ;
67+
5768 return (
58- < WrappedLink
59- className = { `link ${ bgClasses [ Math . floor ( Math . random ( ) * bgClasses . length ) ] } ` }
60- url = { url }
61- >
69+ < WrappedLink className = { `link ${ bgClass } ` } url = { url } >
6270 < span className = "title" > { caseTitle } </ span >
6371 < span className = "description" > { summary } </ span >
6472 < span className = "mask" />
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ export interface NumberInputProps extends InputProps {
9292export interface TextareaProps extends InputProps { }
9393
9494export interface SelectProps extends InputProps {
95- options : FormItemOptions [ ] ;
95+ options : ( FormItemOptions | string ) [ ] ;
9696 onChange ?: ( e : CustomEvent < string | number | boolean | null > ) => void ;
9797}
9898
You can’t perform that action at this time.
0 commit comments