-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: refactor <UiFrameworkExtension> (#1665)
* minor refactor: rename <UiFrameworkVikeExtensionNames => <UiFrameworkVikeExtension name * minor refactor: rename UiFrameworkVikeExtensionNames => UiFrameworkVikeExtension * dedupe import * update UiFrameworkVikeExtension impl * minor refactor: rename UiFrameworkVikeExtension => UiFrameworkExtension * remove unused imports * minor refactor: rename UiFrameworkExtension name => UiFrameworkExtension name noLink * minor refactor: rename noLink links => * update UiFrameworExtension impl * minor refactor: rename <UiFrameworkExtension\/> => <UiFrameworkExtension \/> * minor refactor: rename <UiFrameworkExtension name\/> => <UiFrameworkExtension name \/> * minor refactor
- Loading branch information
Showing
41 changed files
with
150 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Link } from '@brillout/docpress' | ||
import { UiFrameworkVikeExtension } from '../components' | ||
import { UiFrameworkExtension } from '../components' | ||
|
||
> The <UiFrameworkVikeExtension plural /> use Client Routing. If you don't use such Vike extension, then Vike does Server Routing by default while you can <Link href="/clientRouting">opt into Client Routing</Link>. | ||
> The <UiFrameworkExtension plural /> use Client Routing. If you don't use such Vike extension, then Vike does Server Routing by default while you can <Link href="/clientRouting">opt into Client Routing</Link>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
export { UiFrameworkExtension } | ||
|
||
import React from 'react' | ||
import { Link } from '@brillout/docpress' | ||
|
||
function UiFrameworkExtension({ | ||
name, | ||
noLink, | ||
plural, | ||
comma, | ||
list = ['vike-react', 'vike-vue', 'vike-solid'] | ||
}: { | ||
name?: true | ||
noLink?: true | ||
plural?: true | ||
comma?: true | ||
list?: `vike-${'react' | 'vue' | 'solid'}`[] | ||
}) { | ||
let content = ( | ||
<> | ||
{list.map((name, i) => { | ||
let content = <code>{name}</code> | ||
if (!noLink) content = <Link href={`/${name}`}>{content}</Link> | ||
const isLast1 = i === list.length - 1 | ||
const isLast2 = i === list.length - 2 | ||
if (!isLast1) { | ||
let sep = '/' | ||
if (comma) { | ||
if (isLast2) { | ||
sep = ', or ' | ||
} else { | ||
sep = ', ' | ||
} | ||
} | ||
content = ( | ||
<> | ||
{content} | ||
{sep} | ||
</> | ||
) | ||
} | ||
return <React.Fragment key={name}>{content}</React.Fragment> | ||
})} | ||
</> | ||
) | ||
|
||
if (!name) { | ||
const linkText = `Vike extension${plural ? 's' : ''}` | ||
const linkOrText = noLink ? linkText : <Link href="/extensions">{linkText}</Link> | ||
content = ( | ||
<> | ||
UI framework {linkOrText} {content} | ||
</> | ||
) | ||
} | ||
return content | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.