Skip to content

Commit

Permalink
Ensure size coherence across UI by using AntD custom icon component
Browse files Browse the repository at this point in the history
  • Loading branch information
manu committed Jul 15, 2024
1 parent 0004382 commit b6c1af5
Show file tree
Hide file tree
Showing 11 changed files with 223 additions and 133 deletions.
13 changes: 10 additions & 3 deletions client/public/avatars/squirrel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type { Settings as LayoutSettings } from '@ant-design/pro-components';
import { SettingDrawer } from '@ant-design/pro-components';
// @ts-ignore
import { history, RunTimeLayoutConfig } from '@umijs/max';
import { Avatar } from 'antd';
import { API } from 'ssm-shared-lib';
import defaultSettings from '../config/defaultSettings';
import Logo from '../public/logo.svg';
Expand Down
16 changes: 14 additions & 2 deletions client/src/components/HeaderComponents/AvatarDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@ant-design/icons';
import { useEmotionCss } from '@ant-design/use-emotion-css';
import { history, useModel } from '@umijs/max';
import { Spin } from 'antd';
import { Spin, Typography } from 'antd';
import { stringify } from 'querystring';
import type { MenuInfo } from 'rc-menu/lib/interface';
import React, { useCallback } from 'react';
Expand All @@ -21,7 +21,19 @@ export type GlobalHeaderRightProps = {
export const AvatarName = () => {
const { initialState } = useModel('@@initialState');
const { currentUser } = initialState || {};
return <span className="anticon">{currentUser?.name}</span>;
return (
<Typography.Title
level={5}
className="anticon"
style={{
color: 'rgba(255, 255, 255, 0.65)',
marginBottom: '0.9em',
fontSize: '14px',
}}
>
{currentUser?.name}
</Typography.Title>
);
};

export const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@ export const DevicesHeaderWidget: React.FC = () => {
className={'svg-small-anim-rotate'}
style={{
color: 'rgba(255, 255, 255, 0.65)',
fontSize: '20px',
}}
width={'20px'}
height={'20px'}
size={20}
/>
}
/>
Expand Down
4 changes: 1 addition & 3 deletions client/src/components/HeaderComponents/HealthWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ export const HealthWidget: React.FC = () => {
className={'svg-small-anim-pulse'}
style={{
color: 'rgba(255, 255, 255, 0.65)',
fontSize: '20px',
}}
width={'20px'}
height={'20px'}
size={20}
/>
}
/>
Expand Down
Loading

0 comments on commit b6c1af5

Please sign in to comment.