feat(suite): Unify changelog icons

This commit is contained in:
Jan Václavík
2026-02-18 10:40:15 +01:00
parent f8acc1fa19
commit a6c937befe
3 changed files with 27 additions and 10 deletions

View File

@@ -149,7 +149,7 @@ export const App = ({ theme }: AppProps) => {
}
>
<IconButton
icon="sidebar"
icon="clockCounterClockwise"
onClick={() => setIsSidebarOpen(prev => !prev)}
intent={isSidebarOpen ? 'brand' : 'neutral'}
size="small"

View File

@@ -1,15 +1,28 @@
import styled from 'styled-components';
import type { IconProps, SuiteThemeColors } from '@trezor/components';
import { Badge, Box, CardList, Column, H3, Icon, Text, variables } from '@trezor/components';
import {
Badge,
Box,
CardList,
Column,
H3,
Icon,
IconProps,
SuiteThemeColors,
Text,
Tooltip,
variables,
} from '@trezor/components';
import { HEADER_HEIGHT } from '../constants';
import type { EventDoc } from '../types';
import type { VersionWithEvents } from '../utils/filterUtils';
import { getEventId } from '../utils/filterUtils';
const isAdded = (event: EventDoc, version: string) => event.changelog?.addedInVersion === version;
const getEventChangeProps = (event: EventDoc, version: string) =>
event.changelog?.addedInVersion === version
isAdded(event, version)
? { name: 'plus' as const, variant: 'primary' as const }
: { name: 'arrowsClockwiseFilled' as const, variant: 'warning' as const };
@@ -17,7 +30,7 @@ const scrollToEvent = (eventName: string) => {
const el = document.getElementById(getEventId(eventName));
if (!el) return;
const y = el.getBoundingClientRect().top + window.scrollY - HEADER_HEIGHT;
window.scrollTo({ top: y, behavior: 'smooth' });
window.scrollTo({ top: y });
};
export const SIDEBAR_WIDTH = 280;
@@ -73,10 +86,14 @@ export const VersionsSidebar = ({ versionsWithEvents }: VersionsSidebarProps) =>
>
<Text typographyStyle="label">{event.name}</Text>
<Icon
{...(getEventChangeProps(event, version) as IconProps)}
size="small"
/>
<Tooltip
content={isAdded(event, version) ? 'Added' : 'Updated'}
>
<Icon
{...(getEventChangeProps(event, version) as IconProps)}
size="small"
/>
</Tooltip>
</CardList.Item>
))}
</CardList>

View File

@@ -13,7 +13,7 @@ export const useChangelogButton = () => {
onClick={() => {
setIsChangelogOpened(!isChangelogOpened);
}}
icon="note"
icon="clockCounterClockwise"
intent={isChangelogOpened ? 'brand' : 'neutral'}
size="small"
priority="secondary"