Skip to content

Commit

Permalink
chore: add i18n and fix ci path problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Marckon committed Feb 6, 2025
1 parent 430c44d commit 385d23a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/i18n/src/common/en-US.lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,7 @@ export const localizationBundle = {
'main-layout.bottom-panel.toggle': 'Toggle Bottom Side Bar',
'main-layout.bottom-panel.show': 'Show Bottom Side Bar',
'main-layout.bottom-panel.hide': 'Hide Bottom Side Bar',
'main-layout.drop-area.tip': 'drop here',

'refactor-preview.title': 'REFACTOR PREVIEW',
'refactor-preview.title.clear': 'Discard Refactoring',
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/common/zh-CN.lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ export const localizationBundle = {
'main-layout.bottom-panel.toggle': '切换底部面板',
'main-layout.bottom-panel.show': '显示底部面板',
'main-layout.bottom-panel.hide': '隐藏底部面板',
'main-layout.drop-area.tip': '放置此处',

'refactor-preview.title': '重构预览',
'refactor-preview.title.clear': '放弃重构',
Expand Down
20 changes: 13 additions & 7 deletions packages/main-layout/src/browser/drop-area/drop-area.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';

import { useInjectable } from '@opensumi/ide-core-browser';
import { IMainLayoutService } from '@opensumi/ide-main-layout';
import { localize, useInjectable } from '@opensumi/ide-core-browser';

import { IMainLayoutService } from '../../common';

import styles from './styles.module.less';

Expand All @@ -13,18 +14,23 @@ const DropArea: React.FC<IDropAreaProps> = (props) => {
const { location } = props;
const layoutService = useInjectable<IMainLayoutService>(IMainLayoutService);

const handleDrop = React.useCallback(
(e: React.DragEvent) => {
const containerId = e.dataTransfer?.getData('containerId');
layoutService.moveContainerTo(containerId, location);
},
[layoutService, location],
);

return (
<div
className={styles.drop_area}
onDrop={(e) => {
const containerId = e.dataTransfer?.getData('containerId');
layoutService.moveContainerTo(containerId, location);
}}
onDrop={handleDrop}
onDragOver={(e) => {
e.preventDefault();
}}
>
drop here
{localize('main-layout.drop-area.tip')}
</div>
);
};
Expand Down

0 comments on commit 385d23a

Please sign in to comment.