Skip to content

Commit e30a174

Browse files
committed
feat(snippets): add snippets showcase link
1 parent d293d1f commit e30a174

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

src/renderer/assets/scss/base.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,9 @@ h6 {
9494
font-size: var(--text-sm);
9595
color: var(--color-text-3);
9696
margin-top: var(--spacing-xs);
97+
}
98+
99+
.link {
100+
text-decoration: underline;
101+
cursor: pointer;
97102
}

src/renderer/components/editor/EditorPreview.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
/>
1313
</div>
1414
<div class="right">
15+
<div
16+
class="link"
17+
@click="onClickSnippetShowcase"
18+
>
19+
Snippets Showcase
20+
</div>
1521
<AppActionButton @click="onSaveToHtml">
1622
<UniconsFileDownload />
1723
</AppActionButton>
@@ -37,6 +43,7 @@ import { useSnippetStore } from '@/store/snippets'
3743
import { computed, ref, onMounted, watch } from 'vue'
3844
import interact from 'interactjs'
3945
import { useAppStore } from '@/store/app'
46+
import { ipc, track } from '@/electron'
4047
4148
const snippetStore = useSnippetStore()
4249
const appStore = useAppStore()
@@ -96,6 +103,11 @@ const onSaveToHtml = () => {
96103
a.click()
97104
}
98105
106+
const onClickSnippetShowcase = () => {
107+
ipc.invoke('main:open-url', 'https://masscode.io/snippets')
108+
track('app/open-url', 'https://masscode.io/snippets')
109+
}
110+
99111
onMounted(() => {
100112
interact(previewRef.value).resizable({
101113
edges: { top: true },
@@ -114,12 +126,18 @@ onMounted(() => {
114126
height: calc(v-bind(height) - 34px);
115127
}
116128
.tools {
129+
display: flex;
117130
height: 34px;
118131
display: flex;
119132
justify-content: space-between;
120133
align-items: center;
121134
padding: 4px var(--spacing-xs);
122135
border-bottom: 1px solid var(--color-border);
136+
.right {
137+
display: flex;
138+
align-items: center;
139+
gap: var(--spacing-xs);
140+
}
123141
}
124142
iframe {
125143
background-color: #fff;

src/shared/types/main/analytics.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type TagEvents = 'add-new' | 'delete'
2222
type AppEvents =
2323
| 'move-storage'
2424
| 'open-storage'
25+
| 'open-url'
2526
| 'migrate'
2627
| 'update'
2728
| 'install'

0 commit comments

Comments
 (0)