Skip to content

Commit 0221373

Browse files
committed
feat(mobile): refactoring
1 parent a3098b4 commit 0221373

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

src/bundle/SelectPopup.scss renamed to src/bundle/PlatformPopup.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.g-md-select-popup {
1+
.g-md-platform-popup {
22
&__sheet {
33
--g-sheet-content-padding: 0px;
44

src/bundle/SelectPopup.tsx renamed to src/bundle/PlatformPopup.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ import {Popup, type PopupProps, Sheet} from '@gravity-ui/uikit';
44

55
import {cn} from '../classname';
66

7-
export type SelectPopupProps = Pick<PopupProps, 'placement' | 'open' | 'anchorElement'> & {
7+
export type PlatformPopupProps = Pick<PopupProps, 'placement' | 'open' | 'anchorElement'> & {
88
children: ReactNode;
99
mobile?: boolean;
1010
onClose?: () => void;
1111
};
1212

13-
import './SelectPopup.scss';
13+
import './PlatformPopup.scss';
1414

15-
const b = cn('select-popup');
15+
const b = cn('platform-popup');
1616

17-
export const SelectPopup: FC<SelectPopupProps> = ({
17+
export const PlatformPopup: FC<PlatformPopupProps> = ({
1818
mobile,
1919
children,
2020
onClose,

src/bundle/settings/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ import {noop} from '../../lodash';
2121
import {useBooleanState} from '../../react-utils/hooks';
2222
import {ToolbarTooltipDelay} from '../../toolbar';
2323
import {VERSION} from '../../version';
24-
import {SelectPopup} from '../SelectPopup';
2524
import type {MarkdownEditorMode, MarkdownEditorSplitMode} from '../types';
2625

2726
import {MarkdownHints} from './MarkdownHints';
2827

2928
import './index.scss';
3029

30+
import {PlatformPopup} from '../PlatformPopup';
31+
3132
const placement: PopupPlacement = ['bottom-end', 'top-end'];
3233

3334
const bSettings = cn('editor-settings');
@@ -91,7 +92,7 @@ export const EditorSettings = memo<EditorSettingsProps>(function EditorSettings(
9192
>
9293
<Icon data={Gear} />
9394
</Button>
94-
<SelectPopup
95+
<PlatformPopup
9596
mobile={mobile}
9697
open={popupShown}
9798
onClose={hidePopup}
@@ -104,7 +105,7 @@ export const EditorSettings = memo<EditorSettingsProps>(function EditorSettings(
104105
onClose={hidePopup}
105106
className={bSettings('content')}
106107
/>
107-
</SelectPopup>
108+
</PlatformPopup>
108109
</>
109110
)}
110111
</div>

src/toolbar/ToolbarListButton.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {Fragment, useEffect, useState} from 'react';
33
import {ChevronDown} from '@gravity-ui/icons';
44
import {HelpMark, Hotkey, Icon, Menu, Popover} from '@gravity-ui/uikit';
55

6-
import {SelectPopup} from '../bundle/SelectPopup';
6+
import {PlatformPopup} from 'src/bundle/PlatformPopup';
7+
78
import {cn} from '../classname';
89
import {i18n} from '../i18n/common';
910
import {isFunction} from '../lodash';
@@ -85,7 +86,7 @@ export function ToolbarListButton<E>({
8586
>
8687
{buttonContent}
8788
</ToolbarButtonView>
88-
<SelectPopup
89+
<PlatformPopup
8990
mobile={mobile}
9091
open={popupOpen}
9192
onClose={hide}
@@ -186,7 +187,7 @@ export function ToolbarListButton<E>({
186187
})
187188
.filter(Boolean)}
188189
</Menu>
189-
</SelectPopup>
190+
</PlatformPopup>
190191
{popupItem
191192
? popupItem.renderPopup({
192193
...popupItem,

0 commit comments

Comments
 (0)