refactor(icons): converge every icon render on aksrt_icon_markup

aksrt_get_comment_icon(), aksrt_renderer_svg_icon() and the widget
renderer's private icon_markup() all delegate to the unified helper,
and the duplicated 24px empty-state SVGs in user-center/user-home now
come from one aksrt_empty_state_svgs(). Contract tests follow the
delegation (sprite <use> markup asserted in the helper).
This commit is contained in:
kate522 committed 2026-09-06 12:59:44 +08:00
1 parent d599bbccd9
commit e4745d501e
8 files changed
+228 -23

No files matched your search

+4 -3
View File
@@ -274,10 +274,11 @@ if (!function_exists('aksrt_user_center_empty_svgs')) {
* @return array{post:string,comment:string,favorite:string}
*/
function aksrt_user_center_empty_svgs(): array {
$all = aksrt_empty_state_svgs();
return [
'post' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/></svg>',
'comment' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>',
'favorite' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>',
'post' => $all['post'],
'comment' => $all['comment'],
'favorite' => $all['favorite'],
];
}
}