Skip to content

Commit

Permalink
feat: update heading
Browse files Browse the repository at this point in the history
  • Loading branch information
oeyoews committed Oct 27, 2024
1 parent 15dc3f8 commit ffc6feb
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"publisher": "oeyoews",
"name": "usewiki2",
"displayName": "usewiki2",
"version": "2.3.0",
"version": "2.4.0",
"private": true,
"packageManager": "[email protected]",
"description": "",
Expand Down
33 changes: 21 additions & 12 deletions packages/react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from '@/components/ui/context-menu';
import { Button } from '@/components/ui/button';
import { Textarea } from './components/ui/textarea';
import twsvg from '../../../res/tw.svg';
import {
Card,
CardDescription,
Expand All @@ -26,8 +27,10 @@ import { getLinks } from './links';
import { useTranslation } from 'react-i18next';
import { ILanguage } from './i18n';

// @ts-expect-error
const vscode = acquireVsCodeApi();
const vscode =
// @ts-expect-error
typeof acquireVsCodeApi === 'function' ? acquireVsCodeApi() : null;

const messenger = new WebviewMessenger({ vscode });
function App() {
const { t, i18n } = useTranslation();
Expand Down Expand Up @@ -96,24 +99,30 @@ function App() {
}, []);

function showVsCodeLanguageInputBox() {
console.log('showVsCodeLanguageInputBox');
messenger.send('showVsCodeLanguageInputBox');
}

if (!vscode) {
return (
<div className="relative h-screen p-3 antialiased">
<h1 className="text-xl font-bold">UseWiki2</h1>
<p className="text-sm">Please use VS Code.</p>
</div>
);
}
// if (!vscode) {
// return (
// <div className="relative h-screen p-3 antialiased">
// <h1 className="text-xl font-bold">UseWiki2</h1>
// <p className="text-sm">Please use VS Code.</p>
// </div>
// );
// }

return (
<div className="relative h-screen p-3 antialiased">
<h1 className="text-xl font-bold">
UseWiki2{' '}
{t('app_name')}
<img
src={twsvg}
className="inline align-baseline mx-1"
alt=""
/>
<span
className="i-lucide-languages size-4"
className="i-lucide-languages size-4 cursor-pointer hover:scale-125 transition-all"
onClick={showVsCodeLanguageInputBox}></span>
</h1>
<ContextMenu>
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/locales/lang/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"app_name": "TiddlyWiki Helper",
"relatedLinks": "Related Links",
"sendToTiddlywiki": "Save To TiddlyWiki",
"selectLang": "Select Language",
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/locales/lang/zh_CN.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"app_name": "太微助手",
"relatedLinks": "相关链接",
"sendToTiddlywiki": "发送到 TiddlyWiki",
"selectLang": "选择语言",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/locales/links/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"tw_official_site": "TiddlyWiki Official Site",
"tw_official_site_description": "The official website for TiddlyWiki.",
"github": "Taiwei GitHub",
"github": "TiddlyWiki GitHub",
"github_description": "The TiddlyWiki5 source code",
"forum": "TiddlyWiki Official Forum",
"forum_description": "The official TiddlyWiki5 forum",
Expand Down
2 changes: 1 addition & 1 deletion src/generated/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Meta info
export const publisher = "oeyoews"
export const name = "usewiki2"
export const version = "2.2.0"
export const version = "2.4.0"
export const displayName = "usewiki2"
export const description = undefined
export const extensionId = `${publisher}.${name}`
Expand Down

0 comments on commit ffc6feb

Please sign in to comment.