Skip to content

Commit

Permalink
feat: Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nuintun committed Aug 18, 2023
1 parent 5754e2e commit 97ad1ae
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 5 deletions.
16 changes: 15 additions & 1 deletion packages/examples/src/css/App.module.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
.tabs {
height: 100%;

.logo {
.logo,
.source {
margin: 0 8px;
}

.logo {
height: 32px;
}

.source {
cursor: pointer;
display: inline-flex;

.github {
font-size: 32px;
}
}

.tabBarItem {
gap: 4px;
align-items: center;
Expand Down
3 changes: 3 additions & 0 deletions packages/examples/src/images/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion packages/examples/src/js/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { App, AppProps, ConfigProvider, Tabs, TabsProps } from 'antd';
import favicon from '/images/favicon.ico';
import EncodeIcon from '/images/encode.svg';
import DecodeIcon from '/images/decode.svg';
import GithubIcon from '/images/github.svg';

const Encode = lazy(() => import('/js/pages/Encode'));
const Decode = lazy(() => import('/js/pages/Decode'));
Expand Down Expand Up @@ -79,7 +80,14 @@ const Page = memo(function Page() {
);

const tabBarExtraContent = useMemo<TabsProps['tabBarExtraContent']>(() => {
return { left: <img className={styles.logo} src={favicon} alt="logo" /> };
return {
left: <img title="QRCode" className={styles.logo} src={favicon} alt="logo" />,
right: (
<a title="GitHub" className={styles.source} href="https://github.com/nuintun/qrcode" target="_blank">
<Icon className={styles.github} component={GithubIcon} />
</a>
)
};
}, []);

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/static/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="zh-CN"><head><meta charset="UTF-8"/><title>二维码</title><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="public/favicon.ico"/><script defer="defer" src="public/js/cf86bb1930b6a107.js"></script><script defer="defer" src="public/js/572e62eb2a30bc35.js"></script><script defer="defer" src="public/js/bd136746aab1b026.js"></script><link href="public/css/59837f13272d6811.css" rel="stylesheet"/></head><body><noscript>您已禁用 JavaScript,网站无法正常工作,请启用 JavaScript!</noscript><div id="app"></div></body></html>
<!doctype html><html lang="zh-CN"><head><meta charset="UTF-8"/><title>二维码</title><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="public/favicon.ico"/><script defer="defer" src="public/js/cf86bb1930b6a107.js"></script><script defer="defer" src="public/js/572e62eb2a30bc35.js"></script><script defer="defer" src="public/js/08f57fd31d3b25d5.js"></script><link href="public/css/284588a571178668.css" rel="stylesheet"/></head><body><noscript>您已禁用 JavaScript,网站无法正常工作,请启用 JavaScript!</noscript><div id="app"></div></body></html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/examples/static/public/js/08f57fd31d3b25d5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/examples/static/public/js/bd136746aab1b026.js

This file was deleted.

0 comments on commit 97ad1ae

Please sign in to comment.