* 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
29 lines
639 B
TypeScript
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>
|
|
);
|
|
};
|