Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Dropdown for Installation Commands on Homepage #1612

Merged
merged 14 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
updated bun command with @latest, cleaned up menu to match padding an…
…d font weight
  • Loading branch information
Jacksonmills committed Oct 20, 2023
commit 378367a3e47a7e7c5f191bb4354e694d861c9cca
2 changes: 1 addition & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pnpm create t3-app@latest
### bun

```bash
bun create t3-app
bun create t3-app@latest
```

For more advanced usage, check out the [CLI docs](https://create.t3.gg/en/installation).
Expand Down
19 changes: 10 additions & 9 deletions www/src/components/landingPage/ClipboardSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,30 @@ import { Fragment, useState } from "react";

const commands = [
{
command: "npm create t3-app@latest",
command: "create t3-app@latest",
manager: "npm",
},
{
command: "yarn create t3-app",
command: "create t3-app",
manager: "yarn",
},
{
command: "pnpm create t3-app@latest",
command: "create t3-app@latest",
manager: "pnpm",
},
{
command: "bun create t3-app",
command: "create t3-app@latest",
manager: "bun",
},
];

export default function ClipboardSelect() {
const [coolDown, setCoolDown] = useState(false);

const handleCopyToClipboard = async (command: string) => {
const handleCopyToClipboard = async (manager: string, command: string) => {
const nextClipboard = `${manager} ${command}`;
try {
await navigator.clipboard.writeText(command);
await navigator.clipboard.writeText(nextClipboard);
} catch (err) {
console.error("Failed to copy text: ", err);
}
Expand Down Expand Up @@ -86,16 +87,16 @@ export default function ClipboardSelect() {
"focus-none shadow-l t3-scrollbar absolute right-0 mt-1 max-h-60 w-fit min-w-[6em] overflow-auto rounded-lg border bg-default text-base focus:outline-none focus-visible:outline-none dark:border-t3-purple-200/20 sm:text-sm",
)}
>
{commands.map(({ command, manager }) => (
{commands.map(({ manager, command }) => (
<Menu.Item key={manager}>
{({ active }) => {
return (
<button
className={`${
active && "bg-t3-purple-200/20"
} group flex w-full items-center bg-t3-purple-200/10 px-2 py-2 text-sm hover:bg-t3-purple-200/20`}
} group flex w-full items-center bg-t3-purple-200/10 px-4 py-2 text-sm font-medium hover:bg-t3-purple-200/20`}
onClick={() => {
handleCopyToClipboard(command)
handleCopyToClipboard(manager, command)
.then(() => {
setCoolDown(true);
setTimeout(() => {
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/ar/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pnpm create t3-app@latest
### bun

```bash
bun create t3-app
bun create t3-app@latest
```

بعد أن تَنتهي عَملية إنشاء التطبيق، اَلق نَظرة عَلي [الخطوات الأولى](/ar/usage/first-steps) للبدء في تطبيقك الجديد.
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/en/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pnpm create t3-app@latest
### bun

```bash
bun create t3-app
bun create t3-app@latest
```

After your app has been scaffolded, check out the [first steps](/en/usage/first-steps) to get started on your new application.
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/es/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pnpm create t3-app@latest
### bun

```bash
bun create t3-app
bun create t3-app@latest
```

Después de que tu aplicación haya sido creada, consulta los [primeros pasos](/es/usage/first-steps) para comenzar con tu nueva aplicación.
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/fr/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pnpm create t3-app@latest
### bun

```bash
bun create t3-app
bun create t3-app@latest
```

Une fois votre application configurée, consultez les [premières étapes](/fr/usage/first-steps) pour démarrer sur votre nouvelle application.
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/ja/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pnpm create t3-app@latest
### bun

```bash
bun create t3-app
bun create t3-app@latest
```

アプリケーションの初期構成が生成されたら、[ファーストステップ](/ja/usage/first-steps) をチェックして、新しいアプリケーションを開始しましょう。
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/no/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pnpm create t3-app@latest
### bun

```bash
bun create t3-app
bun create t3-app@latest
```

Etter at applikasjonen din har blitt opprettet, sjekk ut [første steg](/no/usage/first-steps) for å begynne å utvikle den nye applikasjonen.
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/pl/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pnpm create t3-app@latest
### bun

```bash
bun create t3-app
bun create t3-app@latest
```

Po tym, jak szablon aplikacji zostanie utworzony, sprawdź [pierwsze kroki](/pl/usage/first-steps) aby zacząć budować swoją nową aplikację.
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/pt/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pnpm create t3-app@latest
### bun

```bash
bun create t3-app
bun create t3-app@latest
```

Após sua aplicação ter sido estruturada, verifique os [Primeiros Passos](/pt/usage/first-steps) para começar a usar sua nova aplicação.
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/ru/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pnpm create t3-app@latest
### bun

```bash
bun create t3-app
bun create t3-app@latest
```

После того, как приложение будет создано, ознакомьтесь с [первыми шагами](/ru/usage/first-steps), чтобы начать работу над вашим новым приложением.
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/zh-hans/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pnpm create t3-app@latest
### bun

```bash
bun create t3-app
bun create t3-app@latest
```

在你的应用程序被创建后,请查看 [第一步](/zh-hans/usage/first-steps) 以开始你的新应用。
Expand Down
Loading