fix(user-center): show brand-colored icons in social bindings

Wrap the provider glyph in the reference theme's .social-login-item circular {type} wrapper on the /user/settings/ bindings list so each row paints the provider brand colour instead of a muted ink glyph. Aggregated clogin_* providers strip the prefix for the colour class while data-provider keeps the full key for the bind/unbind flow. Drops the now-unreferenced .binding-item__icon rules from the user-center settings and profile lists stylesheets.
This commit is contained in:
kate522 committed 2026-10-18 11:47:28 +08:00
1 parent 5641c40958
commit 1461c9fe27
3 files changed
+8 -17

No files matched your search

@@ -26,10 +26,14 @@ foreach ((array) ($oauth_data['bindings'] ?? []) as $binding) {
if (!$key) {
continue;
}
// Reference parity: the provider type (clogin_ prefix stripped) drives the
// .social-login-item brand colour, matching zibll's binding list.
$icon_type = str_starts_with($key, 'clogin_') ? substr($key, 7) : $key;
$binding_rows[$key] = [
'key' => $key,
'name' => (string) ($binding['label'] ?? $binding_name_map[$key] ?? $binding['name'] ?? ucfirst($key)),
'icon' => $binding['icon'] ?? '',
'icon_type' => $icon_type,
'is_bound' => true,
'url' => '',
];
@@ -39,10 +43,12 @@ foreach ((array) ($oauth_data['available'] ?? []) as $binding) {
if (!$key) {
continue;
}
$icon_type = str_starts_with($key, 'clogin_') ? substr($key, 7) : $key;
$binding_rows[$key] = [
'key' => $key,
'name' => (string) ($binding['label'] ?? $binding_name_map[$key] ?? $binding['name'] ?? ucfirst($key)),
'icon' => $binding['icon'] ?? '',
'icon_type' => $icon_type,
'is_bound' => false,
'url' => $binding['start_url'] ?? $binding['url'] ?? '',
];
@@ -64,7 +70,7 @@ foreach ((array) ($oauth_data['available'] ?? []) as $binding) {
<?php foreach ($binding_rows as $binding) : ?>
<?php if (!empty($binding['is_bound'])) : ?>
<div class="aksrt-account-row binding-item">
<span class="binding-item__icon"><?php echo $binding['icon']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<span class="social-login-item circular <?php echo esc_attr($binding['icon_type']); ?>"><?php echo $binding['icon']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<span class="aksrt-account-row__social-name"><?php echo esc_html($binding['name']); ?></span>
<span class="binding-status">
<i class="fa fas fa-check-circle badge__icon" aria-hidden="true"></i>
@@ -76,7 +82,7 @@ foreach ((array) ($oauth_data['available'] ?? []) as $binding) {
</div>
<?php else : ?>
<a href="<?php echo esc_url($binding['url']); ?>" class="aksrt-account-row binding-item binding-item--linkable" target="_self" data-provider="<?php echo esc_attr($binding['key']); ?>" data-bind-start-url="<?php echo esc_url($binding['url']); ?>">
<span class="binding-item__icon"><?php echo $binding['icon']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<span class="social-login-item circular <?php echo esc_attr($binding['icon_type']); ?>"><?php echo $binding['icon']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<span class="aksrt-account-row__social-name"><?php echo esc_html($binding['name']); ?></span>
<span class="binding-status binding-status--idle"><?php esc_html_e('未绑定', 'aksrt'); ?></span>
<span class="but hollow c-blue aksrt-account-row__action"><?php esc_html_e('绑定', 'aksrt'); ?></span>