Skip to content

Commit

Permalink
feat: update style
Browse files Browse the repository at this point in the history
  • Loading branch information
wqcstrong committed Feb 19, 2025
1 parent 8e9a928 commit dbddb16
Showing 1 changed file with 30 additions and 25 deletions.
55 changes: 30 additions & 25 deletions src/pages/ReplayLab/components/Welcome/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Icon from '@ant-design/icons';
import { ImportGuide } from '../ImportGuide';
import { useEffect } from 'react';
import demo from './demo.json?url';
import { useThreshold } from '@/utils/useThreshold';

export const Welcome = () => {
const { t } = useTranslation();
Expand All @@ -30,6 +31,8 @@ export const Welcome = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const isMobile = useThreshold(414);

return (
<Flex
vertical
Expand All @@ -52,33 +55,35 @@ export const Welcome = () => {
数据都在本地,不经过网络传输,无需担心隐私泄露
</Trans>
</h5>
<Flex gap={12} align="center">
<Popover content={ImportGuide} trigger="click">
<Button
type="primary"
size="large"
icon={<Icon component={CodeBlockSvg} style={{ fontSize: 20 }} />}
>
<b>{t('common.inject-sdk')}</b>
</Button>
</Popover>
<Flex gap={12} vertical={isMobile} justify="center" align="center">
<Flex gap={12}>
<Popover content={ImportGuide} trigger="click">
<Button
type="primary"
size="large"
icon={<Icon component={CodeBlockSvg} style={{ fontSize: 20 }} />}
>
<b>{t('common.inject-sdk')}</b>
</Button>
</Popover>

<Upload
accept=".json"
maxCount={1}
customRequest={(file) => {
const blob = URL.createObjectURL(file.file as File);
gotoReplay(blob);
}}
itemRender={() => null}
>
<Button
size="large"
icon={<Icon component={PaperClipSvg} style={{ fontSize: 20 }} />}
<Upload
accept=".json"
maxCount={1}
customRequest={(file) => {
const blob = URL.createObjectURL(file.file as File);
gotoReplay(blob);
}}
itemRender={() => null}
>
<b>{t('lab.select-log')}</b>
</Button>
</Upload>
<Button
size="large"
icon={<Icon component={PaperClipSvg} style={{ fontSize: 20 }} />}
>
<b>{t('lab.select-log')}</b>
</Button>
</Upload>
</Flex>
<Link
to="?demo"
target="_blank"
Expand Down

0 comments on commit dbddb16

Please sign in to comment.