tachybase_todo/packages/plugins/@nocobase/plugin-mobile-client/src/client/router/OpenInNewTab.tsx
chenos b359f9eac6
feat: supports subdirectory deployment (#3731)
* feat: supports subdirectory deployment

* feat: auto publicPath

* fix: buildIndexHtml

* fix: format

* fix: regexp

* fix: test error

* fix: nocobase.conf

* fix: path

* fix: nocobase.conf

* fix: bugs

* fix: resourcer prefix

* fix: cas
2024-03-16 20:01:34 +08:00

29 lines
639 B
TypeScript

import { LinkOutlined } from '@ant-design/icons';
import { css, useApp } from '@nocobase/client';
import { Button } from 'antd';
import React from 'react';
import { useTranslation } from '../locale';
export const OpenInNewTab = () => {
const { t } = useTranslation();
const app = useApp();
const onOpenInNewTab = () => {
window.open(app.getRouteUrl('/mobile'));
};
return (
<div
className={css`
position: absolute;
top: -40px;
right: 0;
`}
>
<Button type="dashed" onClick={onOpenInNewTab} icon={<LinkOutlined />}>
{t('Preview')}
</Button>
</div>
);
};