File tree Expand file tree Collapse file tree
apps/consumers/src/services/dao Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,19 +148,29 @@ export class TelegramDAOService extends BaseDAOService {
148148 * Build Telegram inline keyboard for DAO selection
149149 */
150150 private buildInlineKeyboard ( daos : any [ ] , selections : Set < string > ) : any {
151+ // Create all DAO buttons
152+ const daoButtons = daos . map ( dao => {
153+ const normalizedDao = dao . id . toUpperCase ( ) ;
154+ const daoWithEmoji = getDaoWithEmoji ( dao . id ) ;
155+ const isSelected = selections . has ( normalizedDao ) ;
156+
157+ return {
158+ text : isSelected ? `${ uiMessages . status . success } ${ daoWithEmoji } ` : daoWithEmoji ,
159+ callback_data : `dao_toggle_${ normalizedDao } `
160+ } ;
161+ } ) ;
162+
163+ // Group buttons into rows of 4
164+ const BUTTONS_PER_ROW = 3 ;
165+ const daoButtonRows : any [ ] [ ] = [ ] ;
166+
167+ for ( let i = 0 ; i < daoButtons . length ; i += BUTTONS_PER_ROW ) {
168+ daoButtonRows . push ( daoButtons . slice ( i , i + BUTTONS_PER_ROW ) ) ;
169+ }
170+
151171 return {
152172 inline_keyboard : [
153- // DAO buttons row
154- daos . map ( dao => {
155- const normalizedDao = dao . id . toUpperCase ( ) ;
156- const daoWithEmoji = getDaoWithEmoji ( dao . id ) ;
157- const isSelected = selections . has ( normalizedDao ) ;
158-
159- return {
160- text : isSelected ? `${ uiMessages . status . success } ${ daoWithEmoji } ` : daoWithEmoji ,
161- callback_data : `dao_toggle_${ normalizedDao } `
162- } ;
163- } ) ,
173+ ...daoButtonRows ,
164174 // Confirm button row
165175 [
166176 { text : uiMessages . confirmSelection , callback_data : 'dao_confirm' }
You can’t perform that action at this time.
0 commit comments