|
1 | 1 | import { $, component$, useContext, useOnDocument, useSignal, useStyles$ } from '@qwik.dev/core';
|
2 | 2 | import { useContent, useLocation } from '@qwik.dev/router';
|
3 | 3 | import { GlobalStore } from '../../context';
|
4 |
| -import { AlertIcon } from '../svgs/alert-icon'; |
5 |
| -import { ChatIcon } from '../svgs/chat-icon'; |
6 |
| -import { EditIcon } from '../svgs/edit-icon'; |
7 |
| -import { GithubLogo } from '../svgs/github-logo'; |
8 |
| -import { TwitterLogo } from '../svgs/twitter-logo'; |
9 | 4 | import styles from './on-this-page.css?inline';
|
| 5 | +import { OnThisPageMore } from './on-this-page-more'; |
10 | 6 |
|
11 | 7 | const QWIK_GROUP = [
|
12 | 8 | 'components',
|
@@ -117,39 +113,9 @@ export const OnThisPage = component$(() => {
|
117 | 113 | const contentHeadings = headings?.filter((h) => h.level <= 3) || [];
|
118 | 114 |
|
119 | 115 | const { url } = useLocation();
|
120 |
| - |
121 | 116 | const githubEditRoute = makeEditPageUrl(url.pathname);
|
122 |
| - |
123 | 117 | const editUrl = `https://github.com/QwikDev/qwik/edit/main/packages/docs/src/routes/${githubEditRoute}/index.mdx`;
|
124 | 118 |
|
125 |
| - const OnThisPageMore = [ |
126 |
| - { |
127 |
| - href: editUrl, |
128 |
| - text: 'Edit this Page', |
129 |
| - icon: EditIcon, |
130 |
| - }, |
131 |
| - { |
132 |
| - href: 'https://github.com/QwikDev/qwik/issues/new/choose', |
133 |
| - text: 'Create an issue', |
134 |
| - icon: AlertIcon, |
135 |
| - }, |
136 |
| - { |
137 |
| - href: 'https://qwik.dev/chat', |
138 |
| - text: 'Join our community', |
139 |
| - icon: ChatIcon, |
140 |
| - }, |
141 |
| - { |
142 |
| - href: 'https://github.com/QwikDev/qwik', |
143 |
| - text: 'GitHub', |
144 |
| - icon: GithubLogo, |
145 |
| - }, |
146 |
| - { |
147 |
| - href: 'https://twitter.com/QwikDev', |
148 |
| - text: '@QwikDev', |
149 |
| - icon: TwitterLogo, |
150 |
| - }, |
151 |
| - ]; |
152 |
| - |
153 | 119 | const useActiveItem = (itemIds: string[]) => {
|
154 | 120 | const activeId = useSignal<string | null>(null);
|
155 | 121 | useOnDocument(
|
@@ -214,29 +180,9 @@ export const OnThisPage = component$(() => {
|
214 | 180 | </li>
|
215 | 181 | ))}
|
216 | 182 | </ul>
|
| 183 | + <OnThisPageMore theme={theme.theme} editUrl={editUrl} /> |
217 | 184 | </>
|
218 | 185 | ) : null}
|
219 |
| - |
220 |
| - <h6>More</h6> |
221 |
| - <ul class="px-2 font-medium text-[var(--interactive-text-color)]"> |
222 |
| - {OnThisPageMore.map((el, index) => { |
223 |
| - return ( |
224 |
| - <li |
225 |
| - class={`${ |
226 |
| - theme.theme === 'light' |
227 |
| - ? 'hover:bg-[var(--qwik-light-blue)]' |
228 |
| - : 'hover:bg-[var(--on-this-page-hover-bg-color)]' |
229 |
| - } rounded-lg`} |
230 |
| - key={`more-items-on-this-page-${index}`} |
231 |
| - > |
232 |
| - <a class="more-item" href={el.href} rel="noopener" target="_blank"> |
233 |
| - <el.icon width={20} height={20} /> |
234 |
| - <span>{el.text}</span> |
235 |
| - </a> |
236 |
| - </li> |
237 |
| - ); |
238 |
| - })} |
239 |
| - </ul> |
240 | 186 | </aside>
|
241 | 187 | );
|
242 | 188 | });
|
0 commit comments