Skip to content

Commit bdf3182

Browse files
committed
💄(frontend) visual improvements around the Icon
With time some visual inconsistencies have crept into the DropButton and Icon component. This commit aims to harmonize the appearance with the design system.
1 parent f6d0ee4 commit bdf3182

File tree

7 files changed

+37
-23
lines changed

7 files changed

+37
-23
lines changed

src/frontend/apps/impress/src/components/DropButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const StyledButton = styled(Button)<StyledButtonProps>`
3131
font-weight: 500;
3232
font-size: 0.938rem;
3333
padding: 0;
34-
${({ $css }) => $css};
34+
border-radius: 4px;
3535
&:hover {
3636
background-color: var(
3737
--c--components--button--primary-text--background--color-hover
@@ -41,6 +41,7 @@ const StyledButton = styled(Button)<StyledButtonProps>`
4141
box-shadow: 0 0 0 2px var(--c--theme--colors--primary-400);
4242
border-radius: 4px;
4343
}
44+
${({ $css }) => $css};
4445
`;
4546

4647
export interface DropButtonProps {

src/frontend/apps/impress/src/components/Icon.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const Icon = ({
1313
iconName,
1414
disabled,
1515
variant = 'outlined',
16-
$variation,
16+
$variation = 'text',
1717
...textProps
1818
}: IconProps) => {
1919
const hasLabel = 'aria-label' in textProps || 'aria-labelledby' in textProps;
@@ -41,15 +41,19 @@ type IconOptionsProps = TextType & {
4141
isHorizontal?: boolean;
4242
};
4343

44-
export const IconOptions = ({ isHorizontal, ...props }: IconOptionsProps) => {
44+
export const IconOptions = ({
45+
isHorizontal,
46+
$css,
47+
...props
48+
}: IconOptionsProps) => {
4549
return (
4650
<Icon
47-
{...props}
4851
iconName={isHorizontal ? 'more_horiz' : 'more_vert'}
4952
$css={css`
5053
user-select: none;
51-
${props.$css}
54+
${$css}
5255
`}
56+
{...props}
5357
/>
5458
);
5559
};

src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Interlinking/InterlinkingLinkInlineContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const LinkSelected = ({ url, title }: LinkSelectedProps) => {
6666
onClick={handleClick}
6767
draggable="false"
6868
$css={css`
69-
display: inline;
69+
display: contents;
7070
padding: 0.1rem 0.4rem;
7171
border-radius: 4px;
7272
& svg {

src/frontend/apps/impress/src/features/docs/doc-header/components/BoutonShare.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const BoutonShare = ({
7676

7777
return (
7878
<Button
79-
color="tertiary-text"
79+
color="primary-text"
8080
onClick={open}
8181
size="medium"
8282
disabled={isDisabled}

src/frontend/apps/impress/src/features/docs/doc-management/components/DocIcon.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { MouseEvent, useRef, useState } from 'react';
22
import { createPortal } from 'react-dom';
33

4-
import { BoxButton, Icon, TextType } from '@/components';
4+
import { BoxButton, BoxButtonType, Text, TextType } from '@/components';
55
import { EmojiPicker, emojidata } from '@/docs/doc-editor/';
66

77
import { useDocTitleUpdate } from '../hooks/useDocTitleUpdate';
88

99
type DocIconProps = TextType & {
10+
buttonProps?: BoxButtonType;
1011
emoji?: string | null;
1112
defaultIcon: React.ReactNode;
1213
docId?: string;
@@ -16,6 +17,7 @@ type DocIconProps = TextType & {
1617
};
1718

1819
export const DocIcon = ({
20+
buttonProps,
1921
emoji,
2022
defaultIcon,
2123
$size = 'sm',
@@ -81,21 +83,21 @@ export const DocIcon = ({
8183
ref={iconRef}
8284
onClick={toggleEmojiPicker}
8385
color="tertiary-text"
86+
{...buttonProps}
8487
>
8588
{!emoji ? (
8689
defaultIcon
8790
) : (
88-
<Icon
91+
<Text
8992
{...textProps}
90-
iconName={emoji}
9193
$size={$size}
9294
$variation={$variation}
9395
$weight={$weight}
9496
aria-hidden="true"
9597
data-testid="doc-emoji-icon"
9698
>
9799
{emoji}
98-
</Icon>
100+
</Text>
99101
)}
100102
</BoxButton>
101103
{openEmojiPicker &&

src/frontend/apps/impress/src/features/docs/doc-share/components/DocVisibility.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ export const DocVisibility = ({ doc }: DocVisibilityProps) => {
147147
arrowCss={css`
148148
color: ${colorsTokens['primary-800']} !important;
149149
`}
150+
buttonCss={css`
151+
&:hover {
152+
background-color: unset;
153+
}
154+
`}
150155
disabled={!canManage}
151156
showArrow={true}
152157
topMessage={
@@ -184,6 +189,11 @@ export const DocVisibility = ({ doc }: DocVisibilityProps) => {
184189
<Box $direction="row" $align="center" $gap={spacingsTokens['3xs']}>
185190
<DropdownMenu
186191
testId="doc-access-mode"
192+
buttonCss={css`
193+
&:hover {
194+
background-color: unset;
195+
}
196+
`}
187197
disabled={!canManage}
188198
showArrow={true}
189199
options={linkRoleOptions}
@@ -196,7 +206,7 @@ export const DocVisibility = ({ doc }: DocVisibilityProps) => {
196206
}
197207
label={t('Document access mode')}
198208
>
199-
<Text $weight="initial" $variation="600">
209+
<Text $weight="initial" $variation="600" $theme="primary">
200210
{linkModeTranslations[docLinkRole]}
201211
</Text>
202212
</DropdownMenu>

src/frontend/apps/impress/src/features/docs/doc-tree/components/DocSubPageItem.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ export const DocSubPageItem = (props: TreeViewNodeProps<Doc>) => {
149149
`}
150150
>
151151
<TreeViewItem {...props} onClick={handleActivate}>
152+
<DocIcon
153+
emoji={emoji}
154+
withEmojiPicker={doc.abilities.partial_update}
155+
defaultIcon={<SubPageIcon color={colorsTokens['primary-400']} />}
156+
$size="sm"
157+
docId={doc.id}
158+
title={doc.title}
159+
/>
152160
<BoxButton
153161
onClick={(e) => {
154162
e.stopPropagation();
@@ -166,17 +174,6 @@ export const DocSubPageItem = (props: TreeViewNodeProps<Doc>) => {
166174
min-width: 0;
167175
`}
168176
>
169-
<Box>
170-
<DocIcon
171-
emoji={emoji}
172-
withEmojiPicker={doc.abilities.partial_update}
173-
defaultIcon={<SubPageIcon color={colorsTokens['primary-400']} />}
174-
$size="sm"
175-
docId={doc.id}
176-
title={doc.title}
177-
/>
178-
</Box>
179-
180177
<Box
181178
$direction="row"
182179
$align="center"

0 commit comments

Comments
 (0)