Skip to content

Commit cf385fd

Browse files
committed
Route external links through open website command in Home component
- should open the changelog through backend [Pasted text] ├── apps │ └── editor │ └── src │ └── views │ ├── prompt │ │ ├── backend │ │ │ ├── message-handlers │ │ │ │ ├── handle-open-website.ts │ │ │ │ └── index.ts │ │ │ └── prompt-view-provider.ts │ │ ├── frontend │ │ │ ├── Home │ │ │ │ └── Home.tsx │ │ │ ├── i18n │ │ │ │ └── translations │ │ │ │ └── home.ts │ │ │ └── utils │ │ │ └── post-message.ts │ │ └── types │ │ └── messages.ts │ └── shared │ └── utils │ └── webview-html.ts └── packages └── ui └── src └── components └── editor └── prompt-view └── UpdateAvailable └── UpdateAvailable.tsx
1 parent 288d940 commit cf385fd

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

  • apps/editor/src/views/prompt/frontend/Home

‎apps/editor/src/views/prompt/frontend/Home/Home.tsx‎

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,15 @@ export const Home: React.FC<Props> = (props) => {
191191
) : undefined,
192192
changelog: (
193193
<a
194-
href="https://github.com/robertpiosik/CodeWebChat/releases"
195-
onClick={(e) => e.stopPropagation()}
194+
href="#"
195+
onClick={(e) => {
196+
e.preventDefault()
197+
e.stopPropagation()
198+
post_message(props.vscode, {
199+
command: 'OPEN_WEBSITE',
200+
url: 'https://github.com/robertpiosik/CodeWebChat/releases'
201+
})
202+
}}
196203
>
197204
{t('home.update.changelog')}
198205
</a>
@@ -317,7 +324,20 @@ export const Home: React.FC<Props> = (props) => {
317324
id="home.footer.copyright"
318325
components={{
319326
year: new Date().getFullYear().toString(),
320-
link: <a href="https://x.com/robertpiosik">Robert Piosik</a>
327+
link: (
328+
<a
329+
href="#"
330+
onClick={(e) => {
331+
e.preventDefault()
332+
post_message(props.vscode, {
333+
command: 'OPEN_WEBSITE',
334+
url: 'https://x.com/robertpiosik'
335+
})
336+
}}
337+
>
338+
Robert Piosik
339+
</a>
340+
)
321341
}}
322342
/>
323343
</div>

0 commit comments

Comments
 (0)